微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

hadoop从集群中怎么移除一个节点

本篇内容主要讲解“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从集群中怎么移除一个节点”有了更深的了解,不妨来实际操作一番吧!这里是编程之家网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐