18.1 集群介绍 18.2 keepalived介绍 18.3/18.4/18.5 用keepalived配置高可用集群
在两台机器上执行yum install -y keepalived
128机器之前已经安装了nginx,所以只要在129机器上安装nginx yum install -y nginx
[root@lizhipenglinux01 ~]# ls /etc/keepalived/keepalived.conf
/etc/keepalived/keepalived.conf
[root@lizhipenglinux01 ~]# cat !$
把原始的文件清空掉
[root@lizhipenglinux01 ~]# > /etc/keepalived/keepalived.conf
nginx与keepalived都没有问题
nginx服务停止后,自动启动了
/var/log/messages 存放keepalived日志
检查防火墙
检查从,发现有防火墙,systemctl stop firewalld
关闭主上的keepalived,发现主上192.168.5.100没有了,而从上有192.168.5.100
访问192.168.5.100,是从的默认页面
再开启主的keepalived服务,主上有192.168.5.100,而从上没有了
访问192.168.5.100,主的默认页面