{"id":401,"date":"2013-09-19T16:19:37","date_gmt":"2013-09-19T07:19:37","guid":{"rendered":"https:\/\/blog.id774.net\/entry\/?p=401"},"modified":"2013-09-24T23:12:26","modified_gmt":"2013-09-24T14:12:26","slug":"hadoop-streaming-%e3%81%a7%e3%82%b8%e3%83%a7%e3%83%96%e3%81%ae%e9%80%a3%e7%b5%90%e3%82%92%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.id774.net\/entry\/2013\/09\/19\/401\/","title":{"rendered":"Hadoop Streaming \u3067\u30b8\u30e7\u30d6\u306e\u9023\u7d50\u3092\u3059\u308b"},"content":{"rendered":"<p>\u3059\u3067\u306b<a href=\"https:\/\/blog.id774.net\/entry\/2013\/09\/06\/399\/\">\u524d\u56de\u306e\u30d7\u30ec\u30bc\u30f3\u8cc7\u6599<\/a>\u306a\u3069\u3067\u3082\u30c1\u30e9\u30c3\u3068\u89e6\u308c\u3066\u3044\u308b\u306e\u3067\u76ee\u65b0\u3057\u3044\u60c5\u5831\u306f\u7121\u3044\u306e\u3060\u3051\u3069 <a href=\"http:\/\/hadoop.apache.org\/docs\/stable\/streaming.html\">Hadoop Streaming<\/a> \u3067\u30b8\u30e7\u30d6\u3092\u6b21\u3005\u3068\u9023\u7d50\u3055\u305b\u3066\u4f55\u304b\u3092\u3057\u305f\u3044\u3068\u304d\u306e\u30ce\u30a6\u30cf\u30a6\u307e\u3068\u3081\u3002<\/p>\n<p><strong>\u30b8\u30e7\u30d6\u306e\u6b63\u5e38\u7d42\u4e86\u3092\u78ba\u8a8d\u3059\u308b<\/strong><\/p>\n<p>\u51fa\u529b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b _SUCCESS \u304c\u4f5c\u6210\u3055\u308c\u308b\u306f\u305a\u306a\u306e\u3067\u305d\u306e\u6709\u7121\u3092\u78ba\u8a8d\u3059\u308c\u3070\u826f\u3044\u3002<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">hadoop fs -get $HDFS_OUT\/_SUCCESS&gt;&gt;$JOBLOG 2&gt;&amp;1<br \/>\ntest -f _SUCCESS &amp;&amp; \u6210\u529f\u6642\u51e6\u7406<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p><strong>\u5148\u884c\u30b8\u30e7\u30d6\u306e\u51fa\u529b\u7d50\u679c\u3092\u5f8c\u7d9a\u30b8\u30e7\u30d6\u306b\u6e21\u3059<\/strong><\/p>\n<p>\u5358\u7d14\u306b\u5148\u884c\u30b8\u30e7\u30d6\u306e\u51fa\u529b\u7d50\u679c\u3092 -input \u3067\u8aad\u307f\u53d6\u308c\u3070\u826f\u3044\u3002\u30b8\u30e7\u30d6\u306e\u5148\u884c\u5f8c\u7d9a\u95a2\u4fc2\u306f\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u76f4\u5217\u3067\u4e26\u3079\u308c\u3070\u5b9a\u7fa9\u3067\u304d\u308b\u3002<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">job1\/bin\/run&gt;&gt;job1\/log\/job.log 2&gt;&amp;1<br \/>\njob2\/bin\/run&gt;&gt;job2\/log\/job.log 2&gt;&amp;1<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p><strong>\u4ed6\u306e\u30b8\u30e7\u30d6\u306e\u7d50\u679c\u3092\u5229\u7528\u3059\u308b<\/strong><\/p>\n<p>\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5\u304c<a href=\"http:\/\/blog.livedoor.jp\/maru_tak\/archives\/50796391.html\">\u3053\u3053<\/a>\u3084<a href=\"http:\/\/blog.livedoor.jp\/sasata299\/archives\/51431092.html\">\u3053\u3053<\/a>\u3067\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u3002\u5de8\u5927\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u304b\u3089\u6301\u3063\u3066\u304f\u308b\u306e\u306f\u52b9\u7387\u304c\u826f\u304f\u306a\u3044\u3051\u3069\u3001\u4f55\u304b\u306e\u5206\u5e03\u8868\u3068\u304b\u306e\u3088\u3046\u306b\u5224\u65ad\u306e\u57fa\u6e96\u3068\u306a\u308b\u30c7\u30fc\u30bf\u304c\u542b\u307e\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306e\u306b\u306f\u4f7f\u3048\u305d\u3046\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306b -file \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8aad\u307f\u8fbc\u3080\u3002<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">-file job3\/log\/result.log<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u3042\u3068\u306f\u666e\u901a\u306b\u30b3\u30fc\u30c9\u304b\u3089\u30aa\u30fc\u30d7\u30f3\u3059\u308c\u3070\u826f\u3044\u3002<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\">&nbsp; @external_file = &quot;result.log&quot;<br \/>\n&nbsp; def read_from_external<br \/>\n&nbsp; &nbsp; open(@external_file) do |file|<br \/>\n&nbsp; &nbsp; &nbsp; file.each do |line|<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; @external &lt;&lt; line<br \/>\n&nbsp; &nbsp; &nbsp; end<br \/>\n&nbsp; &nbsp; end<br \/>\n&nbsp; end<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>\u30e1\u30e2\u30ea\u306b\u8f09\u305b\u308b\u3068\u3059\u3054\u3044\u30b5\u30a4\u30ba\u306b\u306a\u308b\u3088\u3046\u306a\u5de8\u5927\u306a\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3053\u3046\u3044\u3046\u4f7f\u3044\u65b9\u3092\u3057\u3066\u306f\u3044\u3051\u306a\u3044\u3002\u5c0f\u3055\u3044\u30d5\u30a1\u30a4\u30eb\u306a\u3089\u30e1\u30e2\u30ea\u306b\u8f09\u305b\u305f\u307b\u3046\u304c\u51e6\u7406\u304c\u30e9\u30af\u3060\u308d\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3059\u3067\u306b\u524d\u56de\u306e\u30d7\u30ec\u30bc\u30f3\u8cc7\u6599\u306a\u3069\u3067\u3082\u30c1\u30e9\u30c3\u3068\u89e6\u308c\u3066\u3044\u308b\u306e\u3067\u76ee\u65b0\u3057\u3044\u60c5\u5831\u306f\u7121\u3044\u306e\u3060\u3051\u3069 Hadoop Streaming \u3067\u30b8\u30e7\u30d6\u3092\u6b21\u3005\u3068\u9023\u7d50\u3055\u305b\u3066\u4f55\u304b\u3092\u3057\u305f\u3044\u3068\u304d\u306e\u30ce\u30a6\u30cf\u30a6\u307e\u3068\u3081\u3002 \u30b8\u30e7\u30d6\u306e\u6b63\u5e38\u7d42\u4e86\u3092\u78ba\u8a8d\u3059\u308b \u51fa\u529b\u30c7\u30a3\u30ec\u30af\u30c8 &#8230; <a title=\"Hadoop Streaming \u3067\u30b8\u30e7\u30d6\u306e\u9023\u7d50\u3092\u3059\u308b\" class=\"read-more\" href=\"https:\/\/blog.id774.net\/entry\/2013\/09\/19\/401\/\" aria-label=\"Hadoop Streaming \u3067\u30b8\u30e7\u30d6\u306e\u9023\u7d50\u3092\u3059\u308b \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-401","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/comments?post=401"}],"version-history":[{"count":0,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/401\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/media?parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/categories?post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/tags?post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}