Linux 两台服务器等效性设置

1.修改两台服务器的/etc/hosts配置文件
(1)A(master)服务器/etc/hosts配置文件
192.168.1.11(B(oplog)服务器的ip地址) hostname
(2)B(oplog)服务器/etc/hosts配置文件
192.168.1.10(A(master)服务器的ip地址) hostname


2.在A(master)服务器上运行
ssh-keygen -t rsa
ssh-keygen -t dsa




3.在B(oplog)服务器上运行
ssh-keygen -t rsa
ssh-keygen -t dsa


4.在A(master)服务器上运行
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys


ssh B(oplog服务器的hostname) cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh B(oplog服务器的hostname) cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys B(oplog服务器的hostname):~/.ssh/authorized_keys

你可能感兴趣的:(Linux 两台服务器等效性设置)