克隆一台机器s105来专门存放SecondaryNameNode
1、克隆s100 -> s105
2、打开s105,修改hostname和静态ip
hostname // /etc/hostname
静态ip // /etc/sysconfig/network-scripts/ifcfg-ens33
3、重启虚拟机,通过putty进行连接
3.5、修改s101的hosts文件,添加
192.168.116.105 s105
并配置ssh免密登陆
ssh-copy-id centos@s105
4、配置root的ssh免密登陆
1)切换到root
su root
2)生成公私密钥对
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
3)配置免密登陆
ssh-copy-id root@s101
ssh-copy-id root@s102
ssh-copy-id root@s103
ssh-copy-id root@s104
ssh-copy-id root@s105
5、使用root权限在所有机器上安装rsync
xcall.sh yum install -y rsync
6、修改配置文件/soft/hadoop/etc/hadoop/hdfs-site.xml
添加配置
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>s105:50090</value>
</property>
7、删除其他节点的所有etc文件夹
ssh s102 rm -rf /soft/hadoop/etc
ssh s103 rm -rf /soft/hadoop/etc
ssh s104 rm -rf /soft/hadoop/etc
ssh s105 rm -rf /soft/hadoop/etc
8、编写xsync脚本,使用此脚本将所有配置文件进行同步
xsync.sh /soft/hadoop/etc
9. /etc/hosts
同步到s101- s105
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.116.101 s101
192.168.116.102 s102
192.168.116.103 s103
192.168.116.104 s104
192.168.116.105 s105
192.168.116.101 s101
192.168.116.102 s102
192.168.116.103 s103
192.168.116.104 s104
192.168.116.105 s105