1.架构准备
系统是centos7-1511,实验需要准备4台主机,虚拟机也行,架构如下:
2 .系统环境配置
@H_502_9@ha1:192.168.0.11
@H_502_9@ha2:192.168.0.12
@H_502_9@以下的安装配置分别在这2台机器上进行。
systemctl disable firewalld systemctl stop firewalld iptables –F
@H_502_9@也可使用命令:
@H_502_9@
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
@H_502_9@
2.2台主机分别修改hostname为ha1和ha2
@H_502_9@
hostnamectl --static --transient set-hostname ha1 hostnamectl --static --transient set-hostname ha2
vim /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.11 ha1 192.168.0.12 ha2
4.同步时间
yum install ntp -y ntpdate cn.pool.ntp.org
5.双机互信
ha1: ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' scp /root/.ssh/id_rsa.pub root@ha2:/root/.ssh/authorized_keys ha2: ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' scp /root/.ssh/id_rsa.pub root@ha1:/root/.ssh/authorized_keys