在master上更改权限在搭建hadoop集群时,需要机器相互可以免密码ssh,操作如下(四台机器都要操作):
ssh-keygen -t rsa
讲产生的公钥复制到master机器上并重命名,以hadoop1为例子:
scp ~/.ssh/id_rsa.pub root@host:~/id_rsa.pub.1
讲所有的迷药追加到authorized_keys中:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/id_rsa.pub.1 >> ~/.ssh/authorized_keys
cat ~/id_rsa.pub.2 >> ~/.ssh/authorized_keys
cat ~/id_rsa.pub.3 >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys