{"id":1,"date":"2025-07-20T20:28:52","date_gmt":"2025-07-20T12:28:52","guid":{"rendered":"http:\/\/www.xqaixq.top\/?p=1"},"modified":"2025-07-20T21:24:51","modified_gmt":"2025-07-20T13:24:51","slug":"hello-world","status":"publish","type":"post","link":"http:\/\/www.xqaixq.top\/index.php\/2025\/07\/20\/hello-world\/","title":{"rendered":"Hadoop\u5b89\u88c5\u65b9\u5f0f"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u4e00\u3001\u4f2a\u5206\u5e03\u5f0f\u5b89\u88c5<\/h1>\n\n\n\n<h1 class=\"wp-block-heading\">1.HDFS\u7684\u914d\u7f6e<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>.\/hadoop\/etc\/hadoop\/core-site.xml<\/strong>:\u914d\u7f6eHDFS\u7684\u5730\u5740\u4ee5\u53ca\u5143\u6570\u636e\u7684\u5b58\u50a8\u8def\u5f84\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;configuration&gt;\n    &lt;property&gt;\n        &lt;name&gt;fs.defaultFS&lt;\/name&gt;\n        &lt;value&gt;hdfs:\/\/hadoop101:9000&lt;\/value&gt;\n    &lt;\/property&gt;\n    &lt;property&gt;\n        &lt;name&gt;hadoop.tmp.dir&lt;\/name&gt;\n        &lt;value&gt;\/opt\/software\/hadoop-2.7.2\/data\/tmp&lt;\/value&gt;\n    &lt;\/property&gt;\n&lt;\/configuration&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>hadoop-env.sh:<\/strong>\u4fee\u6539JAVA_HOME\u7684\u73af\u5883\u53d8\u91cf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export JAVA_HOME=\/opt\/software\/jdk1.8.0_281\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>hdfs-site.xml:<\/strong>:\u6307\u5b9a\u526f\u672c\u6570\u91cf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;configuration&gt;\n    &lt;property&gt;\n        &lt;name&gt;dfs.replication&lt;\/name&gt;\n        &lt;value&gt;1&lt;\/value&gt;\n    &lt;\/property&gt;\n&lt;\/configuration&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u683c\u5f0f\u5316:<code>bin\/hdfs namenode -format<\/code><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u683c\u5f0f\u5316\u662f\u5bf9HDFS\u4e2d\u7684DataNode\u8fdb\u884c\u5206\u5757\uff0c\u7edf\u8ba1\u6240\u6709\u7684\u521d\u59cb\u5143\u6570\u636e\u5b58\u50a8\u5728NameNode\u4e2d\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u80fd\u7ecf\u5e38\u683c\u5f0f\u5316NameNode\uff01\u683c\u5f0f\u5316NameNode\u4f1a\u4ea7\u751f\u65b0\u7684\u96c6\u7fa4ID\uff0c\u5bfc\u81f4NameNode\u548cDataNode\u7684\u96c6\u7fa4ID\u4e0d\u4e00\u81f4\uff0c\u5bfc\u81f4\u96c6\u7fa4\u627e\u4e0d\u5230\u4ee5\u5f80\u6570\u636e\u3002\u5728\u683c\u5f0f\u5316\u4e4b\u524d\u9700\u8981\u5220\u9664data\u6570\u636e\u548clog\u65e5\u5fd7\uff01\uff01\uff01\uff08\/hadoop\/data\u548c\/hadoop\/logs\uff09<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u542f\u52a8<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u542f\u52a8namenode:<code>sbin\/hadoop-daemon.sh start namenode<\/code><br>\u542f\u52a8datanode:<code>sbin\/hadoop-daemon.sh start datanode<\/code><br>jps\u67e5\u770b:<code>jps<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">hadoop101:50070\u67e5\u770bhdfs\uff08namenode\uff09\u7f51\u9875\u7aef\uff083.x\u53d8\u6210\u4e869870\uff09<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">hadoop101:8020namenode\u5185\u90e8\u901a\u4fe1\u63a5\u53e3\uff089000\u4e5f\u53ef\uff0c\u5177\u4f53\u770bcore-site.xml\uff0c3.x\u52a0\u5165\u4e869820\uff09<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">hadoop102:8088\u67e5\u770bMapReduce\u8fdb\u7a0b\uff0cYARN\u63a5\u53e3<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">hadoop101:19888\u67e5\u770b\u5386\u53f2\u670d\u52a1\u5668\u7aef\u53e3<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">hadoop103:50090\u4e3aSecondaryNameNode\u7684\u7aef\u53e3<\/h4>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4f2a\u5206\u5e03\u5f0f\u5b89\u88c5 1.HDFS\u7684\u914d\u7f6e .\/hadoop\/etc\/hadoop\/core-site.xml:\u914d\u7f6e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":1,"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":16,"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions\/16"}],"wp:attachment":[{"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xqaixq.top\/index.php\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}