简体   繁体   English

向现有的Hadoop集群添加新的数据节点

[英]Adding New Datanodes to An Existing Hadoop Cluster

How should I add a new datanode to an existing hadoop cluster? 如何将新的datanode添加到现有的hadoop集群?

Do I just stop all, set up a new datanode server as existing datanodes, and add the new server IP to the namenode and change the number of slaves to a correct number? 我是否仅需停止所有操作,将新的datanode服务器设置为现有的datanode,然后将新的服务器IP添加到namenode并将从站的数量更改为正确的数量?

Another question is: After I add a new datanode to the cluster, do I need to do anything to balance all datanodes or "re-distribute" the existing files and directories to different datanodes? 另一个问题是:将新的数据节点添加到集群后,是否需要做任何事情来平衡所有数据节点或将现有文件和目录“重新分配”到其他数据节点?

For the Apache Hadoop you can select one of two options: 对于Apache Hadoop,您可以选择以下两个选项之一:

1.- Prepare the datanode configuration, (JDK, binaries, HADOOP_HOME env var, xml config files to point to the master, adding IP in the slaves file in the master, etc) and execute the following command inside this new slave: 1.-准备数据节点配置(JDK,二进制文件,HADOOP_HOME env var,xml配置文件以指向主节点,在主节点的从属文件中添加IP等),然后在新的从属节点中执行以下命令:

hadoop-daemon.sh start datanode

2.- Prepare the datanode just like the step 1 and restart the entire cluster. 2.-像步骤1一样准备datanode并重新启动整个集群。

3.- To redistribute the existing data you need to enable dfs.disk.balancer.enabled in hdfs-site.xml. 3.-要重新分发现有数据,您需要在hdfs-site.xml中启用dfs.disk.balancer.enabled。 This enable the HDFS Disk Balancer and you need to configure a plan. 这将启用HDFS磁盘平衡器,并且您需要配置计划。

You don't need to stop anything to add datanodes, and datanodes should register themselves to the Namenode on their own; 您无需停止任何操作即可添加数据节点,数据节点应自行将其注册到Namenode; I don't recall manually adding any information or needing to restart a namenode to detect datanodes (I typically use Ambari to provision new machines) 我不记得手动添加任何信息或需要重新启动名称节点以检测数据节点(我通常使用Ambari来配置新计算机)

You will need to manually run the HDFS balancer in order to spread the data over to the new servers 您将需要手动运行HDFS平衡器,以便将数据分散到新服务器上

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM