{"id":1058,"date":"2010-02-27T11:15:00","date_gmt":"2010-02-27T03:15:00","guid":{"rendered":"\/?p=1058"},"modified":"2010-02-27T11:15:00","modified_gmt":"2010-02-27T11:15:00","slug":"1058","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/architecture\/1058.html","title":{"rendered":"Hadoop\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\uff1a\u67b6\u6784\u548c\u8bbe\u8ba1"},"content":{"rendered":"

\u5f15\u8a00<\/h2>\n
\n

        Hadoop\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf(HDFS<\/acronym>)\u88ab\u8bbe\u8ba1\u6210\u9002\u5408\u8fd0\u884c\u5728\u901a\u7528\u786c\u4ef6(commodity hardware)\u4e0a\u7684\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\u3002\u5b83\u548c\u73b0\u6709\u7684\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\u6709\u5f88\u591a\u5171\u540c\u70b9\u3002\u4f46\u540c\u65f6\uff0c\u5b83\u548c\u5176\u4ed6\u7684\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\u7684\u533a\u522b\u4e5f\u662f\u5f88\u660e\u663e\u7684\u3002HDFS\u662f\u4e00\u4e2a\u9ad8\u5ea6\u5bb9\u9519\u6027\u7684\u7cfb\u7edf\uff0c\u9002\u5408\u90e8\u7f72\u5728\u5ec9\u4ef7\u7684\u673a\u5668\u4e0a\u3002HDFS\u80fd\u63d0\u4f9b\u9ad8\u541e\u5410\u91cf\u7684\u6570\u636e\u8bbf\u95ee\uff0c\u975e\u5e38\u9002\u5408\u5927\u89c4\u6a21\u6570\u636e\u96c6\u4e0a\u7684\u5e94\u7528\u3002HDFS\u653e\u5bbd\u4e86\u4e00\u90e8\u5206POSIX\u7ea6\u675f\uff0c\u6765\u5b9e\u73b0\u6d41\u5f0f\u8bfb\u53d6\u6587\u4ef6\u7cfb\u7edf\u6570\u636e\u7684\u76ee\u7684\u3002HDFS\u5728\u6700\u5f00\u59cb\u662f\u4f5c\u4e3aApache Nutch\u641c\u7d22\u5f15\u64ce\u9879\u76ee\u7684\u57fa\u7840\u67b6\u6784\u800c\u5f00\u53d1\u7684\u3002HDFS\u662fApache Hadoop Core\u9879\u76ee\u7684\u4e00\u90e8\u5206\u3002\u8fd9\u4e2a\u9879\u76ee\u7684\u5730\u5740\u662fhttp:\/\/hadoop.apache.org\/core\/<\/a>\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u524d\u63d0\u548c\u8bbe\u8ba1\u76ee\u6807<\/h2>\n
<\/a><\/a><\/p>\n

\u786c\u4ef6\u9519\u8bef<\/h3>\n

      \u786c\u4ef6\u9519\u8bef\u662f\u5e38\u6001\u800c\u4e0d\u662f\u5f02\u5e38\u3002HDFS\u53ef\u80fd\u7531\u6210\u767e\u4e0a\u5343\u7684\u670d\u52a1\u5668\u6240\u6784\u6210\uff0c\u6bcf\u4e2a\u670d\u52a1\u5668\u4e0a\u5b58\u50a8\u7740\u6587\u4ef6\u7cfb\u7edf\u7684\u90e8\u5206\u6570\u636e\u3002\u6211\u4eec\u9762\u5bf9\u7684\u73b0\u5b9e\u662f\u6784\u6210\u7cfb\u7edf\u7684\u7ec4\u4ef6\u6570\u76ee\u662f\u5de8\u5927\u7684\uff0c\u800c\u4e14\u4efb\u4e00\u7ec4\u4ef6\u90fd\u6709\u53ef\u80fd\u5931\u6548\uff0c\u8fd9\u610f\u5473\u7740\u603b\u662f\u6709\u4e00\u90e8\u5206HDFS\u7684\u7ec4\u4ef6\u662f\u4e0d\u5de5\u4f5c\u7684\u3002\u56e0\u6b64\u9519\u8bef\u68c0\u6d4b\u548c\u5feb\u901f\u3001\u81ea\u52a8\u7684\u6062\u590d\u662fHDFS\u6700\u6838\u5fc3\u7684\u67b6\u6784\u76ee\u6807\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u6d41\u5f0f\u6570\u636e\u8bbf\u95ee<\/h3>\n

      \u8fd0\u884c\u5728HDFS\u4e0a\u7684\u5e94\u7528\u548c\u666e\u901a\u7684\u5e94\u7528\u4e0d\u540c\uff0c\u9700\u8981\u6d41\u5f0f\u8bbf\u95ee\u5b83\u4eec\u7684\u6570\u636e\u96c6\u3002HDFS\u7684\u8bbe\u8ba1\u4e2d\u66f4\u591a\u7684\u8003\u8651\u5230\u4e86\u6570\u636e\u6279\u5904\u7406\uff0c\u800c\u4e0d\u662f\u7528\u6237\u4ea4\u4e92\u5904\u7406\u3002\u6bd4\u4e4b\u6570\u636e\u8bbf\u95ee\u7684\u4f4e\u5ef6\u8fdf\u95ee\u9898\uff0c\u66f4\u5173\u952e\u7684\u5728\u4e8e\u6570\u636e\u8bbf\u95ee\u7684\u9ad8\u541e\u5410\u91cf\u3002POSIX\u6807\u51c6\u8bbe\u7f6e\u7684\u5f88\u591a\u786c\u6027\u7ea6\u675f\u5bf9HDFS\u5e94\u7528\u7cfb\u7edf\u4e0d\u662f\u5fc5\u9700\u7684\u3002\u4e3a\u4e86\u63d0\u9ad8\u6570\u636e\u7684\u541e\u5410\u91cf\uff0c\u5728\u4e00\u4e9b\u5173\u952e\u65b9\u9762\u5bf9POSIX\u7684\u8bed\u4e49\u505a\u4e86\u4e00\u4e9b\u4fee\u6539\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u5927\u89c4\u6a21\u6570\u636e\u96c6<\/h3>\n

        \u8fd0\u884c\u5728HDFS\u4e0a\u7684\u5e94\u7528\u5177\u6709\u5f88\u5927\u7684\u6570\u636e\u96c6\u3002HDFS\u4e0a\u7684\u4e00\u4e2a\u5178\u578b\u6587\u4ef6\u5927\u5c0f\u4e00\u822c\u90fd\u5728G\u5b57\u8282\u81f3T\u5b57\u8282\u3002\u56e0\u6b64\uff0cHDFS\u88ab\u8c03\u8282\u4ee5\u652f\u6301\u5927\u6587\u4ef6\u5b58\u50a8\u3002\u5b83\u5e94\u8be5\u80fd\u63d0\u4f9b\u6574\u4f53\u4e0a\u9ad8\u7684\u6570\u636e\u4f20\u8f93\u5e26\u5bbd\uff0c\u80fd\u5728\u4e00\u4e2a\u96c6\u7fa4\u91cc\u6269\u5c55\u5230\u6570\u767e\u4e2a\u8282\u70b9\u3002\u4e00\u4e2a\u5355\u4e00\u7684HDFS\u5b9e\u4f8b\u5e94\u8be5\u80fd\u652f\u6491\u6570\u4ee5\u5343\u4e07\u8ba1\u7684\u6587\u4ef6\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u7b80\u5355\u7684\u4e00\u81f4\u6027\u6a21\u578b<\/h3>\n

      HDFS\u5e94\u7528\u9700\u8981\u4e00\u4e2a“\u4e00\u6b21\u5199\u5165\u591a\u6b21\u8bfb\u53d6”\u7684\u6587\u4ef6\u8bbf\u95ee\u6a21\u578b\u3002\u4e00\u4e2a\u6587\u4ef6\u7ecf\u8fc7\u521b\u5efa\u3001\u5199\u5165\u548c\u5173\u95ed\u4e4b\u540e\u5c31\u4e0d\u9700\u8981\u6539\u53d8\u3002\u8fd9\u4e00\u5047\u8bbe\u7b80\u5316\u4e86\u6570\u636e\u4e00\u81f4\u6027\u95ee\u9898\uff0c\u5e76\u4e14\u4f7f\u9ad8\u541e\u5410\u91cf\u7684\u6570\u636e\u8bbf\u95ee\u6210\u4e3a\u53ef\u80fd\u3002Map\/Reduce\u5e94\u7528\u6216\u8005\u7f51\u7edc\u722c\u866b\u5e94\u7528\u90fd\u975e\u5e38\u9002\u5408\u8fd9\u4e2a\u6a21\u578b\u3002\u76ee\u524d\u8fd8\u6709\u8ba1\u5212\u5728\u5c06\u6765\u6269\u5145\u8fd9\u4e2a\u6a21\u578b\uff0c\u4f7f\u4e4b\u652f\u6301\u6587\u4ef6\u7684\u9644\u52a0\u5199\u64cd\u4f5c\u3002<\/p>\n

<\/a><\/a><\/p>\n

“\u79fb\u52a8\u8ba1\u7b97\u6bd4\u79fb\u52a8\u6570\u636e\u66f4\u5212\u7b97”<\/h3>\n

        \u4e00\u4e2a\u5e94\u7528\u8bf7\u6c42\u7684\u8ba1\u7b97\uff0c\u79bb\u5b83\u64cd\u4f5c\u7684\u6570\u636e\u8d8a\u8fd1\u5c31\u8d8a\u9ad8\u6548\uff0c\u5728\u6570\u636e\u8fbe\u5230\u6d77\u91cf\u7ea7\u522b\u7684\u65f6\u5019\u66f4\u662f\u5982\u6b64\u3002\u56e0\u4e3a\u8fd9\u6837\u5c31\u80fd\u964d\u4f4e\u7f51\u7edc\u963b\u585e\u7684\u5f71\u54cd\uff0c\u63d0\u9ad8\u7cfb\u7edf\u6570\u636e\u7684\u541e\u5410\u91cf\u3002\u5c06\u8ba1\u7b97\u79fb\u52a8\u5230\u6570\u636e\u9644\u8fd1\uff0c\u6bd4\u4e4b\u5c06\u6570\u636e\u79fb\u52a8\u5230\u5e94\u7528\u6240\u5728\u663e\u7136\u66f4\u597d\u3002HDFS\u4e3a\u5e94\u7528\u63d0\u4f9b\u4e86\u5c06\u5b83\u4eec\u81ea\u5df1\u79fb\u52a8\u5230\u6570\u636e\u9644\u8fd1\u7684\u63a5\u53e3\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u5f02\u6784\u8f6f\u786c\u4ef6\u5e73\u53f0\u95f4\u7684\u53ef\u79fb\u690d\u6027<\/h3>\n

HDFS\u5728\u8bbe\u8ba1\u7684\u65f6\u5019\u5c31\u8003\u8651\u5230\u5e73\u53f0\u7684\u53ef\u79fb\u690d\u6027\u3002\u8fd9\u79cd\u7279\u6027\u65b9\u4fbf\u4e86HDFS\u4f5c\u4e3a\u5927\u89c4\u6a21\u6570\u636e\u5e94\u7528\u5e73\u53f0\u7684\u63a8\u5e7f\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

Namenode \u548c Datanode<\/h2>\n
\n

      HDFS\u91c7\u7528master\/slave\u67b6\u6784\u3002\u4e00\u4e2aHDFS\u96c6\u7fa4\u662f\u7531\u4e00\u4e2aNamenode\u548c\u4e00\u5b9a\u6570\u76ee\u7684Datanodes\u7ec4\u6210\u3002Namenode\u662f\u4e00\u4e2a\u4e2d\u5fc3\u670d\u52a1\u5668\uff0c\u8d1f\u8d23\u7ba1\u7406\u6587\u4ef6\u7cfb\u7edf\u7684\u540d\u5b57\u7a7a\u95f4(namespace)\u4ee5\u53ca\u5ba2\u6237\u7aef\u5bf9\u6587\u4ef6\u7684\u8bbf\u95ee\u3002\u96c6\u7fa4\u4e2d\u7684Datanode\u4e00\u822c\u662f\u4e00\u4e2a\u8282\u70b9\u4e00\u4e2a\uff0c\u8d1f\u8d23\u7ba1\u7406\u5b83\u6240\u5728\u8282\u70b9\u4e0a\u7684\u5b58\u50a8\u3002HDFS\u66b4\u9732\u4e86\u6587\u4ef6\u7cfb\u7edf\u7684\u540d\u5b57\u7a7a\u95f4\uff0c\u7528\u6237\u80fd\u591f\u4ee5\u6587\u4ef6\u7684\u5f62\u5f0f\u5728\u4e0a\u9762\u5b58\u50a8\u6570\u636e\u3002\u4ece\u5185\u90e8\u770b\uff0c\u4e00\u4e2a\u6587\u4ef6\u5176\u5b9e\u88ab\u5206\u6210\u4e00\u4e2a\u6216\u591a\u4e2a\u6570\u636e\u5757\uff0c\u8fd9\u4e9b\u5757\u5b58\u50a8\u5728\u4e00\u7ec4Datanode\u4e0a\u3002Namenode\u6267\u884c\u6587\u4ef6\u7cfb\u7edf\u7684\u540d\u5b57\u7a7a\u95f4\u64cd\u4f5c\uff0c\u6bd4\u5982\u6253\u5f00\u3001\u5173\u95ed\u3001\u91cd\u547d\u540d\u6587\u4ef6\u6216\u76ee\u5f55\u3002\u5b83\u4e5f\u8d1f\u8d23\u786e\u5b9a\u6570\u636e\u5757\u5230\u5177\u4f53Datanode\u8282\u70b9\u7684\u6620\u5c04\u3002Datanode\u8d1f\u8d23\u5904\u7406\u6587\u4ef6\u7cfb\u7edf\u5ba2\u6237\u7aef\u7684\u8bfb\u5199\u8bf7\u6c42\u3002\u5728Namenode\u7684\u7edf\u4e00\u8c03\u5ea6\u4e0b\u8fdb\u884c\u6570\u636e\u5757\u7684\u521b\u5efa\u3001\u5220\u9664\u548c\u590d\u5236\u3002<\/p>\n

\"HDFS<\/div>\n

      Namenode\u548cDatanode\u88ab\u8bbe\u8ba1\u6210\u53ef\u4ee5\u5728\u666e\u901a\u7684\u5546\u7528\u673a\u5668\u4e0a\u8fd0\u884c\u3002\u8fd9\u4e9b\u673a\u5668\u4e00\u822c\u8fd0\u884c\u7740GNU\/Linux\u64cd\u4f5c\u7cfb\u7edf(OS<\/acronym>)\u3002HDFS\u91c7\u7528Java\u8bed\u8a00\u5f00\u53d1\uff0c\u56e0\u6b64\u4efb\u4f55\u652f\u6301Java\u7684\u673a\u5668\u90fd\u53ef\u4ee5\u90e8\u7f72Namenode\u6216Datanode\u3002\u7531\u4e8e\u91c7\u7528\u4e86\u53ef\u79fb\u690d\u6027\u6781\u5f3a\u7684Java\u8bed\u8a00\uff0c\u4f7f\u5f97HDFS\u53ef\u4ee5\u90e8\u7f72\u5230\u591a\u79cd\u7c7b\u578b\u7684\u673a\u5668\u4e0a\u3002\u4e00\u4e2a\u5178\u578b\u7684\u90e8\u7f72\u573a\u666f\u662f\u4e00\u53f0\u673a\u5668\u4e0a\u53ea\u8fd0\u884c\u4e00\u4e2aNamenode\u5b9e\u4f8b\uff0c\u800c\u96c6\u7fa4\u4e2d\u7684\u5176\u5b83\u673a\u5668\u5206\u522b\u8fd0\u884c\u4e00\u4e2aDatanode\u5b9e\u4f8b\u3002\u8fd9\u79cd\u67b6\u6784\u5e76\u4e0d\u6392\u65a5\u5728\u4e00\u53f0\u673a\u5668\u4e0a\u8fd0\u884c\u591a\u4e2aDatanode\uff0c\u53ea\u4e0d\u8fc7\u8fd9\u6837\u7684\u60c5\u51b5\u6bd4\u8f83\u5c11\u89c1\u3002<\/p>\n

      \u96c6\u7fa4\u4e2d\u5355\u4e00Namenode\u7684\u7ed3\u6784\u5927\u5927\u7b80\u5316\u4e86\u7cfb\u7edf\u7684\u67b6\u6784\u3002Namenode\u662f\u6240\u6709HDFS\u5143\u6570\u636e\u7684\u4ef2\u88c1\u8005\u548c\u7ba1\u7406\u8005\uff0c\u8fd9\u6837\uff0c\u7528\u6237\u6570\u636e\u6c38\u8fdc\u4e0d\u4f1a\u6d41\u8fc7Namenode\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u6587\u4ef6\u7cfb\u7edf\u7684\u540d\u5b57\u7a7a\u95f4 (namespace)<\/h2>\n
\n

        HDFS\u652f\u6301\u4f20\u7edf\u7684\u5c42\u6b21\u578b\u6587\u4ef6\u7ec4\u7ec7\u7ed3\u6784\u3002\u7528\u6237\u6216\u8005\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u521b\u5efa\u76ee\u5f55\uff0c\u7136\u540e\u5c06\u6587\u4ef6\u4fdd\u5b58\u5728\u8fd9\u4e9b\u76ee\u5f55\u91cc\u3002\u6587\u4ef6\u7cfb\u7edf\u540d\u5b57\u7a7a\u95f4\u7684\u5c42\u6b21\u7ed3\u6784\u548c\u5927\u591a\u6570\u73b0\u6709\u7684\u6587\u4ef6\u7cfb\u7edf\u7c7b\u4f3c\uff1a\u7528\u6237\u53ef\u4ee5\u521b\u5efa\u3001\u5220\u9664\u3001\u79fb\u52a8\u6216\u91cd\u547d\u540d\u6587\u4ef6\u3002\u5f53\u524d\uff0cHDFS\u4e0d\u652f\u6301\u7528\u6237\u78c1\u76d8\u914d\u989d\u548c\u8bbf\u95ee\u6743\u9650\u63a7\u5236\uff0c\u4e5f\u4e0d\u652f\u6301\u786c\u94fe\u63a5\u548c\u8f6f\u94fe\u63a5\u3002\u4f46\u662fHDFS\u67b6\u6784\u5e76\u4e0d\u59a8\u788d\u5b9e\u73b0\u8fd9\u4e9b\u7279\u6027\u3002<\/p>\n

        Namenode\u8d1f\u8d23\u7ef4\u62a4\u6587\u4ef6\u7cfb\u7edf\u7684\u540d\u5b57\u7a7a\u95f4\uff0c\u4efb\u4f55\u5bf9\u6587\u4ef6\u7cfb\u7edf\u540d\u5b57\u7a7a\u95f4\u6216\u5c5e\u6027\u7684\u4fee\u6539\u90fd\u5c06\u88abNamenode\u8bb0\u5f55\u4e0b\u6765\u3002\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u8bbe\u7f6eHDFS\u4fdd\u5b58\u7684\u6587\u4ef6\u7684\u526f\u672c\u6570\u76ee\u3002\u6587\u4ef6\u526f\u672c\u7684\u6570\u76ee\u79f0\u4e3a\u6587\u4ef6\u7684\u526f\u672c\u7cfb\u6570\uff0c\u8fd9\u4e2a\u4fe1\u606f\u4e5f\u662f\u7531Namenode\u4fdd\u5b58\u7684\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u6570\u636e\u590d\u5236<\/h2>\n
\n

      HDFS\u88ab\u8bbe\u8ba1\u6210\u80fd\u591f\u5728\u4e00\u4e2a\u5927\u96c6\u7fa4\u4e2d\u8de8\u673a\u5668\u53ef\u9760\u5730\u5b58\u50a8\u8d85\u5927\u6587\u4ef6\u3002\u5b83\u5c06\u6bcf\u4e2a\u6587\u4ef6\u5b58\u50a8\u6210\u4e00\u7cfb\u5217\u7684\u6570\u636e\u5757\uff0c\u9664\u4e86\u6700\u540e\u4e00\u4e2a\uff0c\u6240\u6709\u7684\u6570\u636e\u5757\u90fd\u662f\u540c\u6837\u5927\u5c0f\u7684\u3002\u4e3a\u4e86\u5bb9\u9519\uff0c\u6587\u4ef6\u7684\u6240\u6709\u6570\u636e\u5757\u90fd\u4f1a\u6709\u526f\u672c\u3002\u6bcf\u4e2a\u6587\u4ef6\u7684\u6570\u636e\u5757\u5927\u5c0f\u548c\u526f\u672c\u7cfb\u6570\u90fd\u662f\u53ef\u914d\u7f6e\u7684\u3002\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u6307\u5b9a\u67d0\u4e2a\u6587\u4ef6\u7684\u526f\u672c\u6570\u76ee\u3002\u526f\u672c\u7cfb\u6570\u53ef\u4ee5\u5728\u6587\u4ef6\u521b\u5efa\u7684\u65f6\u5019\u6307\u5b9a\uff0c\u4e5f\u53ef\u4ee5\u5728\u4e4b\u540e\u6539\u53d8\u3002HDFS\u4e2d\u7684\u6587\u4ef6\u90fd\u662f\u4e00\u6b21\u6027\u5199\u5165\u7684\uff0c\u5e76\u4e14\u4e25\u683c\u8981\u6c42\u5728\u4efb\u4f55\u65f6\u5019\u53ea\u80fd\u6709\u4e00\u4e2a\u5199\u5165\u8005\u3002<\/p>\n

        Namenode\u5168\u6743\u7ba1\u7406\u6570\u636e\u5757\u7684\u590d\u5236\uff0c\u5b83\u5468\u671f\u6027\u5730\u4ece\u96c6\u7fa4\u4e2d\u7684\u6bcf\u4e2aDatanode\u63a5\u6536\u5fc3\u8df3\u4fe1\u53f7\u548c\u5757\u72b6\u6001\u62a5\u544a(Blockreport)\u3002\u63a5\u6536\u5230\u5fc3\u8df3\u4fe1\u53f7\u610f\u5473\u7740\u8be5Datanode\u8282\u70b9\u5de5\u4f5c\u6b63\u5e38\u3002\u5757\u72b6\u6001\u62a5\u544a\u5305\u542b\u4e86\u4e00\u4e2a\u8be5Datanode\u4e0a\u6240\u6709\u6570\u636e\u5757\u7684\u5217\u8868\u3002<\/p>\n

\"HDFS<\/div>\n

<\/a><\/a><\/p>\n

\u526f\u672c\u5b58\u653e: \u6700\u6700\u5f00\u59cb\u7684\u4e00\u6b65<\/h3>\n

      \u526f\u672c\u7684\u5b58\u653e\u662fHDFS\u53ef\u9760\u6027\u548c\u6027\u80fd\u7684\u5173\u952e\u3002\u4f18\u5316\u7684\u526f\u672c\u5b58\u653e\u7b56\u7565\u662fHDFS\u533a\u5206\u4e8e\u5176\u4ed6\u5927\u90e8\u5206\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\u7684\u91cd\u8981\u7279\u6027\u3002\u8fd9\u79cd\u7279\u6027\u9700\u8981\u505a\u5927\u91cf\u7684\u8c03\u4f18\uff0c\u5e76\u9700\u8981\u7ecf\u9a8c\u7684\u79ef\u7d2f\u3002HDFS\u91c7\u7528\u4e00\u79cd\u79f0\u4e3a\u673a\u67b6\u611f\u77e5(rack-aware)\u7684\u7b56\u7565\u6765\u6539\u8fdb\u6570\u636e\u7684\u53ef\u9760\u6027\u3001\u53ef\u7528\u6027\u548c\u7f51\u7edc\u5e26\u5bbd\u7684\u5229\u7528\u7387\u3002\u76ee\u524d\u5b9e\u73b0\u7684\u526f\u672c\u5b58\u653e\u7b56\u7565\u53ea\u662f\u5728\u8fd9\u4e2a\u65b9\u5411\u4e0a\u7684\u7b2c\u4e00\u6b65\u3002\u5b9e\u73b0\u8fd9\u4e2a\u7b56\u7565\u7684\u77ed\u671f\u76ee\u6807\u662f\u9a8c\u8bc1\u5b83\u5728\u751f\u4ea7\u73af\u5883\u4e0b\u7684\u6709\u6548\u6027\uff0c\u89c2\u5bdf\u5b83\u7684\u884c\u4e3a\uff0c\u4e3a\u5b9e\u73b0\u66f4\u5148\u8fdb\u7684\u7b56\u7565\u6253\u4e0b\u6d4b\u8bd5\u548c\u7814\u7a76\u7684\u57fa\u7840\u3002<\/p>\n

      \u5927\u578bHDFS\u5b9e\u4f8b\u4e00\u822c\u8fd0\u884c\u5728\u8de8\u8d8a\u591a\u4e2a\u673a\u67b6\u7684\u8ba1\u7b97\u673a\u7ec4\u6210\u7684\u96c6\u7fa4\u4e0a\uff0c\u4e0d\u540c\u673a\u67b6\u4e0a\u7684\u4e24\u53f0\u673a\u5668\u4e4b\u95f4\u7684\u901a\u8baf\u9700\u8981\u7ecf\u8fc7\u4ea4\u6362\u673a\u3002\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u540c\u4e00\u4e2a\u673a\u67b6\u5185\u7684\u4e24\u53f0\u673a\u5668\u95f4\u7684\u5e26\u5bbd\u4f1a\u6bd4\u4e0d\u540c\u673a\u67b6\u7684\u4e24\u53f0\u673a\u5668\u95f4\u7684\u5e26\u5bbd\u5927\u3002<\/p>\n

      \u901a\u8fc7\u4e00\u4e2a\u673a\u67b6\u611f\u77e5<\/a>\u7684\u8fc7\u7a0b\uff0cNamenode\u53ef\u4ee5\u786e\u5b9a\u6bcf\u4e2aDatanode\u6240\u5c5e\u7684\u673a\u67b6id\u3002\u4e00\u4e2a\u7b80\u5355\u4f46\u6ca1\u6709\u4f18\u5316\u7684\u7b56\u7565\u5c31\u662f\u5c06\u526f\u672c\u5b58\u653e\u5728\u4e0d\u540c\u7684\u673a\u67b6\u4e0a\u3002\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u5f53\u6574\u4e2a\u673a\u67b6\u5931\u6548\u65f6\u6570\u636e\u7684\u4e22\u5931\uff0c\u5e76\u4e14\u5141\u8bb8\u8bfb\u6570\u636e\u7684\u65f6\u5019\u5145\u5206\u5229\u7528\u591a\u4e2a\u673a\u67b6\u7684\u5e26\u5bbd\u3002\u8fd9\u79cd\u7b56\u7565\u8bbe\u7f6e\u53ef\u4ee5\u5c06\u526f\u672c\u5747\u5300\u5206\u5e03\u5728\u96c6\u7fa4\u4e2d\uff0c\u6709\u5229\u4e8e\u5f53\u7ec4\u4ef6\u5931\u6548\u60c5\u51b5\u4e0b\u7684\u8d1f\u8f7d\u5747\u8861\u3002\u4f46\u662f\uff0c\u56e0\u4e3a\u8fd9\u79cd\u7b56\u7565\u7684\u4e00\u4e2a\u5199\u64cd\u4f5c\u9700\u8981\u4f20\u8f93\u6570\u636e\u5757\u5230\u591a\u4e2a\u673a\u67b6\uff0c\u8fd9\u589e\u52a0\u4e86\u5199\u7684\u4ee3\u4ef7\u3002<\/p>\n

        \u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u526f\u672c\u7cfb\u6570\u662f3\uff0cHDFS\u7684\u5b58\u653e\u7b56\u7565\u662f\u5c06\u4e00\u4e2a\u526f\u672c\u5b58\u653e\u5728\u672c\u5730\u673a\u67b6\u7684\u8282\u70b9\u4e0a\uff0c\u4e00\u4e2a\u526f\u672c\u653e\u5728\u540c\u4e00\u673a\u67b6\u7684\u53e6\u4e00\u4e2a\u8282\u70b9\u4e0a\uff0c\u6700\u540e\u4e00\u4e2a\u526f\u672c\u653e\u5728\u4e0d\u540c\u673a\u67b6\u7684\u8282\u70b9\u4e0a\u3002\u8fd9\u79cd\u7b56\u7565\u51cf\u5c11\u4e86\u673a\u67b6\u95f4\u7684\u6570\u636e\u4f20\u8f93\uff0c\u8fd9\u5c31\u63d0\u9ad8\u4e86\u5199\u64cd\u4f5c\u7684\u6548\u7387\u3002\u673a\u67b6\u7684\u9519\u8bef\u8fdc\u8fdc\u6bd4\u8282\u70b9\u7684\u9519\u8bef\u5c11\uff0c\u6240\u4ee5\u8fd9\u4e2a\u7b56\u7565\u4e0d\u4f1a\u5f71\u54cd\u5230\u6570\u636e\u7684\u53ef\u9760\u6027\u548c\u53ef\u7528\u6027\u3002\u4e8e\u6b64\u540c\u65f6\uff0c\u56e0\u4e3a\u6570\u636e\u5757\u53ea\u653e\u5728\u4e24\u4e2a\uff08\u4e0d\u662f\u4e09\u4e2a\uff09\u4e0d\u540c\u7684\u673a\u67b6\u4e0a\uff0c\u6240\u4ee5\u6b64\u7b56\u7565\u51cf\u5c11\u4e86\u8bfb\u53d6\u6570\u636e\u65f6\u9700\u8981\u7684\u7f51\u7edc\u4f20\u8f93\u603b\u5e26\u5bbd\u3002\u5728\u8fd9\u79cd\u7b56\u7565\u4e0b\uff0c\u526f\u672c\u5e76\u4e0d\u662f\u5747\u5300\u5206\u5e03\u5728\u4e0d\u540c\u7684\u673a\u67b6\u4e0a\u3002\u4e09\u5206\u4e4b\u4e00\u7684\u526f\u672c\u5728\u4e00\u4e2a\u8282\u70b9\u4e0a\uff0c\u4e09\u5206\u4e4b\u4e8c\u7684\u526f\u672c\u5728\u4e00\u4e2a\u673a\u67b6\u4e0a\uff0c\u5176\u4ed6\u526f\u672c\u5747\u5300\u5206\u5e03\u5728\u5269\u4e0b\u7684\u673a\u67b6\u4e2d\uff0c\u8fd9\u4e00\u7b56\u7565\u5728\u4e0d\u635f\u5bb3\u6570\u636e\u53ef\u9760\u6027\u548c\u8bfb\u53d6\u6027\u80fd\u7684\u60c5\u51b5\u4e0b\u6539\u8fdb\u4e86\u5199\u7684\u6027\u80fd\u3002<\/p>\n

\u5f53\u524d\uff0c\u8fd9\u91cc\u4ecb\u7ecd\u7684\u9ed8\u8ba4\u526f\u672c\u5b58\u653e\u7b56\u7565\u6b63\u5728\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u526f\u672c\u9009\u62e9<\/h3>\n

        \u4e3a\u4e86\u964d\u4f4e\u6574\u4f53\u7684\u5e26\u5bbd\u6d88\u8017\u548c\u8bfb\u53d6\u5ef6\u65f6\uff0cHDFS\u4f1a\u5c3d\u91cf\u8ba9\u8bfb\u53d6\u7a0b\u5e8f\u8bfb\u53d6\u79bb\u5b83\u6700\u8fd1\u7684\u526f\u672c\u3002\u5982\u679c\u5728\u8bfb\u53d6\u7a0b\u5e8f\u7684\u540c\u4e00\u4e2a\u673a\u67b6\u4e0a\u6709\u4e00\u4e2a\u526f\u672c\uff0c\u90a3\u4e48\u5c31\u8bfb\u53d6\u8be5\u526f\u672c\u3002\u5982\u679c\u4e00\u4e2aHDFS\u96c6\u7fa4\u8de8\u8d8a\u591a\u4e2a\u6570\u636e\u4e2d\u5fc3\uff0c\u90a3\u4e48\u5ba2\u6237\u7aef\u4e5f\u5c06\u9996\u5148\u8bfb\u672c\u5730\u6570\u636e\u4e2d\u5fc3\u7684\u526f\u672c\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u5b89\u5168\u6a21\u5f0f<\/h3>\n

      Namenode\u542f\u52a8\u540e\u4f1a\u8fdb\u5165\u4e00\u4e2a\u79f0\u4e3a\u5b89\u5168\u6a21\u5f0f\u7684\u7279\u6b8a\u72b6\u6001\u3002\u5904\u4e8e\u5b89\u5168\u6a21\u5f0f\u7684Namenode\u662f\u4e0d\u4f1a\u8fdb\u884c\u6570\u636e\u5757\u7684\u590d\u5236\u7684\u3002Namenode\u4ece\u6240\u6709\u7684 Datanode\u63a5\u6536\u5fc3\u8df3\u4fe1\u53f7\u548c\u5757\u72b6\u6001\u62a5\u544a\u3002\u5757\u72b6\u6001\u62a5\u544a\u5305\u62ec\u4e86\u67d0\u4e2aDatanode\u6240\u6709\u7684\u6570\u636e\u5757\u5217\u8868\u3002\u6bcf\u4e2a\u6570\u636e\u5757\u90fd\u6709\u4e00\u4e2a\u6307\u5b9a\u7684\u6700\u5c0f\u526f\u672c\u6570\u3002\u5f53Namenode\u68c0\u6d4b\u786e\u8ba4\u67d0\u4e2a\u6570\u636e\u5757\u7684\u526f\u672c\u6570\u76ee\u8fbe\u5230\u8fd9\u4e2a\u6700\u5c0f\u503c\uff0c\u90a3\u4e48\u8be5\u6570\u636e\u5757\u5c31\u4f1a\u88ab\u8ba4\u4e3a\u662f\u526f\u672c\u5b89\u5168(safely replicated)\u7684\uff1b\u5728\u4e00\u5b9a\u767e\u5206\u6bd4\uff08\u8fd9\u4e2a\u53c2\u6570\u53ef\u914d\u7f6e\uff09\u7684\u6570\u636e\u5757\u88abNamenode\u68c0\u6d4b\u786e\u8ba4\u662f\u5b89\u5168\u4e4b\u540e\uff08\u52a0\u4e0a\u4e00\u4e2a\u989d\u5916\u768430\u79d2\u7b49\u5f85\u65f6\u95f4\uff09\uff0cNamenode\u5c06\u9000\u51fa\u5b89\u5168\u6a21\u5f0f\u72b6\u6001\u3002\u63a5\u4e0b\u6765\u5b83\u4f1a\u786e\u5b9a\u8fd8\u6709\u54ea\u4e9b\u6570\u636e\u5757\u7684\u526f\u672c\u6ca1\u6709\u8fbe\u5230\u6307\u5b9a\u6570\u76ee\uff0c\u5e76\u5c06\u8fd9\u4e9b\u6570\u636e\u5757\u590d\u5236\u5230\u5176\u4ed6Datanode\u4e0a\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u6587\u4ef6\u7cfb\u7edf\u5143\u6570\u636e\u7684\u6301\u4e45\u5316<\/h2>\n
\n

        Namenode\u4e0a\u4fdd\u5b58\u7740HDFS\u7684\u540d\u5b57\u7a7a\u95f4\u3002\u5bf9\u4e8e\u4efb\u4f55\u5bf9\u6587\u4ef6\u7cfb\u7edf\u5143\u6570\u636e\u4ea7\u751f\u4fee\u6539\u7684\u64cd\u4f5c\uff0cNamenode\u90fd\u4f1a\u4f7f\u7528\u4e00\u79cd\u79f0\u4e3aEditLog\u7684\u4e8b\u52a1\u65e5\u5fd7\u8bb0\u5f55\u4e0b\u6765\u3002\u4f8b\u5982\uff0c\u5728HDFS\u4e2d\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\uff0cNamenode\u5c31\u4f1a\u5728Editlog\u4e2d\u63d2\u5165\u4e00\u6761\u8bb0\u5f55\u6765\u8868\u793a\uff1b\u540c\u6837\u5730\uff0c\u4fee\u6539\u6587\u4ef6\u7684\u526f\u672c\u7cfb\u6570\u4e5f\u5c06\u5f80Editlog\u63d2\u5165\u4e00\u6761\u8bb0\u5f55\u3002Namenode\u5728\u672c\u5730\u64cd\u4f5c\u7cfb\u7edf\u7684\u6587\u4ef6\u7cfb\u7edf\u4e2d\u5b58\u50a8\u8fd9\u4e2aEditlog\u3002\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u7684\u540d\u5b57\u7a7a\u95f4\uff0c\u5305\u62ec\u6570\u636e\u5757\u5230\u6587\u4ef6\u7684\u6620\u5c04\u3001\u6587\u4ef6\u7684\u5c5e\u6027\u7b49\uff0c\u90fd\u5b58\u50a8\u5728\u4e00\u4e2a\u79f0\u4e3aFsImage\u7684\u6587\u4ef6\u4e2d\uff0c\u8fd9\u4e2a\u6587\u4ef6\u4e5f\u662f\u653e\u5728Namenode\u6240\u5728\u7684\u672c\u5730\u6587\u4ef6\u7cfb\u7edf\u4e0a\u3002<\/p>\n

      Namenode\u5728\u5185\u5b58\u4e2d\u4fdd\u5b58\u7740\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u7684\u540d\u5b57\u7a7a\u95f4\u548c\u6587\u4ef6\u6570\u636e\u5757\u6620\u5c04(Blockmap)\u7684\u6620\u50cf\u3002\u8fd9\u4e2a\u5173\u952e\u7684\u5143\u6570\u636e\u7ed3\u6784\u8bbe\u8ba1\u5f97\u5f88\u7d27\u51d1\uff0c\u56e0\u800c\u4e00\u4e2a\u67094G\u5185\u5b58\u7684Namenode\u8db3\u591f\u652f\u6491\u5927\u91cf\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u3002\u5f53Namenode\u542f\u52a8\u65f6\uff0c\u5b83\u4ece\u786c\u76d8\u4e2d\u8bfb\u53d6Editlog\u548cFsImage\uff0c\u5c06\u6240\u6709Editlog\u4e2d\u7684\u4e8b\u52a1\u4f5c\u7528\u5728\u5185\u5b58\u4e2d\u7684FsImage\u4e0a\uff0c\u5e76\u5c06\u8fd9\u4e2a\u65b0\u7248\u672c\u7684FsImage\u4ece\u5185\u5b58\u4e2d\u4fdd\u5b58\u5230\u672c\u5730\u78c1\u76d8\u4e0a\uff0c\u7136\u540e\u5220\u9664\u65e7\u7684Editlog\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u65e7\u7684Editlog\u7684\u4e8b\u52a1\u90fd\u5df2\u7ecf\u4f5c\u7528\u5728FsImage\u4e0a\u4e86\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e3a\u4e00\u4e2a\u68c0\u67e5\u70b9(checkpoint)\u3002\u5728\u5f53\u524d\u5b9e\u73b0\u4e2d\uff0c\u68c0\u67e5\u70b9\u53ea\u53d1\u751f\u5728Namenode\u542f\u52a8\u65f6\uff0c\u5728\u4e0d\u4e45\u7684\u5c06\u6765\u5c06\u5b9e\u73b0\u652f\u6301\u5468\u671f\u6027\u7684\u68c0\u67e5\u70b9\u3002<\/p>\n

      Datanode\u5c06HDFS\u6570\u636e\u4ee5\u6587\u4ef6\u7684\u5f62\u5f0f\u5b58\u50a8\u5728\u672c\u5730\u7684\u6587\u4ef6\u7cfb\u7edf\u4e2d\uff0c\u5b83\u5e76\u4e0d\u77e5\u9053\u6709\u5173HDFS\u6587\u4ef6\u7684\u4fe1\u606f\u3002\u5b83\u628a\u6bcf\u4e2aHDFS\u6570\u636e\u5757\u5b58\u50a8\u5728\u672c\u5730\u6587\u4ef6\u7cfb\u7edf\u7684\u4e00\u4e2a\u5355\u72ec\u7684\u6587\u4ef6\u4e2d\u3002Datanode\u5e76\u4e0d\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u521b\u5efa\u6240\u6709\u7684\u6587\u4ef6\uff0c\u5b9e\u9645\u4e0a\uff0c\u5b83\u7528\u8bd5\u63a2\u7684\u65b9\u6cd5\u6765\u786e\u5b9a\u6bcf\u4e2a\u76ee\u5f55\u7684\u6700\u4f73\u6587\u4ef6\u6570\u76ee\uff0c\u5e76\u4e14\u5728\u9002\u5f53\u7684\u65f6\u5019\u521b\u5efa\u5b50\u76ee\u5f55\u3002\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u4e2d\u521b\u5efa\u6240\u6709\u7684\u672c\u5730\u6587\u4ef6\u5e76\u4e0d\u662f\u6700\u4f18\u7684\u9009\u62e9\uff0c\u8fd9\u662f\u56e0\u4e3a\u672c\u5730\u6587\u4ef6\u7cfb\u7edf\u53ef\u80fd\u65e0\u6cd5\u9ad8\u6548\u5730\u5728\u5355\u4e2a\u76ee\u5f55\u4e2d\u652f\u6301\u5927\u91cf\u7684\u6587\u4ef6\u3002\u5f53\u4e00\u4e2aDatanode\u542f\u52a8\u65f6\uff0c\u5b83\u4f1a\u626b\u63cf\u672c\u5730\u6587\u4ef6\u7cfb\u7edf\uff0c\u4ea7\u751f\u4e00\u4e2a\u8fd9\u4e9b\u672c\u5730\u6587\u4ef6\u5bf9\u5e94\u7684\u6240\u6709HDFS\u6570\u636e\u5757\u7684\u5217\u8868\uff0c\u7136\u540e\u4f5c\u4e3a\u62a5\u544a\u53d1\u9001\u5230Namenode\uff0c\u8fd9\u4e2a\u62a5\u544a\u5c31\u662f\u5757\u72b6\u6001\u62a5\u544a\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u901a\u8baf\u534f\u8bae<\/h2>\n
\n

      \u6240\u6709\u7684HDFS\u901a\u8baf\u534f\u8bae\u90fd\u662f\u5efa\u7acb\u5728TCP\/IP\u534f\u8bae\u4e4b\u4e0a\u3002\u5ba2\u6237\u7aef\u901a\u8fc7\u4e00\u4e2a\u53ef\u914d\u7f6e\u7684TCP<\/acronym>\u7aef\u53e3\u8fde\u63a5\u5230Namenode\uff0c\u901a\u8fc7ClientProtocol\u534f\u8bae\u4e0eNamenode\u4ea4\u4e92\u3002\u800cDatanode\u4f7f\u7528DatanodeProtocol\u534f\u8bae\u4e0eNamenode\u4ea4\u4e92\u3002\u4e00\u4e2a\u8fdc\u7a0b\u8fc7\u7a0b\u8c03\u7528(RPC<\/acronym>)\u6a21\u578b\u88ab\u62bd\u8c61\u51fa\u6765\u5c01\u88c5ClientProtocol\u548cDatanodeprotocol\u534f\u8bae\u3002\u5728\u8bbe\u8ba1\u4e0a\uff0cNamenode\u4e0d\u4f1a\u4e3b\u52a8\u53d1\u8d77RPC\uff0c\u800c\u662f\u54cd\u5e94\u6765\u81ea\u5ba2\u6237\u7aef\u6216 Datanode \u7684RPC\u8bf7\u6c42\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u5065\u58ee\u6027<\/h2>\n
\n

HDFS\u7684\u4e3b\u8981\u76ee\u6807\u5c31\u662f\u5373\u4f7f\u5728\u51fa\u9519\u7684\u60c5\u51b5\u4e0b\u4e5f\u8981\u4fdd\u8bc1\u6570\u636e\u5b58\u50a8\u7684\u53ef\u9760\u6027\u3002\u5e38\u89c1\u7684\u4e09\u79cd\u51fa\u9519\u60c5\u51b5\u662f\uff1aNamenode\u51fa\u9519, Datanode\u51fa\u9519\u548c\u7f51\u7edc\u5272\u88c2(network partitions)\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u78c1\u76d8\u6570\u636e\u9519\u8bef\uff0c\u5fc3\u8df3\u68c0\u6d4b\u548c\u91cd\u65b0\u590d\u5236<\/h3>\n

       \u6bcf\u4e2aDatanode\u8282\u70b9\u5468\u671f\u6027\u5730\u5411Namenode\u53d1\u9001\u5fc3\u8df3\u4fe1\u53f7\u3002\u7f51\u7edc\u5272\u88c2\u53ef\u80fd\u5bfc\u81f4\u4e00\u90e8\u5206Datanode\u8ddfNamenode\u5931\u53bb\u8054\u7cfb\u3002Namenode\u901a\u8fc7\u5fc3\u8df3\u4fe1\u53f7\u7684\u7f3a\u5931\u6765\u68c0\u6d4b\u8fd9\u4e00\u60c5\u51b5\uff0c\u5e76\u5c06\u8fd9\u4e9b\u8fd1\u671f\u4e0d\u518d\u53d1\u9001\u5fc3\u8df3\u4fe1\u53f7Datanode\u6807\u8bb0\u4e3a\u5b95\u673a\uff0c\u4e0d\u4f1a\u518d\u5c06\u65b0\u7684IO<\/acronym>\u8bf7\u6c42\u53d1\u7ed9\u5b83\u4eec\u3002\u4efb\u4f55\u5b58\u50a8\u5728\u5b95\u673aDatanode\u4e0a\u7684\u6570\u636e\u5c06\u4e0d\u518d\u6709\u6548\u3002Datanode\u7684\u5b95\u673a\u53ef\u80fd\u4f1a\u5f15\u8d77\u4e00\u4e9b\u6570\u636e\u5757\u7684\u526f\u672c\u7cfb\u6570\u4f4e\u4e8e\u6307\u5b9a\u503c\uff0cNamenode\u4e0d\u65ad\u5730\u68c0\u6d4b\u8fd9\u4e9b\u9700\u8981\u590d\u5236\u7684\u6570\u636e\u5757\uff0c\u4e00\u65e6\u53d1\u73b0\u5c31\u542f\u52a8\u590d\u5236\u64cd\u4f5c\u3002\u5728\u4e0b\u5217\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u9700\u8981\u91cd\u65b0\u590d\u5236\uff1a\u67d0\u4e2aDatanode\u8282\u70b9\u5931\u6548\uff0c\u67d0\u4e2a\u526f\u672c\u906d\u5230\u635f\u574f\uff0cDatanode\u4e0a\u7684\u786c\u76d8\u9519\u8bef\uff0c\u6216\u8005\u6587\u4ef6\u7684\u526f\u672c\u7cfb\u6570\u589e\u5927\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u96c6\u7fa4\u5747\u8861<\/h3>\n

      HDFS\u7684\u67b6\u6784\u652f\u6301\u6570\u636e\u5747\u8861\u7b56\u7565\u3002\u5982\u679c\u67d0\u4e2aDatanode\u8282\u70b9\u4e0a\u7684\u7a7a\u95f2\u7a7a\u95f4\u4f4e\u4e8e\u7279\u5b9a\u7684\u4e34\u754c\u70b9\uff0c\u6309\u7167\u5747\u8861\u7b56\u7565\u7cfb\u7edf\u5c31\u4f1a\u81ea\u52a8\u5730\u5c06\u6570\u636e\u4ece\u8fd9\u4e2aDatanode\u79fb\u52a8\u5230\u5176\u4ed6\u7a7a\u95f2\u7684Datanode\u3002\u5f53\u5bf9\u67d0\u4e2a\u6587\u4ef6\u7684\u8bf7\u6c42\u7a81\u7136\u589e\u52a0\uff0c\u90a3\u4e48\u4e5f\u53ef\u80fd\u542f\u52a8\u4e00\u4e2a\u8ba1\u5212\u521b\u5efa\u8be5\u6587\u4ef6\u65b0\u7684\u526f\u672c\uff0c\u5e76\u4e14\u540c\u65f6\u91cd\u65b0\u5e73\u8861\u96c6\u7fa4\u4e2d\u7684\u5176\u4ed6\u6570\u636e\u3002\u8fd9\u4e9b\u5747\u8861\u7b56\u7565\u76ee\u524d\u8fd8\u6ca1\u6709\u5b9e\u73b0\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u6570\u636e\u5b8c\u6574\u6027<\/h3>\n

      \u4ece\u67d0\u4e2aDatanode\u83b7\u53d6\u7684\u6570\u636e\u5757\u6709\u53ef\u80fd\u662f\u635f\u574f\u7684\uff0c\u635f\u574f\u53ef\u80fd\u662f\u7531Datanode\u7684\u5b58\u50a8\u8bbe\u5907\u9519\u8bef\u3001\u7f51\u7edc\u9519\u8bef\u6216\u8005\u8f6f\u4ef6bug\u9020\u6210\u7684\u3002HDFS\u5ba2\u6237\u7aef\u8f6f\u4ef6\u5b9e\u73b0\u4e86\u5bf9HDFS\u6587\u4ef6\u5185\u5bb9\u7684\u6821\u9a8c\u548c(checksum)\u68c0\u67e5\u3002\u5f53\u5ba2\u6237\u7aef\u521b\u5efa\u4e00\u4e2a\u65b0\u7684HDFS\u6587\u4ef6\uff0c\u4f1a\u8ba1\u7b97\u8fd9\u4e2a\u6587\u4ef6\u6bcf\u4e2a\u6570\u636e\u5757\u7684\u6821\u9a8c\u548c\uff0c\u5e76\u5c06\u6821\u9a8c\u548c\u4f5c\u4e3a\u4e00\u4e2a\u5355\u72ec\u7684\u9690\u85cf\u6587\u4ef6\u4fdd\u5b58\u5728\u540c\u4e00\u4e2aHDFS\u540d\u5b57\u7a7a\u95f4\u4e0b\u3002\u5f53\u5ba2\u6237\u7aef\u83b7\u53d6\u6587\u4ef6\u5185\u5bb9\u540e\uff0c\u5b83\u4f1a\u68c0\u9a8c\u4eceDatanode\u83b7\u53d6\u7684\u6570\u636e\u8ddf\u76f8\u5e94\u7684\u6821\u9a8c\u548c\u6587\u4ef6\u4e2d\u7684\u6821\u9a8c\u548c\u662f\u5426\u5339\u914d\uff0c\u5982\u679c\u4e0d\u5339\u914d\uff0c\u5ba2\u6237\u7aef\u53ef\u4ee5\u9009\u62e9\u4ece\u5176\u4ed6Datanode\u83b7\u53d6\u8be5\u6570\u636e\u5757\u7684\u526f\u672c\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u5143\u6570\u636e\u78c1\u76d8\u9519\u8bef<\/h3>\n

      FsImage\u548cEditlog\u662fHDFS\u7684\u6838\u5fc3\u6570\u636e\u7ed3\u6784\u3002\u5982\u679c\u8fd9\u4e9b\u6587\u4ef6\u635f\u574f\u4e86\uff0c\u6574\u4e2aHDFS\u5b9e\u4f8b\u90fd\u5c06\u5931\u6548\u3002\u56e0\u800c\uff0cNamenode\u53ef\u4ee5\u914d\u7f6e\u6210\u652f\u6301\u7ef4\u62a4\u591a\u4e2aFsImage\u548cEditlog\u7684\u526f\u672c\u3002\u4efb\u4f55\u5bf9FsImage\u6216\u8005Editlog\u7684\u4fee\u6539\uff0c\u90fd\u5c06\u540c\u6b65\u5230\u5b83\u4eec\u7684\u526f\u672c\u4e0a\u3002\u8fd9\u79cd\u591a\u526f\u672c\u7684\u540c\u6b65\u64cd\u4f5c\u53ef\u80fd\u4f1a\u964d\u4f4eNamenode\u6bcf\u79d2\u5904\u7406\u7684\u540d\u5b57\u7a7a\u95f4\u4e8b\u52a1\u6570\u91cf\u3002\u7136\u800c\u8fd9\u4e2a\u4ee3\u4ef7\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\uff0c\u56e0\u4e3a\u5373\u4f7fHDFS\u7684\u5e94\u7528\u662f\u6570\u636e\u5bc6\u96c6\u7684\uff0c\u5b83\u4eec\u4e5f\u975e\u5143\u6570\u636e\u5bc6\u96c6\u7684\u3002\u5f53Namenode\u91cd\u542f\u7684\u65f6\u5019\uff0c\u5b83\u4f1a\u9009\u53d6\u6700\u8fd1\u7684\u5b8c\u6574\u7684FsImage\u548cEditlog\u6765\u4f7f\u7528\u3002<\/p>\n

      Namenode\u662fHDFS\u96c6\u7fa4\u4e2d\u7684\u5355\u70b9\u6545\u969c(single point of failure)\u6240\u5728\u3002\u5982\u679cNamenode\u673a\u5668\u6545\u969c\uff0c\u662f\u9700\u8981\u624b\u5de5\u5e72\u9884\u7684\u3002\u76ee\u524d\uff0c\u81ea\u52a8\u91cd\u542f\u6216\u5728\u53e6\u4e00\u53f0\u673a\u5668\u4e0a\u505aNamenode\u6545\u969c\u8f6c\u79fb\u7684\u529f\u80fd\u8fd8\u6ca1\u5b9e\u73b0\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u5feb\u7167<\/h3>\n

      \u5feb\u7167\u652f\u6301\u67d0\u4e00\u7279\u5b9a\u65f6\u523b\u7684\u6570\u636e\u7684\u590d\u5236\u5907\u4efd\u3002\u5229\u7528\u5feb\u7167\uff0c\u53ef\u4ee5\u8ba9HDFS\u5728\u6570\u636e\u635f\u574f\u65f6\u6062\u590d\u5230\u8fc7\u53bb\u4e00\u4e2a\u5df2\u77e5\u6b63\u786e\u7684\u65f6\u95f4\u70b9\u3002HDFS\u76ee\u524d\u8fd8\u4e0d\u652f\u6301\u5feb\u7167\u529f\u80fd\uff0c\u4f46\u8ba1\u5212\u5728\u5c06\u6765\u7684\u7248\u672c\u8fdb\u884c\u652f\u6301\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u6570\u636e\u7ec4\u7ec7<\/h2>\n
<\/a><\/a><\/p>\n

\u6570\u636e\u5757<\/h3>\n

      HDFS\u88ab\u8bbe\u8ba1\u6210\u652f\u6301\u5927\u6587\u4ef6\uff0c\u9002\u7528HDFS\u7684\u662f\u90a3\u4e9b\u9700\u8981\u5904\u7406\u5927\u89c4\u6a21\u7684\u6570\u636e\u96c6\u7684\u5e94\u7528\u3002\u8fd9\u4e9b\u5e94\u7528\u90fd\u662f\u53ea\u5199\u5165\u6570\u636e\u4e00\u6b21\uff0c\u4f46\u5374\u8bfb\u53d6\u4e00\u6b21\u6216\u591a\u6b21\uff0c\u5e76\u4e14\u8bfb\u53d6\u901f\u5ea6\u5e94\u80fd\u6ee1\u8db3\u6d41\u5f0f\u8bfb\u53d6\u7684\u9700\u8981\u3002HDFS\u652f\u6301\u6587\u4ef6\u7684“\u4e00\u6b21\u5199\u5165\u591a\u6b21\u8bfb\u53d6”\u8bed\u4e49\u3002\u4e00\u4e2a\u5178\u578b\u7684\u6570\u636e\u5757\u5927\u5c0f\u662f64MB\u3002\u56e0\u800c\uff0cHDFS\u4e2d\u7684\u6587\u4ef6\u603b\u662f\u6309\u716764M\u88ab\u5207\u5206\u6210\u4e0d\u540c\u7684\u5757\uff0c\u6bcf\u4e2a\u5757\u5c3d\u53ef\u80fd\u5730\u5b58\u50a8\u4e8e\u4e0d\u540c\u7684Datanode\u4e2d\u3002<\/p>\n

<\/a><\/a><\/p>\n

Staging<\/h3>\n

      \u5ba2\u6237\u7aef\u521b\u5efa\u6587\u4ef6\u7684\u8bf7\u6c42\u5176\u5b9e\u5e76\u6ca1\u6709\u7acb\u5373\u53d1\u9001\u7ed9Namenode\uff0c\u4e8b\u5b9e\u4e0a\uff0c\u5728\u521a\u5f00\u59cb\u9636\u6bb5HDFS\u5ba2\u6237\u7aef\u4f1a\u5148\u5c06\u6587\u4ef6\u6570\u636e\u7f13\u5b58\u5230\u672c\u5730\u7684\u4e00\u4e2a\u4e34\u65f6\u6587\u4ef6\u3002\u5e94\u7528\u7a0b\u5e8f\u7684\u5199\u64cd\u4f5c\u88ab\u900f\u660e\u5730\u91cd\u5b9a\u5411\u5230\u8fd9\u4e2a\u4e34\u65f6\u6587\u4ef6\u3002\u5f53\u8fd9\u4e2a\u4e34\u65f6\u6587\u4ef6\u7d2f\u79ef\u7684\u6570\u636e\u91cf\u8d85\u8fc7\u4e00\u4e2a\u6570\u636e\u5757\u7684\u5927\u5c0f\uff0c\u5ba2\u6237\u7aef\u624d\u4f1a\u8054\u7cfbNamenode\u3002Namenode\u5c06\u6587\u4ef6\u540d\u63d2\u5165\u6587\u4ef6\u7cfb\u7edf\u7684\u5c42\u6b21\u7ed3\u6784\u4e2d\uff0c\u5e76\u4e14\u5206\u914d\u4e00\u4e2a\u6570\u636e\u5757\u7ed9\u5b83\u3002\u7136\u540e\u8fd4\u56deDatanode\u7684\u6807\u8bc6\u7b26\u548c\u76ee\u6807\u6570\u636e\u5757\u7ed9\u5ba2\u6237\u7aef\u3002\u63a5\u7740\u5ba2\u6237\u7aef\u5c06\u8fd9\u5757\u6570\u636e\u4ece\u672c\u5730\u4e34\u65f6\u6587\u4ef6\u4e0a\u4f20\u5230\u6307\u5b9a\u7684Datanode\u4e0a\u3002\u5f53\u6587\u4ef6\u5173\u95ed\u65f6\uff0c\u5728\u4e34\u65f6\u6587\u4ef6\u4e2d\u5269\u4f59\u7684\u6ca1\u6709\u4e0a\u4f20\u7684\u6570\u636e\u4e5f\u4f1a\u4f20\u8f93\u5230\u6307\u5b9a\u7684Datanode\u4e0a\u3002\u7136\u540e\u5ba2\u6237\u7aef\u544a\u8bc9Namenode\u6587\u4ef6\u5df2\u7ecf\u5173\u95ed\u3002\u6b64\u65f6Namenode\u624d\u5c06\u6587\u4ef6\u521b\u5efa\u64cd\u4f5c\u63d0\u4ea4\u5230\u65e5\u5fd7\u91cc\u8fdb\u884c\u5b58\u50a8\u3002\u5982\u679cNamenode\u5728\u6587\u4ef6\u5173\u95ed\u524d\u5b95\u673a\u4e86\uff0c\u5219\u8be5\u6587\u4ef6\u5c06\u4e22\u5931\u3002<\/p>\n

      \u4e0a\u8ff0\u65b9\u6cd5\u662f\u5bf9\u5728HDFS\u4e0a\u8fd0\u884c\u7684\u76ee\u6807\u5e94\u7528\u8fdb\u884c\u8ba4\u771f\u8003\u8651\u540e\u5f97\u5230\u7684\u7ed3\u679c\u3002\u8fd9\u4e9b\u5e94\u7528\u9700\u8981\u8fdb\u884c\u6587\u4ef6\u7684\u6d41\u5f0f\u5199\u5165\u3002\u5982\u679c\u4e0d\u91c7\u7528\u5ba2\u6237\u7aef\u7f13\u5b58\uff0c\u7531\u4e8e\u7f51\u7edc\u901f\u5ea6\u548c\u7f51\u7edc\u5835\u585e\u4f1a\u5bf9\u541e\u4f30\u91cf\u9020\u6210\u6bd4\u8f83\u5927\u7684\u5f71\u54cd\u3002\u8fd9\u79cd\u65b9\u6cd5\u5e76\u4e0d\u662f\u6ca1\u6709\u5148\u4f8b\u7684\uff0c\u65e9\u671f\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u6bd4\u5982AFS<\/acronym>\uff0c\u5c31\u7528\u5ba2\u6237\u7aef\u7f13\u5b58\u6765\u63d0\u9ad8\u6027\u80fd\u3002\u4e3a\u4e86\u8fbe\u5230\u66f4\u9ad8\u7684\u6570\u636e\u4e0a\u4f20\u6548\u7387\uff0c\u5df2\u7ecf\u653e\u677e\u4e86POSIX\u6807\u51c6\u7684\u8981\u6c42\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u6d41\u6c34\u7ebf\u590d\u5236<\/h3>\n

      \u5f53\u5ba2\u6237\u7aef\u5411HDFS\u6587\u4ef6\u5199\u5165\u6570\u636e\u7684\u65f6\u5019\uff0c\u4e00\u5f00\u59cb\u662f\u5199\u5230\u672c\u5730\u4e34\u65f6\u6587\u4ef6\u4e2d\u3002\u5047\u8bbe\u8be5\u6587\u4ef6\u7684\u526f\u672c\u7cfb\u6570\u8bbe\u7f6e\u4e3a3\uff0c\u5f53\u672c\u5730\u4e34\u65f6\u6587\u4ef6\u7d2f\u79ef\u5230\u4e00\u4e2a\u6570\u636e\u5757\u7684\u5927\u5c0f\u65f6\uff0c\u5ba2\u6237\u7aef\u4f1a\u4eceNamenode\u83b7\u53d6\u4e00\u4e2aDatanode\u5217\u8868\u7528\u4e8e\u5b58\u653e\u526f\u672c\u3002\u7136\u540e\u5ba2\u6237\u7aef\u5f00\u59cb\u5411\u7b2c\u4e00\u4e2aDatanode\u4f20\u8f93\u6570\u636e\uff0c\u7b2c\u4e00\u4e2aDatanode\u4e00\u5c0f\u90e8\u5206\u4e00\u5c0f\u90e8\u5206(4 KB)\u5730\u63a5\u6536\u6570\u636e\uff0c\u5c06\u6bcf\u4e00\u90e8\u5206\u5199\u5165\u672c\u5730\u4ed3\u5e93\uff0c\u5e76\u540c\u65f6\u4f20\u8f93\u8be5\u90e8\u5206\u5230\u5217\u8868\u4e2d\u7b2c\u4e8c\u4e2aDatanode\u8282\u70b9\u3002\u7b2c\u4e8c\u4e2aDatanode\u4e5f\u662f\u8fd9\u6837\uff0c\u4e00\u5c0f\u90e8\u5206\u4e00\u5c0f\u90e8\u5206\u5730\u63a5\u6536\u6570\u636e\uff0c\u5199\u5165\u672c\u5730\u4ed3\u5e93\uff0c\u5e76\u540c\u65f6\u4f20\u7ed9\u7b2c\u4e09\u4e2aDatanode\u3002\u6700\u540e\uff0c\u7b2c\u4e09\u4e2aDatanode\u63a5\u6536\u6570\u636e\u5e76\u5b58\u50a8\u5728\u672c\u5730\u3002\u56e0\u6b64\uff0cDatanode\u80fd\u6d41\u6c34\u7ebf\u5f0f\u5730\u4ece\u524d\u4e00\u4e2a\u8282\u70b9\u63a5\u6536\u6570\u636e\uff0c\u5e76\u5728\u540c\u65f6\u8f6c\u53d1\u7ed9\u4e0b\u4e00\u4e2a\u8282\u70b9\uff0c\u6570\u636e\u4ee5\u6d41\u6c34\u7ebf\u7684\u65b9\u5f0f\u4ece\u524d\u4e00\u4e2aDatanode\u590d\u5236\u5230\u4e0b\u4e00\u4e2a\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u53ef\u8bbf\u95ee\u6027<\/h2>\n
\n

      HDFS\u7ed9\u5e94\u7528\u63d0\u4f9b\u4e86\u591a\u79cd\u8bbf\u95ee\u65b9\u5f0f\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7Java API<\/a>\u63a5\u53e3\u8bbf\u95ee\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7C\u8bed\u8a00\u7684\u5c01\u88c5API\u8bbf\u95ee\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u7684\u65b9\u5f0f\u8bbf\u95eeHDFS\u4e2d\u7684\u6587\u4ef6\u3002\u901a\u8fc7WebDAV<\/acronym>\u534f\u8bae\u8bbf\u95ee\u7684\u65b9\u5f0f\u6b63\u5728\u5f00\u53d1\u4e2d\u3002<\/p>\n

<\/a><\/a><\/p>\n

DFSShell<\/h3>\n

      HDFS\u4ee5\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5f62\u5f0f\u7ec4\u7ec7\u7528\u6237\u6570\u636e\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u547d\u4ee4\u884c\u7684\u63a5\u53e3(DFSShell)\u8ba9\u7528\u6237\u4e0eHDFS\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u4ea4\u4e92\u3002\u547d\u4ee4\u7684\u8bed\u6cd5\u548c\u7528\u6237\u719f\u6089\u7684\u5176\u4ed6shell(\u4f8b\u5982 bash, csh)\u5de5\u5177\u7c7b\u4f3c\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u52a8\u4f5c\/\u547d\u4ee4\u7684\u793a\u4f8b\uff1a<\/p>\n\n\n\n\n\n\n
\u52a8\u4f5c<\/th>\n\u547d\u4ee4<\/th>\n<\/tr>\n
\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a \/foodir<\/span> \u7684\u76ee\u5f55<\/td>\nbin\/hadoop dfs -mkdir \/foodir<\/span><\/td>\n<\/tr>\n
\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a \/foodir<\/span> \u7684\u76ee\u5f55<\/td>\nbin\/hadoop dfs -mkdir \/foodir<\/span><\/td>\n<\/tr>\n
\u67e5\u770b\u540d\u4e3a \/foodir\/myfile.txt<\/span> \u7684\u6587\u4ef6\u5185\u5bb9<\/td>\nbin\/hadoop dfs -cat \/foodir\/myfile.txt<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

DFSShell \u53ef\u4ee5\u7528\u5728\u90a3\u4e9b\u901a\u8fc7\u811a\u672c\u8bed\u8a00\u548c\u6587\u4ef6\u7cfb\u7edf\u8fdb\u884c\u4ea4\u4e92\u7684\u5e94\u7528\u7a0b\u5e8f\u4e0a\u3002<\/p>\n

<\/a><\/a><\/p>\n

DFSAdmin<\/h3>\n

DFSAdmin \u547d\u4ee4\u7528\u6765\u7ba1\u7406HDFS\u96c6\u7fa4\u3002\u8fd9\u4e9b\u547d\u4ee4\u53ea\u6709HDSF\u7684\u7ba1\u7406\u5458\u624d\u80fd\u4f7f\u7528\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u52a8\u4f5c\/\u547d\u4ee4\u7684\u793a\u4f8b\uff1a<\/p>\n\n\n\n\n\n\n
\u52a8\u4f5c<\/th>\n\u547d\u4ee4<\/th>\n<\/tr>\n
\u5c06\u96c6\u7fa4\u7f6e\u4e8e\u5b89\u5168\u6a21\u5f0f<\/td>\nbin\/hadoop dfsadmin -safemode enter<\/span><\/td>\n<\/tr>\n
\u663e\u793aDatanode\u5217\u8868<\/td>\nbin\/hadoop dfsadmin -report<\/span><\/td>\n<\/tr>\n
\u4f7fDatanode\u8282\u70b9 datanodename<\/span>\u9000\u5f79<\/td>\nbin\/hadoop dfsadmin -decommission datanodename<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/a><\/a><\/p>\n

\u6d4f\u89c8\u5668\u63a5\u53e3<\/h3>\n

      \u4e00\u4e2a\u5178\u578b\u7684HDFS\u5b89\u88c5\u4f1a\u5728\u4e00\u4e2a\u53ef\u914d\u7f6e\u7684TCP\u7aef\u53e3\u5f00\u542f\u4e00\u4e2aWeb\u670d\u52a1\u5668\u7528\u4e8e\u66b4\u9732HDFS\u7684\u540d\u5b57\u7a7a\u95f4\u3002\u7528\u6237\u53ef\u4ee5\u7528\u6d4f\u89c8\u5668\u6765\u6d4f\u89c8HDFS\u7684\u540d\u5b57\u7a7a\u95f4\u548c\u67e5\u770b\u6587\u4ef6\u7684\u5185\u5bb9\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u5b58\u50a8\u7a7a\u95f4\u56de\u6536<\/h2>\n
<\/a><\/a><\/p>\n

\u6587\u4ef6\u7684\u5220\u9664\u548c\u6062\u590d<\/h3>\n

      \u5f53\u7528\u6237\u6216\u5e94\u7528\u7a0b\u5e8f\u5220\u9664\u67d0\u4e2a\u6587\u4ef6\u65f6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u5e76\u6ca1\u6709\u7acb\u523b\u4eceHDFS\u4e2d\u5220\u9664\u3002\u5b9e\u9645\u4e0a\uff0cHDFS\u4f1a\u5c06\u8fd9\u4e2a\u6587\u4ef6\u91cd\u547d\u540d\u8f6c\u79fb\u5230\/trash<\/span>\u76ee\u5f55\u3002\u53ea\u8981\u6587\u4ef6\u8fd8\u5728\/trash<\/span>\u76ee\u5f55\u4e2d\uff0c\u8be5\u6587\u4ef6\u5c31\u53ef\u4ee5\u88ab\u8fc5\u901f\u5730\u6062\u590d\u3002\u6587\u4ef6\u5728\/trash<\/span>\u4e2d\u4fdd\u5b58\u7684\u65f6\u95f4\u662f\u53ef\u914d\u7f6e\u7684\uff0c\u5f53\u8d85\u8fc7\u8fd9\u4e2a\u65f6\u95f4\u65f6\uff0cNamenode\u5c31\u4f1a\u5c06\u8be5\u6587\u4ef6\u4ece\u540d\u5b57\u7a7a\u95f4\u4e2d\u5220\u9664\u3002\u5220\u9664\u6587\u4ef6\u4f1a\u4f7f\u5f97\u8be5\u6587\u4ef6\u76f8\u5173\u7684\u6570\u636e\u5757\u88ab\u91ca\u653e\u3002\u6ce8\u610f\uff0c\u4ece\u7528\u6237\u5220\u9664\u6587\u4ef6\u5230HDFS\u7a7a\u95f2\u7a7a\u95f4\u7684\u589e\u52a0\u4e4b\u95f4\u4f1a\u6709\u4e00\u5b9a\u65f6\u95f4\u7684\u5ef6\u8fdf\u3002<\/p>\n

      \u53ea\u8981\u88ab\u5220\u9664\u7684\u6587\u4ef6\u8fd8\u5728\/trash<\/span>\u76ee\u5f55\u4e2d\uff0c\u7528\u6237\u5c31\u53ef\u4ee5\u6062\u590d\u8fd9\u4e2a\u6587\u4ef6\u3002\u5982\u679c\u7528\u6237\u60f3\u6062\u590d\u88ab\u5220\u9664\u7684\u6587\u4ef6\uff0c\u4ed6\/\u5979\u53ef\u4ee5\u6d4f\u89c8\/trash<\/span>\u76ee\u5f55\u627e\u56de\u8be5\u6587\u4ef6\u3002\/trash<\/span>\u76ee\u5f55\u4ec5\u4ec5\u4fdd\u5b58\u88ab\u5220\u9664\u6587\u4ef6\u7684\u6700\u540e\u526f\u672c\u3002\/trash<\/span>\u76ee\u5f55\u4e0e\u5176\u4ed6\u7684\u76ee\u5f55\u6ca1\u6709\u4ec0\u4e48\u533a\u522b\uff0c\u9664\u4e86\u4e00\u70b9\uff1a\u5728\u8be5\u76ee\u5f55\u4e0aHDFS\u4f1a\u5e94\u7528\u4e00\u4e2a\u7279\u6b8a\u7b56\u7565\u6765\u81ea\u52a8\u5220\u9664\u6587\u4ef6\u3002\u76ee\u524d\u7684\u9ed8\u8ba4\u7b56\u7565\u662f\u5220\u9664\/trash<\/span>\u4e2d\u4fdd\u7559\u65f6\u95f4\u8d85\u8fc76\u5c0f\u65f6\u7684\u6587\u4ef6\u3002\u5c06\u6765\uff0c\u8fd9\u4e2a\u7b56\u7565\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2a\u88ab\u826f\u597d\u5b9a\u4e49\u7684\u63a5\u53e3\u914d\u7f6e\u3002<\/p>\n

<\/a><\/a><\/p>\n

\u51cf\u5c11\u526f\u672c\u7cfb\u6570<\/h3>\n

       \u5f53\u4e00\u4e2a\u6587\u4ef6\u7684\u526f\u672c\u7cfb\u6570\u88ab\u51cf\u5c0f\u540e\uff0cNamenode\u4f1a\u9009\u62e9\u8fc7\u5269\u7684\u526f\u672c\u5220\u9664\u3002\u4e0b\u6b21\u5fc3\u8df3\u68c0\u6d4b\u65f6\u4f1a\u5c06\u8be5\u4fe1\u606f\u4f20\u9012\u7ed9Datanode\u3002Datanode\u9042\u5373\u79fb\u9664\u76f8\u5e94\u7684\u6570\u636e\u5757\uff0c\u96c6\u7fa4\u4e2d\u7684\u7a7a\u95f2\u7a7a\u95f4\u52a0\u5927\u3002\u540c\u6837\uff0c\u5728\u8c03\u7528setReplication<\/span> API\u7ed3\u675f\u548c\u96c6\u7fa4\u4e2d\u7a7a\u95f2\u7a7a\u95f4\u589e\u52a0\u95f4\u4f1a\u6709\u4e00\u5b9a\u7684\u5ef6\u8fdf\u3002<\/p>\n<\/div>\n

<\/a><\/a><\/p>\n

\u53c2\u8003\u8d44\u6599<\/h2>\n
\n

HDFS Java API: http:\/\/hadoop.apache.org\/core\/docs\/current\/api\/ <\/a><\/p>\n

HDFS \u6e90\u4ee3\u7801: http:\/\/hadoop.apache.org\/core\/version_control.html <\/a><\/p>\n

\u539f\u6587\u5f15\u7528\uff1ahttp:\/\/hadoop.apache.org\/common\/docs\/r0.17.2\/cn\/hdfs_design.html<\/a><\/p>\n<\/div>\n

by Dhruba Borthakur<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"

\u5f15\u8a00<\/h2>\n
\n

        Hadoop\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf(HDFS<\/acronym>)\u88ab\u8bbe\u8ba1\u6210\u9002\u5408\u8fd0\u884c\u5728\u901a\u7528\u786c\u4ef6(commodity hardware)\u4e0a\u7684\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\u3002\u5b83\u548c\u73b0\u6709\u7684\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\u6709\u5f88\u591a\u5171\u540c\u70b9\u3002\u4f46\u540c\u65f6\uff0c\u5b83\u548c\u5176\u4ed6\u7684\u5206\u5e03\u5f0f\u6587\u4ef6\u7cfb\u7edf\u7684\u533a\u522b\u4e5f\u662f\u5f88\u660e\u663e\u7684\u3002HDFS\u662f\u4e00\u4e2a\u9ad8\u5ea6\u5bb9\u9519\u6027\u7684\u7cfb\u7edf\uff0c\u9002\u5408\u90e8\u7f72\u5728\u5ec9\u4ef7\u7684\u673a\u5668\u4e0a\u3002HDFS\u80fd\u63d0\u4f9b\u9ad8\u541e\u5410\u91cf\u7684\u6570\u636e\u8bbf\u95ee\uff0c\u975e\u5e38\u9002\u5408\u5927\u89c4\u6a21\u6570\u636e\u96c6\u4e0a\u7684\u5e94\u7528\u3002HDFS\u653e\u5bbd\u4e86\u4e00\u90e8\u5206POSIX\u7ea6\u675f\uff0c\u6765\u5b9e\u73b0\u6d41\u5f0f\u8bfb\u53d6\u6587\u4ef6\u7cfb\u7edf\u6570\u636e<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1058"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1058"}],"version-history":[{"count":0,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1058\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}