{"id":1457,"date":"2024-05-08T11:13:10","date_gmt":"2024-05-08T03:13:10","guid":{"rendered":"http:\/\/oneai.eu.org\/?p=1457"},"modified":"2024-05-08T11:13:10","modified_gmt":"2024-05-08T03:13:10","slug":"hadoop-%e9%83%a8%e7%bd%b2%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/oneai.eu.org\/?p=1457","title":{"rendered":"hadoop \u90e8\u7f72\u5e38\u89c1\u95ee\u9898"},"content":{"rendered":"<p>hadoop \u90e8\u7f72\u5e38\u89c1\u95ee\u9898```shell<br \/>\n\u5e38\u89c1\u95ee\u9898\uff1a<br \/>\n1\u3002\/tmp\/hadoop-zjy-secondarynamenode.pid: Permission denied<br \/>\nfix:chmod -R 777 tmp\/ <\/p>\n<p>2\u3002Java HotSpot(TM) Client VM warning: You have loaded library \/home\/zjy\/hadoop\/lib\/native\/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.<br \/>\nIt's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.<br \/>\n14\/11\/09 23:09:07 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable<br \/>\nfix:<br \/>\nvi ~\/.profile<br \/>\nexport HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_PREFIX}\/lib\/native<br \/>\nexport HADOOP_OPTS=&quot;-Djava.library.path=$HADOOP_PREFIX\/lib&quot;<br \/>\nsource ~\/.profile<\/p>\n<ol start=\"3\">\n<li>\u5f80hdfs\u91cc\u6254\u6587\u4ef6\u65f6\uff0c\u62a5\uff1a<br \/>\nput: File \/input\/file1.txt.<em>COPYING<\/em> could only be replicated to 0 nodes instead of minReplication (=1).  There are 0 datanode(s) running and no node(s) are excluded in this operation.<br \/>\n:\u539f\u56e0\uff1a\u662f\u7531\u4e8e\u591a\u6b21format\u5bfc\u81f4dfs\u7248\u672c\u4e0d\u4e00\u81f4<br \/>\nfix:\u5220\u9664\u6587\u4ef6\u7cfb\u7edf\uff0c\u91cd\u65b0:  hdfs namenode -format<br \/>\n\u6216\u662f\u628a\u6587\u4ef6\u7cfb\u7edf\u7248\u672c\u6539\u6210\u4e0e $HADOOP_PREFIX\/TMP\/dfs\/version\u4e2d\u7684\u7248\u672c\u4e00\u81f4\u3002 <\/li>\n<\/ol>\n<h2>4\u3002Name node is in safe mode  (\u5b89\u5168\u6a21\u5f0f)<br \/>\nfix:bin\/hadoop dfsadmin -safemode leave<br \/>\n\u7528\u6237\u53ef\u4ee5\u901a\u8fc7dfsadmin -safemode value   \u6765\u64cd\u4f5c\u5b89\u5168\u6a21\u5f0f\uff0c<br \/>\n\u53c2\u6570value\u7684\u8bf4\u660e\u5982\u4e0b\uff1a<br \/>\nenter - \u8fdb\u5165\u5b89\u5168\u6a21\u5f0f<br \/>\nleave - \u5f3a\u5236NameNode\u79bb\u5f00\u5b89\u5168\u6a21\u5f0f<br \/>\nget -   \u8fd4\u56de\u5b89\u5168\u6a21\u5f0f\u662f\u5426\u5f00\u542f\u7684\u4fe1\u606f<br \/>\nwait - \u7b49\u5f85\uff0c\u4e00\u76f4\u5230\u5b89\u5168\u6a21\u5f0f\u7ed3\u675f\u3002<\/h2>\n<p>5\u3002org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: hdfs:\/\/localhost\/user\/zjy\/input<br \/>\n\u76ee\u5f55\u6ca1\u6709\u52a0\u8fdb\u53bb\u3002<br \/>\nfix\uff1ahadoop fs -put conf input<\/p>\n<p>6\u30022014-11-10 01:01:53,107 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Problem connecting to server: localhost\/127.0.0.1:9000<br \/>\n\u539f\u56e0\uff1a\/etc\/hosts\u6587\u4ef6 127.0.0.1 localhost\u7684\u6620\u5c04\u5173\u7cfb\u5bfc\u81f4<br \/>\nfix:vi \/etc\/hosts<\/p>\n<h1>127.0.0.1 localhost<\/h1>\n<p>\u518d stop-all.sh<br \/>\n\u91cd\u65b0\u683c\u5f0f\u5316\uff1ahdfs namenode -format<\/p>\n<h2>7\u3002There are no datanodes in the cluster.<\/h2>\n<h2>\u6267\u884c\u4e0b\u9762\u547d\u4ee4\uff0c\u91cd\u65b0\u8fdb\u884c\u542f\u52a8dataNode\u5373\u53ef\u3002<br \/>\nHadoop\u542f\u52a8 \u683c\u5f0f\u5316\u96c6\u7fa4<br \/>\n\u4ee5\u4e0b\u7528hadoop\u7528\u6237\u6267\u884c<br \/>\nhadoop namenode -format -clusterid clustername<br \/>\n\u542f\u52a8hdfs \u6267\u884c<br \/>\nstart-dfs.sh<br \/>\n\u5f00\u542f hadoop dfs\u670d\u52a1<br \/>\n\u542f\u52a8Yarn<br \/>\n\u5f00\u542f yarn \u8d44\u6e90\u7ba1\u7406\u670d\u52a1<br \/>\nstart-yarn.sh<br \/>\n\u542f\u52a8httpfs<br \/>\n\u5f00\u542f httpfs \u670d \u52a1<br \/>\nhttpfs.sh start  <\/h2>\n<p>8\u3002Initialization failed for Block pool <registering> (Datanode Uuid unassigned) service to YFCS-S6-APP\/10.200.25.154:9000. Exiting<br \/>\n\u6253\u5f00hdfs-site.xml\u91cc\u914d\u7f6e\u7684datanode\u548cnamenode\u5bf9\u5e94\u7684\u76ee\u5f55\uff0c\u5206\u522b\u6253\u5f00current\u6587\u4ef6\u5939\u91cc\u7684VERSION\uff0c\u53ef\u4ee5\u770b\u5230clusterID\u9879\u6b63\u5982\u65e5\u5fd7\u91cc\u8bb0\u5f55\u7684\u4e00\u6837\uff0c\u786e\u5b9e\u4e0d\u4e00\u81f4\uff0c\u4fee\u6539datanode\u91ccVERSION\u6587\u4ef6\u7684clusterID \u4e0enamenode\u91cc\u7684\u4e00\u81f4\uff0c\u518d\u91cd\u65b0\u542f\u52a8dfs\uff08\u6267\u884cstart-dfs.sh\uff09\u518d\u6267\u884cjps\u547d\u4ee4\u53ef\u4ee5\u770b\u5230datanode\u5df2\u6b63\u5e38\u542f\u52a8\u3002<br \/>\n\u51fa\u73b0\u8be5\u95ee\u9898\u7684\u539f\u56e0\uff1a\u5728\u7b2c\u4e00\u6b21\u683c\u5f0f\u5316dfs\u540e\uff0c\u542f\u52a8\u5e76\u4f7f\u7528\u4e86hadoop\uff0c\u540e\u6765\u53c8\u91cd\u65b0\u6267\u884c\u4e86\u683c\u5f0f\u5316\u547d\u4ee4\uff08hdfs namenode -format)\uff0c\u8fd9\u65f6namenode\u7684clusterID\u4f1a\u91cd\u65b0\u751f\u6210\uff0c\u800cdatanode\u7684clusterID \u4fdd\u6301\u4e0d\u53d8\u3002<br \/>\n\u5982\u679c\u6539\u6210\u4e00\u81f4\u4e0d\u80fd\u89e3\u51b3\uff0c\u5219\u5220\u9664datanode\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff1arm -rf \/home\/zjy\/hadoop\/tmp\/dfs\/data\/current\/* \u518d\u91cd\u542f<\/p>\n<p>9.eclipse\u8fdc\u7a0b\u8fd0\u884chadoop\u81ea\u5b9a\u4e49\u7684\u4ee3\u7801\u62a5\uff1aException in thread &quot;main&quot; org.apache.hadoop.security.AccessControlException: Permission denied: user=Administrator, access=WRITE, inode=&quot;\/&quot;:zjy:supergroup:drwxr-xr-x<br \/>\n\uff1a\u539f\u56e0\uff1a\u672c\u5730windows\u5f00\u53d1\u73af\u5883\u672a\u5b89\u88c5ssh\uff0c\u6216\u672a\u914d\u7f6e\u6b63\u786e\uff0c\u8fdc\u7a0bhdfs\u670d\u52a1\u5668\u76f8\u5173\u76ee\u5f55\u6ca1\u6709\u64cd\u4f5c\u6743\u9650<br \/>\n1\u3002\u89e3\u51b3\uff1a\u5b89\u88c5ssh\uff0c\u5e76\u914d\u7f6e\u597dssh .\u5728\u672c\u5730\u6dfb\u52a0\u76f8\u5173\u7528\u6237\uff0c\u6700\u597d\u80fd\u6dfb\u52a0\u5230Administrators\u7ec4\u3002<br \/>\n2.hdfs\u670d\u52a1\u7aef :hdfs dfs -chmod 777 -R \/tmp     ;hdfs dfs -chmod 777 -R \/user\/<\/p>\n<pre><code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>hadoop \u90e8\u7f72\u5e38\u89c1\u95ee\u9898&#8220;`shell \u5e38\u89c1\u95ee\u9898\uff1a 1\u3002\/tmp\/hadoop-zjy-secondarynamenode.pid: Permission denied fix:chmod -R 777 tmp\/ 2\u3002Java HotSpot(TM) Client VM warning: You have loaded library \/home\/zjy\/hadoop\/lib\/native\/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now. It&#8217;s highly recommended that you fix the library with &#8216;execstack -c &#8216;, or link it with &#8216;-z noexecstack&#8217;. 14\/11\/09 23:09:07 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform&#8230; using builtin-java classes where applicable fix: vi ~\/.profile export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_PREFIX}\/lib\/native export HADOOP_OPTS=&quot;-Djava.library.path=$HADOOP_PREFIX\/lib&quot; source ~\/.profile \u5f80hdfs\u91cc\u6254\u6587\u4ef6\u65f6\uff0c\u62a5\uff1a put: File \/input\/file1.txt.COPYING could only be replicated to 0 nodes instead of minReplication (=1). There are 0 datanode(s) running and no node(s) are excluded in this operation. :\u539f\u56e0\uff1a\u662f\u7531\u4e8e\u591a\u6b21format\u5bfc\u81f4dfs\u7248\u672c\u4e0d\u4e00\u81f4 fix:\u5220\u9664\u6587\u4ef6\u7cfb\u7edf\uff0c\u91cd\u65b0: hdfs namenode -format \u6216\u662f\u628a\u6587\u4ef6\u7cfb\u7edf\u7248\u672c\u6539\u6210\u4e0e $HADOOP_PREFIX\/TMP\/dfs\/version\u4e2d\u7684\u7248\u672c\u4e00\u81f4\u3002 4\u3002Name node is in safe mode (\u5b89\u5168\u6a21\u5f0f) fix:bin\/hadoop dfsadmin -safemode leave \u7528\u6237\u53ef\u4ee5\u901a\u8fc7dfsadmin -safemode value \u6765\u64cd\u4f5c\u5b89\u5168\u6a21\u5f0f\uff0c \u53c2\u6570value\u7684\u8bf4\u660e\u5982\u4e0b\uff1a enter &#8211; \u8fdb\u5165\u5b89\u5168\u6a21\u5f0f leave &#8211; \u5f3a\u5236NameNode\u79bb\u5f00\u5b89\u5168\u6a21\u5f0f get &#8211; \u8fd4\u56de\u5b89\u5168\u6a21\u5f0f\u662f\u5426\u5f00\u542f\u7684\u4fe1\u606f wait &#8211; \u7b49\u5f85\uff0c\u4e00\u76f4\u5230\u5b89\u5168\u6a21\u5f0f\u7ed3\u675f\u3002 5\u3002org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: hdfs:\/\/localhost\/user\/zjy\/input \u76ee\u5f55\u6ca1\u6709\u52a0\u8fdb\u53bb\u3002 fix\uff1ahadoop fs -put conf input 6\u30022014-11-10 01:01:53,107 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Problem connecting to server: localhost\/127.0.0.1:9000 \u539f\u56e0\uff1a\/etc\/hosts\u6587\u4ef6 127.0.0.1 localhost\u7684\u6620\u5c04\u5173\u7cfb\u5bfc\u81f4 fix:vi \/etc\/hosts 127.0.0.1 localhost \u518d stop-all.sh \u91cd\u65b0\u683c\u5f0f\u5316\uff1ahdfs namenode -format 7\u3002There are no datanodes in the cluster. \u6267\u884c\u4e0b\u9762\u547d\u4ee4\uff0c\u91cd\u65b0\u8fdb\u884c\u542f\u52a8dataNode\u5373\u53ef\u3002 Hadoop\u542f\u52a8 \u683c\u5f0f\u5316\u96c6\u7fa4 \u4ee5\u4e0b\u7528hadoop\u7528\u6237\u6267\u884c hadoop namenode -format -clusterid clustername \u542f\u52a8hdfs \u6267\u884c start-dfs.sh \u5f00\u542f hadoop dfs\u670d\u52a1 \u542f\u52a8Yarn \u5f00\u542f yarn \u8d44\u6e90\u7ba1\u7406\u670d\u52a1 start-yarn.sh \u542f\u52a8httpfs \u5f00\u542f httpfs \u670d \u52a1 httpfs.sh start 8\u3002Initialization failed for Block pool (Datanode Uuid unassigned) service to YFC&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[85,82],"tags":[],"class_list":["post-1457","post","type-post","status-publish","format-standard","hentry","category-hadoop","category-82"],"_links":{"self":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1457"}],"version-history":[{"count":1,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1457\/revisions"}],"predecessor-version":[{"id":1458,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1457\/revisions\/1458"}],"wp:attachment":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}