{"id":1423,"date":"2025-10-06T22:11:03","date_gmt":"2025-10-06T14:11:03","guid":{"rendered":"https:\/\/www.vcidc.net\/blog\/?p=1423"},"modified":"2025-10-06T22:11:03","modified_gmt":"2025-10-06T14:11:03","slug":"%e6%b7%b1%e5%85%a5%e8%a7%a3%e8%af%bb%e8%b4%b5%e9%98%b3%e5%a4%a7%e6%95%b0%e6%8d%ae%e4%b8%ad%e5%bf%83%ef%bc%9a%e6%8a%80%e6%9c%af%e6%a6%82%e8%bf%b0%e4%b8%8e%e6%93%8d%e4%bd%9c%e5%ae%9e%e8%b7%b5","status":"publish","type":"post","link":"https:\/\/www.vcidc.net\/blog\/1423.html","title":{"rendered":"\u6df1\u5165\u89e3\u8bfb\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\uff1a\u6280\u672f\u6982\u8ff0\u4e0e\u64cd\u4f5c\u5b9e\u8df5"},"content":{"rendered":"<p><h2>\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u7b80\u4ecb\u53ca\u6280\u672f\u6982\u8ff0<\/h2>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.vcidc.net\/blog\/wp-content\/uploads\/2025\/07\/GoIEsOo.jpg\" alt=\"\u6df1\u5165\u89e3\u8bfb\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\uff1a\u6280\u672f\u6982\u8ff0\u4e0e\u64cd\u4f5c\u5b9e\u8df5\" title=\"\u6df1\u5165\u89e3\u8bfb\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\uff1a\u6280\u672f\u6982\u8ff0\u4e0e\u64cd\u4f5c\u5b9e\u8df5\"><\/p>\n<p>\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u662f\u4e2d\u56fd\u91cd\u8981\u7684\u6570\u636e\u4e2d\u5fc3\u4e4b\u4e00\uff0c\u4f9d\u6258\u4e8e\u8d35\u5dde\u7701\u7684\u5730\u7406\u4f18\u52bf\u548c\u653f\u5e9c\u7684\u5927\u529b\u652f\u6301\uff0c\u5df2\u6210\u4e3a\u5168\u7403\u5927\u6570\u636e\u4ea7\u4e1a\u7684\u91cd\u8981\u57fa\u5730\u3002\u8be5\u4e2d\u5fc3\u91c7\u7528\u5148\u8fdb\u7684\u6280\u672f\uff0c\u5982\u4e91\u8ba1\u7b97\u3001\u5927\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u7b49\uff0c\u4e3a\u5404\u7c7b\u4f01\u4e1a\u548c\u7814\u7a76\u673a\u6784\u63d0\u4f9b\u9ad8\u6548\u7684\u6570\u636e\u5b58\u50a8\u3001\u5904\u7406\u548c\u5206\u6790\u670d\u52a1\u3002<\/p>\n<p>\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5728\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u8fdb\u884c\u6570\u636e\u64cd\u4f5c\u7684\u76f8\u5173\u6b65\u9aa4\uff0c\u5305\u62ec\u6570\u636e\u4e0a\u4f20\u3001\u5904\u7406\u548c\u5206\u6790\u7b49\uff0c\u5e76\u901a\u8fc7\u547d\u4ee4\u793a\u4f8b\u548c\u89e3\u91ca\u6765\u5e2e\u52a9\u8bfb\u8005\u7406\u89e3\u548c\u5b9e\u8df5\u3002<\/p>\n<p><h2>\u6570\u636e\u4e0a\u4f20\u5230\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3<\/h2>\n<\/p>\n<p><h3>\u64cd\u4f5c\u6b65\u9aa4<\/h3>\n<\/p>\n<p>1. \u51c6\u5907\u6570\u636e\u6587\u4ef6\u3002<\/p>\n<p>2. \u767b\u5f55\u5230\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u7684\u4e91\u5e73\u53f0\u3002<\/p>\n<p>3. \u521b\u5efa\u6570\u636e\u5b58\u50a8\u6876\u3002<\/p>\n<p>4. \u4e0a\u4f20\u6570\u636e\u6587\u4ef6\u5230\u5b58\u50a8\u6876\u3002<\/p>\n<p><h3>\u547d\u4ee4\u793a\u4f8b<\/h3>\n<\/p>\n<p><pre><code>hadoop fs -put \/local\/path\/to\/data \/hadoop\/path\/to\/bucket<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p>\u8fd9\u91cc\uff0c`\/local\/path\/to\/data` \u662f\u672c\u5730\u6570\u636e\u6587\u4ef6\u7684\u8def\u5f84\uff0c`\/hadoop\/path\/to\/bucket` \u662f\u5728Hadoop\u6587\u4ef6\u7cfb\u7edf\u4e2d\u521b\u5efa\u7684\u5b58\u50a8\u6876\u8def\u5f84\u3002<\/p>\n<p><h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p>&#8211; \u786e\u4fdd\u6570\u636e\u6587\u4ef6\u8def\u5f84\u6b63\u786e\u65e0\u8bef\u3002<\/p>\n<p>&#8211; \u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\uff0c\u786e\u4fdd\u4e0a\u4f20\u901f\u5ea6\u3002<\/p>\n<p>&#8211; \u9009\u62e9\u5408\u9002\u7684\u5b58\u50a8\u6876\u7c7b\u578b\uff0c\u5982HDFS\u6216\u5bf9\u8c61\u5b58\u50a8\u3002<\/p>\n<p><h2>\u6570\u636e\u5904\u7406\u548c\u5206\u6790<\/h2>\n<\/p>\n<p><h3>\u64cd\u4f5c\u6b65\u9aa4<\/h3>\n<\/p>\n<p>1. \u7f16\u5199\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u811a\u672c\u3002<\/p>\n<p>2. \u5728\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u7684\u4e91\u5e73\u53f0\u4e0a\u8fd0\u884c\u811a\u672c\u3002<\/p>\n<p>3. \u83b7\u53d6\u5206\u6790\u7ed3\u679c\u3002<\/p>\n<p><h3>\u547d\u4ee4\u793a\u4f8b<\/h3>\n<\/p>\n<p><pre><code>hadoop jar \/path\/to\/hadoop-streaming.jar \\<\/p>\r\n<p>    -D mapreduce.job.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator \\<\/p>\r\n<p>    -D mapreduce.partition.keycomparator.options=-k1,1r \\<\/p>\r\n<p>    -files \/path\/to\/script.sh,\/path\/to\/input.txt \\<\/p>\r\n<p>    -input \/hadoop\/path\/to\/input \\<\/p>\r\n<p>    -output \/hadoop\/path\/to\/output<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p>\u8fd9\u91cc\uff0c`\/path\/to\/script.sh` \u662f\u5904\u7406\u811a\u672c\uff0c`\/path\/to\/input.txt` \u662f\u8f93\u5165\u6587\u4ef6\uff0c`\/hadoop\/path\/to\/input` \u662fHadoop\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u8f93\u5165\u8def\u5f84\uff0c`\/hadoop\/path\/to\/output` \u662f\u8f93\u51fa\u8def\u5f84\u3002<\/p>\n<p><h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p>&#8211; \u786e\u4fdd\u811a\u672c\u6b63\u786e\u65e0\u8bef\uff0c\u5e76\u4e14\u6709\u6267\u884c\u6743\u9650\u3002<\/p>\n<p>&#8211; \u6839\u636e\u6570\u636e\u91cf\u548c\u5206\u6790\u9700\u6c42\u8c03\u6574\u8d44\u6e90\u5206\u914d\u3002<\/p>\n<p>&#8211; \u76d1\u63a7\u4f5c\u4e1a\u72b6\u6001\uff0c\u786e\u4fdd\u5206\u6790\u987a\u5229\u8fdb\u884c\u3002<\/p>\n<p><h2>\u6570\u636e\u4e0b\u8f7d<\/h2>\n<\/p>\n<p><h3>\u64cd\u4f5c\u6b65\u9aa4<\/h3>\n<\/p>\n<p>1. \u767b\u5f55\u5230\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u7684\u4e91\u5e73\u53f0\u3002<\/p>\n<p>2. \u5b9a\u4f4d\u5230\u9700\u8981\u4e0b\u8f7d\u7684\u6570\u636e\u5b58\u50a8\u6876\u3002<\/p>\n<p>3. \u4e0b\u8f7d\u6570\u636e\u6587\u4ef6\u3002<\/p>\n<p><h3>\u547d\u4ee4\u793a\u4f8b<\/h3>\n<\/p>\n<p><pre><code>hadoop fs -get \/hadoop\/path\/to\/bucket\/data \/local\/path\/to\/download<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p>\u8fd9\u91cc\uff0c`\/hadoop\/path\/to\/bucket\/data` \u662f\u9700\u8981\u4e0b\u8f7d\u7684\u6570\u636e\u6587\u4ef6\u8def\u5f84\uff0c`\/local\/path\/to\/download` \u662f\u672c\u5730\u4e0b\u8f7d\u8def\u5f84\u3002<\/p>\n<p><h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p>&#8211; \u786e\u4fdd\u672c\u5730\u8def\u5f84\u5b58\u5728\u4e14\u53ef\u5199\u3002<\/p>\n<p>&#8211; \u6839\u636e\u7f51\u7edc\u901f\u5ea6\u548c\u6587\u4ef6\u5927\u5c0f\u9009\u62e9\u5408\u9002\u7684\u65f6\u95f4\u8fdb\u884c\u4e0b\u8f7d\u3002<\/p>\n<p><h2>\u5b9e\u7528\u6280\u5de7<\/h2>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u538b\u7f29\u6587\u4ef6\u4e0a\u4f20\u548c\u4e0b\u8f7d\u6570\u636e\uff0c\u4ee5\u8282\u7701\u65f6\u95f4\u548c\u5e26\u5bbd\u3002<\/li>\n<li>\u5b9a\u671f\u5907\u4efd\u91cd\u8981\u6570\u636e\uff0c\u4ee5\u9632\u6570\u636e\u4e22\u5931\u3002<\/li>\n<li>\u5229\u7528\u4e91\u5e73\u53f0\u7684\u76d1\u63a7\u5de5\u5177\uff0c\u5b9e\u65f6\u8ddf\u8e2a\u6570\u636e\u64cd\u4f5c\u548c\u4f5c\u4e1a\u72b6\u6001\u3002<\/li>\n<li>\u53c2\u52a0\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u7684\u57f9\u8bad\u8bfe\u7a0b\uff0c\u63d0\u9ad8\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u6280\u80fd\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\u548c\u6280\u5de7\uff0c\u60a8\u53ef\u4ee5\u5728\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u8fdb\u884c\u9ad8\u6548\u7684\u6570\u636e\u64cd\u4f5c\u548c\u5206\u6790\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u7b80\u4ecb\u53ca\u6280\u672f\u6982\u8ff0 \u8d35\u9633\u5927\u6570\u636e\u4e2d\u5fc3\u662f\u4e2d\u56fd\u91cd\u8981\u7684\u6570\u636e\u4e2d\u5fc3\u4e4b\u4e00\uff0c\u4f9d\u6258\u4e8e\u8d35\u5dde\u7701\u7684\u5730\u7406\u4f18\u52bf\u548c\u653f\u5e9c\u7684\u5927\u529b\u652f\u6301\uff0c\u5df2\u6210\u4e3a\u5168\u7403\u5927\u6570\u636e\u4ea7\u4e1a\u7684\u91cd\u8981\u57fa\u5730\u3002\u8be5\u4e2d\u5fc3\u91c7\u7528\u5148\u8fdb\u7684\u6280\u672f\uff0c\u5982\u4e91\u8ba1\u7b97\u3001\u5927\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u7b49\uff0c\u4e3a\u5404\u7c7b\u4f01\u4e1a\u548c\u7814\u7a76\u673a\u6784\u63d0\u4f9b\u9ad8\u6548\u7684\u6570\u636e\u5b58\u50a8\u3001\u5904\u7406\u548c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1424,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[167,489,490],"topic":[],"class_list":["post-1423","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-game-server","tag-167","tag-489","tag-490"],"_links":{"self":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/comments?post=1423"}],"version-history":[{"count":1,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1423\/revisions"}],"predecessor-version":[{"id":1426,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1423\/revisions\/1426"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media\/1424"}],"wp:attachment":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media?parent=1423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/categories?post=1423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/tags?post=1423"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/topic?post=1423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}