步骤如下:
1.copy 另外一台的datanode的配置到该datanode上,配置好jdk,ssh.
验证ssh:在namenode 上ssh 即可:
The authenticity of host '[hadoop-datanode-8096]:16322 ([172.16.80.96]:16322)' can't be established.
RSA key fingerprint is b2:4f:67:69:d5:c6:4f:b5:0a:4d:28:61:b2:c4:11:70.
Are you sure you want to continue connecting (yes/no)? yes
2.将新的datanode的host加到集群namenode 和 别的 datanode /etc/hosts中,后续节点间通信需要。
3.将新的datanode的hostname加到namenode的conf/slaves中。
4.namenode 的 dfs.hosts 配置中加上新的datanode
5.在namenode 的 mapred.hosts 配置中加上新的datanode
6.加入集群的关键一步:
在namenode 上执行 stop-all.sh && start-all.sh
或者是在datanode 上执行
./hadoop-daemon.sh start datanode
然后看输入日志即可。
7.运行balancer.sh
备注:关于balance的资料:
在线上的hadoop集群运维过程中,hadoop 的balance工具通常用于平衡hadoop集群中各datanode中的文件块分布,以避免出现部分datanode磁盘占用率高的问题(这问题也很有可能导致该节点CPU使用率较其他服务器高)。
1) hadoop balance工具的用法:
[html] view plaincopy
To start:
bin/start-balancer.sh [-threshold ]
Example: bin/ start-balancer.sh
start the balancer with a default threshold of 10%
bin/ start-balancer.sh -threshold 5
start the balancer with a threshold of 5%
To stop:
bin/ stop-balancer.sh
2)影响hadoop balance工具的几个参数:
-threshold 默认设置:10,参数取值范围:0-100,参数含义:判断集群是否平衡的目标参数,每一个 datanode 存储使用率和集群总存储使用率的差值都应该小于这个阀值 ,理论上,该参数设置的越小,整个集群就越平衡,但是在线上环境中,hadoop集群在进行balance时,还在并发的进行数据的写入和删除,所以有可能无法到达设定的平衡参数值。
dfs.balance.bandwidthPerSec 默认设置:1048576(1 M/S),参数含义:设置balance工具在运行中所能占用的带宽,设置的过大可能会造成mapred运行缓慢
3)hadoop balance工具其他特点:
balance工具在运行过程中,迭代的将文件块从高使用率的datanode移动到低使用率的datanode上,每一个迭代过程中移动的数据量不超过下面两个值的较小者:10G或者指定阀值*容量,且每次迭代不超过20分钟。每次迭代结束后,balance工具将更新该datanode的文件块分布情况。以下为官方文档英文描述:
[python] view plaincopy
The tool moves blocks from highly utilized datanodes to poorly utilized datanodes
iteratively. In each iteration a datanode moves or receives no more than the lesser of 10G
bytes or the threshold fraction of its capacity. Each iteration runs no more than 20
minutes. At the end of each iteration, the balancer obtains updated datanodes information
from the namenode.
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com