{"rsdb":{"rid":"309113","subhead":"","postdate":"0","aid":"224275","fid":"114","uid":"1","topic":"1","content":"
\n
\n \n \u7248\u6743\u58f0\u660e\uff1aIT\u8d44\u8baf\u79d1\u6280 https:\/\/blog.csdn.net\/qq_38460284\/article\/details\/90232118 <\/div>\n \n \n
\n

1.\u5b89\u88c5\u914d\u7f6e\u597dHadoop
\n\u5e38\u7528\u547d\u4ee4\uff1a
\nhadoop dfs -ls path
\nhadoop dfs -rmr file
\nhadoop dfs -mkdir path
\nhadoop dfs -cat file
\n2.\u627e\u4e2awordcount\u7a0b\u5e8f\uff0c\u547d\u540d\u4e3awordcount.cpp
\n\u53ef\u4ee5\u662f\uff1ahttp:\/\/wiki.apache.org\/hadoop\/C++<\/a>WordCount
\n\u4e5f\u53ef\u4ee5\u662fhadoop\u5b89\u88c5\u8def\u5f84\u4e0b\u7684\uff1a\/usr\/local\/hadoop-0.20.2\/src\/examples\/pipes\/impl\/wordcount-simple.cc
\n3.\u5199Makefile
\nHADOOP_INSTALL=\/usr\/local\/hadoop-0.20.2
\nPLATFORM=Linux-i386-32<\/p>\n\n

CC = g++
\nCPPFLAGS = -m32 -I$(HADOOP_INSTALL)\/c++\/$(PLATFORM)\/include<\/p>\n\n

wordcount: wordcount.cpp
\n$(CC) $(CPPFLAGS) $< -Wall -L$(HADOOP_INSTALL)\/c++\/$(PLATFORM)\/lib -lhadooppipes -lhadooputils -lpthread -g -O2 -o $@
\n###
\ncat \/proc\/cpuinfo \u67e5\u770bcpu\u662fintel\u7684\u8fd8\u662famd\u7684\uff0c\u5bf9\u5e94\u4fee\u6539PLATFORM\u3002
\n4.\u6267\u884c\uff1a
\n\u4e0a\u4f20wordcount.cpp\u6587\u4ef6\u4f5c\u4e3a\u8f93\u5165\u6587\u4ef6\uff1ahadoop fs -put wordcount.cpp input.txt
\n\u4e0a\u4f20\u53ef\u6267\u884c\u6587\u4ef6\uff1a hadoop fs -put wordcount bin\/wordcount
\n\u8fd0\u884c\u4ee3\u7801\uff1a
\nhadoop pipes \\
\n-D hadoop.pipes.
java<\/a>.recordreader=true \\
\n-D hadoop.pipes.
java<\/a>.recordwriter=true \\
\n-input input.txt \\
\n-output output \\
\n-program bin\/wordcount
\n\u67e5\u770b\u7ed3\u679c\uff1a
\nhadoop dfs -cat output\/*<\/p>\n\n

\u63a8\u8350\u9605\u8bfb\u6587\u7ae0<\/strong><\/p>\n\n

\u5927\u6570\u636e\u5de5\u7a0b\u5e08\u5728\u963f\u91cc\u9762\u8bd5\u6d41\u7a0b\u662f\u4ec0\u4e48\uff1f<\/a><\/strong><\/p>\n\n

\u5b66\u4e60\u5927\u6570\u636e\u9700\u8981\u5177\u5907\u600e\u4e48\u6837\u57fa\u7840\uff1f<\/a><\/strong><\/p>\n\n

\u5e74\u85aa30K\u7684\u5927\u6570\u636e\u5f00\u53d1\u5de5\u7a0b\u5e08\u7684\u5de5\u4f5c\u7ecf\u9a8c\u603b\u7ed3\uff1f<\/a><\/strong><\/p>\n <\/div>\n <\/div>","orderid":"0","title":"Hadoop pipes\u521d\u5b66\u7b14\u8bb0","smalltitle":"","mid":"0","fname":"Hadoop","special_id":"0","bak_id":"0","info":"0","hits":"493","pages":"1","comments":"0","posttime":"2019-05-16 00:23:12","list":"1557937392","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"Hadoop<\/A> pipes<\/A> \u521d\u5b66<\/A> \u7b14\u8bb0<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";s:4:\"head\";s:0:\"\";}","target":"0","ip":"47.106.78.186","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":" \u7248\u6743\u58f0\u660e\uff1aIT\u8d44\u8baf\u79d1\u6280 https:\/\/blog.csdn.net\/qq_38460284\/article\/details\/90232118 1.\u5b89\u88c5\u914d\u7f6e\u597dHadoop\u5e38\u7528\u547d\u4ee4\uff1ahadoop dfs -ls pathhadoop..","lastview":"1713977832","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}