{"id":9010,"date":"2023-10-18T14:05:22","date_gmt":"2023-10-18T06:05:22","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=9010"},"modified":"2024-11-06T18:43:06","modified_gmt":"2024-11-06T10:43:06","slug":"%e3%80%90tdh%e8%bf%90%e7%bb%b4%e5%bf%85%e5%a4%87%e6%8a%80%e8%83%bd%e3%80%91datanode%e8%8a%82%e7%82%b9%e5%86%85%e7%a3%81%e7%9b%98%e5%86%99%e5%85%a5%e7%ad%96%e7%95%a5%e4%bf%ae%e6%94%b9","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=9010","title":{"rendered":"\u3010TDH\u8fd0\u7ef4\u5fc5\u5907\u6280\u80fd\u3011DataNode\u8282\u70b9\u5185\u78c1\u76d8\u5199\u5165\u7b56\u7565\u4fee\u6539"},"content":{"rendered":"<h3>\u95ee\u9898\u63cf\u8ff0<\/h3>\n<p>\u5355\u4e2a\u8282\u70b9\u5185DataNode\u7684\u5404\u78c1\u76d8\u4f7f\u7528\u7387\u4e0d\u5747\u5300\uff0c\u6709\u4e9b\u78c1\u76d8\u5feb\u6ee1\u4e86\u6709\u4e9b\u51e0\u4e4e\u6ca1\u7528<br \/>\n\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-shell\"><span style=\"color:#333333\">189-39-235-71:~ # df -h\nFilesystem  Size  Used Avail Use% Mounted on\n\/dev\/xvda  360G  92G   250G  28% \/\n\/dev\/xvdb  700G  900G   200G  78% \/srv\/BigData\/hadoop\/data1\n\/dev\/xvdc  700G  900G   200G  78% \/srv\/BigData\/hadoop\/data2\n\/dev\/xvdd  700G  900G   200G  78% \/srv\/BigData\/hadoop\/data3\n\/dev\/xvde  700G  900G   200G  78% \/srv\/BigData\/hadoop\/data4\n\/dev\/xvdf  10G   900G   890G  2% \/srv\/BigData\/hadoop\/data5\n189-39-235-71:~ #  <\/span><\/code><\/pre>\n<p>\u53ef\u80fd\u539f\u56e0<\/p>\n<p>1\uff0c \u90e8\u5206\u78c1\u76d8\u6545\u969c\uff0c\u66f4\u6362\u4e3a\u65b0\u76d8\uff0c\u56e0\u6b64\u65b0\u76d8\u4f7f\u7528\u7387\u4f4e\u3002<\/p>\n<p>2\uff0c \u589e\u52a0\u4e86\u78c1\u76d8\u4e2a\u6570\uff0c\u5982\u539f\u51484\u4e2a\u6570\u636e\u76d8\uff0c\u73b0\u6269\u5bb9\u4e3a5\u4e2a\u76d8\u3002<\/p>\n<p><font color=red>\u6ce8\u610f\uff1a\u5bf9\u4e8eTDH 9.0 \u4ea7\u54c1\uff0chadoop \u5df2\u7ecf\u5347\u7ea7\u52303.X \u53ef\u4ee5\u5229\u7528hdfs diskbalancer \u6765\u8fdb\u884c\u78c1\u76d8\u95f4\u6570\u636e\u5747\u8861<\/font><\/p>\n<h3>\u539f\u56e0\u5206\u6790<\/h3>\n<p>DataNode\u8282\u70b9\u5185\u5199block\u78c1\u76d8\u65f6\uff0c\u67092\u79cd\u7b56\u7565\u201c\u8f6e\u8be2\u201d\u548c\u201c\u4f18\u5148\u5199\u5269\u4f59\u78c1\u76d8\u7a7a\u95f4\u591a\u7684\u78c1\u76d8\u201d\uff0c\u9ed8\u8ba4\u662f\u201c\u8f6e\u8be2\u201d\u3002<\/p>\n<p>\u53c2\u6570\u8bf4\u660e\uff1adfs.datanode.fsdataset.volume.choosing.policy<\/p>\n<p>\u53ef\u9009\u503c\uff1a<\/p>\n<p>\u8f6e\u8be2\uff1aorg.apache.hadoop.hdfs.server.datanode.fsdataset.RoundRobinVolumeChoosingPolicy<br \/>\n\u4f18\u5148\u5199\u5269\u4f59\u7a7a\u95f4\u591a\u7684\u78c1\u76d8\uff1a org.apache.hadoop.hdfs.server.datanode.fsdataset.AvailableSpaceVolumeChoosingPolicy<\/p>\n<h3>\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<p>\u5c06DataNode\u9009\u62e9\u78c1\u76d8\u7b56\u7565\u7684\u53c2\u6570 dfs.datanode.fsdataset.volume.choosing.policy \u7684\u503c\u6539\u4e3a<\/p>\n<p>org.apache.hadoop.hdfs.server.datanode.fsdataset.AvailableSpaceVolumeChoosingPolicy<\/p>\n<p>\u8ba9DataNode\u6839\u636e\u78c1\u76d8\u5269\u4f59\u7a7a\u95f4\u5927\u5c0f\uff0c\u4f18\u5148\u9009\u62e9\u78c1\u76d8\u5269\u4f59\u7a7a\u95f4\u591a\u7684\u8282\u70b9\u5b58\u50a8\u6570\u636e\u526f\u672c<\/p>\n<p>\u5728TDH\u96c6\u7fa4\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a03\u4e2a\u53c2\u6570\u8bbe\u7f6e\u8c03\u6574\u4e3a\u4f18\u5148\u5f80\u7a7a\u95f2\u78c1\u76d8\u5199\u6570\u636e\uff0c\u914d\u7f6e\u65b9\u6cd5\u5982\u4e0b\uff08\u6ce8\u610f\u683c\u5f0f\uff09\uff1a<br \/>\na) \u5728hdfs\u9875\u9762\u6dfb\u52a0\u4e0b\u97623\u4e2a\u81ea\u5b9a\u4e49\u53c2\u6570<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2022\/11\/image-1669275399794.png\" alt=\"file\" \/><\/p>\n<p>b) \u914d\u7f6e\u670d\u52a1\uff0c\u5e76\u91cd\u542fhdfs\u670d\u52a1<\/p>\n<p>\u6ce8\uff1a\u5173\u4e8e\u4e0a\u8ff03\u4e2a\u53c2\u6570\u7684\u89e3\u91ca\uff1a<\/p>\n<pre><code>    dfs.datanode.fsdataset.volume.choosing.policy  \n       --\u8be5\u53c2\u6570\u914d\u7f6e\u6210AvailableSpaceVolumeChoosingPolicy\uff0cDataNode\u5728\u9009\u62e9\u78c1\u76d8\u5b58\u50a8\u6570\u636e\u65f6\uff0c\u4f1a\u9009\u62e9\u53ef\u7528\u78c1\u76d8\u7a7a\u95f4\u6700\u5927\u7684\u78c1\u76d8\u6765\u5b58\u50a8\u6570\u636e\uff0c\u8fd9\u6837\u4fdd\u8bc1\u4e86\u5c0f\u76d8\u4e0d\u4f1a\u5b58\u50a8\u8fc7\u591a\u7684\u6570\n\n    dfs.datanode.available-space-volume-choosing-policy.balanced-space-threshold\n       --\u8be5\u53c2\u6570\u914d\u7f6e\u662f\u9996\u5148\u8ba1\u7b97\u51fa\u4e24\u4e2a\u503c\uff0c\u4e00\u4e2a\u662f\u6240\u6709\u78c1\u76d8\u4e2d\u6700\u5927\u53ef\u7528\u7a7a\u95f4\uff0c\u53e6\u5916\u4e00\u4e2a\u503c\u662f\u6240\u6709\u78c1\u76d8\u4e2d\u6700\u5c0f\u53ef\u7528\u7a7a\u95f4\uff0c\u5982\u679c\u8fd9\u4e24\u4e2a\u503c\u76f8\u5dee\u5c0f\u4e8e\u8be5\u914d\u7f6e\u9879\u6307\u5b9a\u7684\u9600\u503c\u65f6\uff0c\u5219\u5c31\u7528\u8f6e\u8be2\u65b9\u5f0f\u7684\u78c1\u76d8\u9009\u62e9\u7b56\u7565\u9009\u62e9\u78c1\u76d8\u5b58\u50a8\u6570\u636e\u526f\u672c\n    dfs.datanode.available-space-volume-choosing-policy.balanced-space-preference-fraction\n       --\u8be5\u53c2\u6570\u914d\u7f6e\u662f\u6307\u6709\u591a\u5c11\u6bd4\u4f8b\u7684\u6570\u636e\u526f\u672c\u5e94\u8be5\u5b58\u50a8\u5230\u5269\u4f59\u7a7a\u95f4\u8db3\u591f\u591a\u7684\u78c1\u76d8\u4e0a\u3002\u8be5\u914d\u7f6e\u9879\u53d6\u503c\u8303\u56f4\u662f0.0-1.0\uff0c\u4e00\u822c\u53d60.5-1.0\uff0c\u5982\u679c\u914d\u7f6e\u592a\u5c0f\uff0c\u4f1a\u5bfc\u81f4\u5269\u4f59\u7a7a\u95f4\u8db3\u591f\u7684\u78c1\u76d8\u5b9e\u9645\u4e0a\u6ca1\u5206\u914d\u8db3\u591f\u7684\u6570\u636e\u526f\u672c\uff0c\u800c\u5269\u4f59\u7a7a\u95f4\u4e0d\u8db3\u7684\u78c1\u76d8\u53d6\u9700\u8981\u5b58\u50a8\u66f4\u591a\u7684\u6570\u636e\u526f\u672c\uff0c\u5bfc\u81f4\u78c1\u76d8\u6570\u636e\u5b58\u50a8\u4e0d\u5747\u8861\n       --\u914d\u7f6e\u62101.0f\u7684\u8bdd\u4f1a\u4f18\u5148\u6309\u7167\u78c1\u76d8\u5269\u4f59\u7a7a\u95f4\u5927\u5c0f\uff0c\u9009\u62e9\u7a7a\u4f59\u6700\u591a\u7684\u78c1\u76d8\uff0c\u5c06\u6570\u636e\u5168\u90e8\u5199\u5230\u8be5\u76d8\u4e0a\u9762<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u63cf\u8ff0 \u5355\u4e2a\u8282\u70b9\u5185DataNode\u7684\u5404\u78c1\u76d8\u4f7f\u7528\u7387\u4e0d\u5747\u5300\uff0c\u6709\u4e9b\u78c1\u76d8\u5feb\u6ee1\u4e86\u6709\u4e9b\u51e0\u4e4e\u6ca1\u7528 \u4f8b\u5982\uff1a 189-39-2 ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=9010\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[240,121],"tags":[],"class_list":["post-9010","post","type-post","status-publish","format-standard","hentry","category-operation","category-121"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/9010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9010"}],"version-history":[{"count":2,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/9010\/revisions"}],"predecessor-version":[{"id":14619,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/9010\/revisions\/14619"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}