假设添加的节点主机名为slave03
1.在各个节点上修改hosts文件添加islave03(确定防火墙已经关闭)
2.配置namenode节点和resourcemanager节点到slave03的免登录
3.拷贝slave02(datanode节点)所有的hadoop文件到slave03上
4.在/hadoop/zookeeper-3.4.5/conf/zoo.cfg 添加(server.3表示之前已经存在2个datanode节点)
server.3=slave03:2888:38885.修改/hadoop/zookeeper-3.4.5/tmp/myid 的内容为3(这是我们之前创建的文件表示journalnode的id标识)
6.在slave03上启动zookeeper
cd /hadoop/zookeeper-3.4.5/bin/ ./zkServer.sh start
7.在slave03启动journalnode
cd /hadoop/hadoop-2.7.0 sbin/hadoop-daemon.sh start journalnode
sbin/hadoop-daemon.sh start datanode
sbin/yarn-daemon.sh start nodemanager
(在namenode上hdfs dfsadmin -report 查看datanode)
(在resourcemanage上yarn node -list 查看nodemanager)
[root@slave03 hadoop-2.7.0]# jps 1904 NodeManager 1411 QuorumPeerMain 1496 JournalNode 2010 Jps 1583 DataNode
sbin/start-balancer.sh -threshold 5