标签:outer doc AC tar pre moni clu tor keepalive
apt-cache search keepalived keepalived - Failover and monitoring daemon for LVS clusters apt-get install keepalived
安装完成,会生成/etc/keepalived/
目录,该目录是keepalived的配置文件目录。
ifconfig 查看网卡名称和ip
vim /etc/keepalived/keepalived.conf
vrrp_instance VI_1 { state MASTER interface ens33 #ifconfig确定 virtual_router_id 51 #路由器标识,MASTER和BACKUP必须是一致的 priority 100 #定义优先级,数字越大,优先级越高,在同一个vrrp_instance下,MASTER的优先级必须大于BACKUP的优先级。这样MASTER故障恢复后,就可以将VIP资源再次抢回来 advert_int 1 authentication { auth_type PASS auth_pass 123456 } virtual_ipaddress { 192.168.11.25 # 虚拟ip } }
需要配置的项为:state
,interface
,priority
,virtual_ipaddress
/etc/init.d/keepalived status # 查看状态 /etc/init.d/keepalived stop # 停止 /etc/init.d/keepalived start # 启动
首先ps -ef|grep keep
查看进程是否存在;
其次ip addr
查看ip信息是否创建成功,ping虚拟ip是否相通。
标签:outer doc AC tar pre moni clu tor keepalive
原文地址:https://www.cnblogs.com/UUUP/p/9235267.html