您好,登錄后才能下訂單哦!
本篇內容主要講解“hadoop從集群中怎么移除一個節點”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“hadoop從集群中怎么移除一個節點”吧!
1.首先檢查整個集群的Average block replication,如果大于2,那即使直接拔出一個節點也不會丟失數據
hadoop fsck / 檢查集群的文件系統狀況
可以手動設置文件的冗余倍數,為了安全備份,可對關鍵數據hadoop fs -setrep -w 3 -R <path>
2.給下面兩個文件增加配置,在excludes中填寫要解任的節點名
mapred-site.xml
<property>
<name>mapred.hosts</name>
<value></value>
<description>Names a file that contains the list of nodes that may
connect to the jobtracker. If the value is empty, all hosts are
permitted.</description>
</property>
<property>
<name>mapred.hosts.exclude</name>
<value>HADOOP_HOME/conf/excludes</value>
<description>Names a file that contains the list of hosts that
should be excluded by the jobtracker. If the value is empty, no
hosts are excluded.</description>
</property>
hdfs-site.xml
<property>
<name>dfs.hosts</name>
<value></value>
<description>Names a file that contains a list of hosts that are
permitted to connect to the namenode. The full pathname of the file
must be specified. If the value is empty, all hosts are
permitted.</description>
</property>
<property>
<name>dfs.hosts.exclude</name>
<value>HADOOP_HOME/conf/excludes</value>
<description>Names a file that contains a list of hosts that are
not permitted to connect to the namenode. The full pathname of the
file must be specified. If the value is empty, no hosts are
excluded.</description>
</property>
excludes 文件里面配置機器的hostname即可。
run on namenode: hadoop dfsadmin -refreshNodes
run on jobtracker: hadoop mradmin -refreshNodes
“hadoop dfsadmin -refreshNodes”會觸發Decommission過程,在Decommission過程,集群會將Decommission節點上的數據冗余到其他幾點上,
到此,相信大家對“hadoop從集群中怎么移除一個節點”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。