基本配置:
1.关闭防火墙
/etc/init.d/iptables stop //关闭防火墙
chkconfig iptables off //设置开机不自启
2.关闭selinux
vi /etc/selinux/config
将 SELINUX=enforcing 改为 SELINUX=disabled
3.设置每个节点的主机名
vi /etc/sysconfig/network
HOSTNAME=node02
4.配置hosts文件(主机名与IP的对应关系)
vi /etc/hosts
192.168.100.131 node01
192.168.100.132 node02
192.168.100.133 node03
5.多节点同步
scp /etc/hosts node02:/etc/
scp /etc/hosts root@node02:/etc/
6.设置节点间的无密码访问
1.在node01节点生成公钥和私钥
ssh-keygen + 4个回车
2.免密登录node01 ssh-copy-id node01 + node01的密码
免密登录node02 ssh-copy-id node02 + node02的密码
免密登录node03 ssh-copy-id node03 + node01的密码
id_rsa 私钥
id_rsa.pub 公钥
authorized_keys 哪些公钥可以进入本机