千家信息网

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

发表于:2025-02-03 作者:千家信息网编辑
千家信息网最后更新 2025年02月03日,本篇内容主要讲解"hadoop从集群中怎么移除一个节点",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"hadoop从集群中怎么移除一个节点"吧!1.首先检查
千家信息网最后更新 2025年02月03日hadoop从集群中怎么移除一个节点

本篇内容主要讲解"hadoop从集群中怎么移除一个节点",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"hadoop从集群中怎么移除一个节点"吧!

1.首先检查整个集群的Average block replication,如果大于2,那即使直接拔出一个节点也不会丢失数据

hadoop fsck / 检查集群的文件系统状况

可以手动设置文件的冗余倍数,为了安全备份,可对关键数据hadoop fs -setrep -w 3 -R

2.给下面两个文件增加配置,在excludes中填写要解任的节点名

mapred-site.xml

mapred.hosts

Names a file that contains the list of nodes that may

connect to the jobtracker. If the value is empty, all hosts are

permitted.

mapred.hosts.exclude

HADOOP_HOME/conf/excludes

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.

hdfs-site.xml

dfs.hosts

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.

dfs.hosts.exclude

HADOOP_HOME/conf/excludes

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.

excludes 文件里面配置机器的hostname即可。

run on namenode: hadoop dfsadmin -refreshNodes

run on jobtracker: hadoop mradmin -refreshNodes

"hadoop dfsadmin -refreshNodes"会触发Decommission过程,在Decommission过程,集群会将Decommission节点上的数据冗余到其他几点上,

到此,相信大家对"hadoop从集群中怎么移除一个节点"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

0