安裝了三個節點,master,slave1,slave2
1.主節點免密匙登錄從節點
主機點窗口輸入 ssh-keygen -t rsa 一路回車下去
2.而後輸入
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysssh
chmod 600 ~/.ssh/authorized_keys
3.而後將authorized_keys發送到從節點slave1,slave2
scp authorized_keys zkpk@slave1:~
scp authorized_keys zkpk@slave2:~
4.從節點生成密匙按照第一個步驟
5.將authorized_keys移動到 .ssh目錄下
修改權限
chmod 600 ~/.ssh/authorized_keys ide
6.從節點登錄主節點,以及從節點之間互相登錄
cd .ssh code
ssh-copy-id -i id_rsa.pub zkpk@master; 輸入此命令便可