{"id":5324,"date":"2023-04-23T17:24:39","date_gmt":"2023-04-23T09:24:39","guid":{"rendered":"http:\/\/www.menglanglang.cn\/?p=5324"},"modified":"2023-04-23T17:24:40","modified_gmt":"2023-04-23T09:24:40","slug":"%e5%a4%a7%e6%95%b0%e6%8d%ae%e5%ad%a6%e4%b9%a0%e5%88%9d%e7%ba%a7%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b%ef%bc%88%e5%8d%81%e5%85%ad%ef%bc%89-hadoop-3-x-%e5%ae%8c%e5%85%a8%e5%88%86","status":"publish","type":"post","link":"http:\/\/www.menglanglang.cn\/?p=5324","title":{"rendered":"\u5927\u6570\u636e\u5b66\u4e60\u521d\u7ea7\u5165\u95e8\u6559\u7a0b\uff08\u5341\u516d\uff09 \u2014\u2014 Hadoop 3.x \u5b8c\u5168\u5206\u5e03\u5f0f\u96c6\u7fa4\u7684\u5b89\u88c5\u3001\u542f\u52a8\u548c\u6d4b\u8bd5"},"content":{"rendered":"\n<p>\u200b\u597d\u4e45\u6ca1\u7528 Hadoop \u96c6\u7fa4\u4e86\uff0c\u53c2\u8003\u4ee5\u524d\u5199\u7684\u300a<a href=\"http:\/\/www.menglanglang.cn\/?p=3207\">\u5927\u6570\u636e\u5b66\u4e60\u521d\u7ea7\u5165\u95e8\u6559\u7a0b\uff08\u4e00\uff09 \u2014\u2014 Hadoop 2.x \u5b8c\u5168\u5206\u5e03\u5f0f\u96c6\u7fa4\u7684\u5b89\u88c5\u3001\u542f\u52a8\u548c\u6d4b\u8bd5<\/a>\u300b\u548c\u300a<a href=\"https:\/\/blog.csdn.net\/tzhuwb\/article\/details\/105520506\">\u5927\u6570\u636e\u5b66\u4e60\u521d\u7ea7\u5165\u95e8\u6559\u7a0b\uff08\u5341\u4e8c\uff09 \u2014\u2014 Hadoop 2.x \u96c6\u7fa4\u548c Zookeeper 3.x \u96c6\u7fa4\u505a\u96c6\u6210<\/a>\u300b\uff0c\u4e0b\u8f7d\u4e86\u76ee\u524d\u5b98\u7f51\u6700\u65b0\u7684\u7248\u672c\u00a0hadoop-3.3.5 \u518d\u91cd\u6e29\u4e0b\u96c6\u7fa4\u90e8\u7f72\u3002\u6309\u6b65\u9aa4\u8fdb\u884c\u5230\u683c\u5f0f\u5316\u96c6\u7fa4\u6b65\u9aa4\u65f6\uff0c\u53d1\u73b0\u4e0d\u5c11\u548c\u8001\u7248\u672c\u4e0d\u4e00\u81f4\u7684\u5730\u65b9\uff0c\u8fd9\u91cc\u8bb0\u5f55\u5982\u4e0b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u98981\uff09ERROR: Attempting to operate on *** as root<\/h3>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"208\" width=\"869\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/83c7d3e16d5943fda6619d99cbc45f25.png\" alt=\"\"\/><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>[root@node111 hadoop]# start-dfs.sh&nbsp;<br \/>Starting namenodes on [node111]<br \/>ERROR: Attempting to operate on hdfs namenode as root<br \/>ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation.<br \/>Starting datanodes<br \/>ERROR: Attempting to operate on hdfs datanode as root<br \/>ERROR: but there is no HDFS_DATANODE_USER defined. Aborting operation.<br \/>Starting secondary namenodes [node112]<br \/>ERROR: Attempting to operate on hdfs secondarynamenode as root<br \/>ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting operation.<\/p>\n\n\n\n<p>Starting journal nodes [node115 node114 node113]<br \/>ERROR: Attempting to operate on hdfs journalnode as root<br \/>ERROR: but there is no HDFS_JOURNALNODE_USER defined. Aborting operation.<br \/>Starting ZK Failover Controllers on NN hosts [node111 node112]<br \/>ERROR: Attempting to operate on hdfs zkfc as root<br \/>ERROR: but there is no HDFS_ZKFC_USER defined. Aborting operation.<br \/>[root@node111 hadoop]#&nbsp;<\/p>\n<\/blockquote>\n\n\n\n<p>\u67e5\u4e86\u4e0b\u8d44\u6599\uff0c\u89e3\u51b3\u65b9\u6cd5\u662f\u5728\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u4e2d\u52a0\u4e0a\u4e0b\u9762\u8fd9\u4e9b\u914d\u7f6e\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>export HDFS_NAMENODE_USER=root<br \/>export HDFS_DATANODE_USER=root<br \/>export HDFS_SECONDARYNAMENODE_USER=root<br \/>export HDFS_JOURNALNODE_USER=root<br \/>export HDFS_ZKFC_USER=root<br \/>export YARN_RESOURCEMANAGER_USER=root<br \/>export YARN_NODEMANAGER_USER=root<\/p>\n<\/blockquote>\n\n\n\n<p>\u6ce8\u610f\uff1a\u6dfb\u52a0\u5b8c\u540e\uff0c\u4e00\u5b9a\u6267\u884c\u547d\u4ee4<strong> source ~\/.bash_profile<\/strong> \u8ba9\u914d\u7f6e\u7acb\u523b\u751f\u6548\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u8fd8\u6709\u4e00\u79cd\u65b9\u5f0f\u5982\u4e0b\uff0c\u7a0d\u5fae\u7e41\u7410\u4e9b\uff0c\u8bf7\u81ea\u884c\u5c1d\u8bd5\u3002<\/p>\n\n\n\n<p>1\uff09\u5c06start-dfs.sh\uff0cstop-dfs.sh(\u5728hadoop\u5b89\u88c5\u76ee\u5f55\u7684sbin\u91cc)\u4e24\u4e2a\u6587\u4ef6\u9876\u90e8\u6dfb\u52a0\u4ee5\u4e0b\u53c2\u6570<\/p>\n\n\n\n<p>HDFS_DATANODE_USER=root<br \/>HADOOP_SECURE_DN_USER=hdfs<br \/>HDFS_NAMENODE_USER=root<br \/>HDFS_SECONDARYNAMENODE_USER=root<\/p>\n\n\n\n<p><br \/>2\uff09\u5c06start-yarn.sh\uff0cstop-yarn.sh(\u5728hadoop\u5b89\u88c5\u76ee\u5f55\u7684sbin\u91cc)\u4e24\u4e2a\u6587\u4ef6\u9876\u90e8\u6dfb\u52a0\u4ee5\u4e0b\u53c2\u6570<\/p>\n\n\n\n<p>YARN_RESOURCEMANAGER_USER=root<br \/>HADOOP_SECURE_DN_USER=yarn<br \/>YARN_NODEMANAGER_USER=root<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u98982\uff09\u542f\u52a8\u96c6\u7fa4\u65f6\uff0c\u53d1\u73b0 Namenode \u8282\u70b9\u603b\u662f\u542f\u52a8\u4e86 Datanode<\/h3>\n\n\n\n<p>\u6bcf\u6b21\u542f\u52a8\u96c6\u7fa4\u540e\uff0cNamenode\u8282\u70b9\u603b\u662f\u542f\u52a8\u4e86 Datanode\uff0c\u6700\u540e\u53d1\u73b0\u65b0\u7684\u7248\u672c\u4e2d\u914d\u7f6e Datanode\u6587\u4ef6\u4e3a <strong>\/etc\/hadoop\/workers<\/strong>\uff0c\u4e0d\u9700\u8981\u548c\u539f\u6765\u90a3\u6837\u521b\u5efa \/etc\/hadoop\/slaves \u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><img loading=\"lazy\" decoding=\"async\" height=\"223\" width=\"900\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/9404aa5fe9014cab959ec9e52f81f477.png\" alt=\"\"\/><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u98983\uff09\u542f\u52a8&nbsp;journalnode \u8282\u70b9\u547d\u4ee4<\/h3>\n\n\n\n<p>\u65b0\u7248\u672c\u542f\u52a8&nbsp;journalnode \u8282\u70b9\u7684\u547d\u4ee4\u53d8\u66f4\u5982\u4e0b\uff0c\u539f\u547d\u4ee4\u5df2\u5e9f\u5f03\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>hdfs --daemon start journalnode<\/p>\n\n\n\n<p>more \/soft\/hadoop\/hadoop-3.3.5\/logs\/hadoop-root-journalnode-node115.log<\/p>\n\n\n\n<p>hdfs --daemon stop journalnode<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u98984\uff09\u5982\u679c\u8bbf\u95ee\u8def\u5f84 http:\/\/192.168.220.19:50070\/ \u65e0\u6cd5\u6253\u5f00\u9875\u9762<\/h3>\n\n\n\n<p>\u542f\u52a8\u540e\u6d4f\u89c8\u5668\u8bbf\u95ee namenode \u8282\u70b9\u7684\u76d1\u63a7\u9875\u9762\uff0c\u8bbf\u95ee\u8def\u5f84\u4e3a\uff1ahttp:\/\/192.168.220.19:50070\/\uff0c\u7ed3\u679c\u9875\u9762\u6253\u4e0d\u5f00\uff0c\u770b\u5b98\u7f51\u53d1\u73b0\u65b0\u7248\u672c\u628a namenode \u7aef\u53e3\u53d8\u4e86\uff0c\u8bbf\u95ee&nbsp;9870 \u7aef\u53e3\u5373\u53ef\u3002<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"532\" width=\"844\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/a9208a3461a64e93beeed2cc3732cd58.png\" alt=\"\"\/>\u200b<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u95ee\u98985\uff09\u6d4b\u8bd5\u96c6\u7fa4\u9ad8\u53ef\u7528\u65f6\uff0cstandby \u65e0\u6cd5\u5207\u6362\u4e3a active \u72b6\u6001<\/h3>\n\n\n\n<p>\u67e5\u770b&nbsp;standby \u6240\u5728\u8282\u70b9\u7684\u65e5\u5fd7\uff0c\u53ef\u4ee5\u53d1\u73b0&nbsp;Connection refused \u9519\u8bef\uff0c\u8be6\u7ec6\u5982\u4e0b\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>PATH=$PATH:\/sbin:\/usr\/sbin fuser -v -k -n tcp 8020 via ssh: bash<br \/>: fuser: command not found<\/p>\n<\/blockquote>\n\n\n\n<p>\u8fd9\u662f\u56e0\u4e3a\u5728 hdfs-site.xml \u4e2d\u914d\u7f6e\u4e86\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&nbsp; &nbsp; &lt;property&gt;<br \/>&nbsp; &nbsp; &nbsp; &lt;name&gt;dfs.ha.fencing.methods&lt;\/name&gt;<br \/>&nbsp; &nbsp; &nbsp; &lt;value&gt;sshfence&lt;\/value&gt;<br \/>&nbsp; &nbsp; &lt;\/property&gt;<\/p>\n<\/blockquote>\n\n\n\n<p>\u56e0\u4e3a\u673a\u5668\u4e0a\u6ca1\u6709 fuser \u7a0b\u5e8f\uff0c\u5bfc\u81f4\u65e0\u6cd5\u8fdb\u884c fence\uff0c\u5b89\u88c5 psmisc \u5373\u53ef\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>yum install psmisc<\/p>\n<\/blockquote>\n\n\n\n<p>\u4ee5\u4e0a\u662f\u90e8\u7f72\u65b0\u7248\u96c6\u7fa4\u8e29\u7684\u4e00\u4e9b\u5751\uff0c\u987a\u624b\u8bb0\u5f55\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>Good Luck\uff01 \u200b<\/p>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/blog.csdn.net\/tzhuwb\/article\/details\/130312065\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/blog.csdn.net\/tzhuwb\/article\/details\/130312065<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u200b\u597d\u4e45\u6ca1\u7528 Hadoop \u96c6\u7fa4\u4e86\uff0c\u53c2\u8003\u4ee5\u524d\u5199\u7684\u300a\u5927\u6570\u636e\u5b66\u4e60\u521d\u7ea7\u5165\u95e8\u6559\u7a0b\uff08\u4e00\uff09 \u2014\u2014 Hadoop 2.x \u5b8c\u5168 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[793],"tags":[721,684,749,770,711,183,199,790,781],"class_list":["post-5324","post","type-post","status-publish","format-standard","hentry","category-hadoop","tag-ha","tag-hadoop","tag-zookeeper","tag-770","tag-711","tag-183","tag-199","tag-790","tag-781"],"_links":{"self":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/5324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5324"}],"version-history":[{"count":1,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/5324\/revisions"}],"predecessor-version":[{"id":5325,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/5324\/revisions\/5325"}],"wp:attachment":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5324"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}