配置keepalived
安装
[root@apache ~]# yum install haproxy -y
修改配置文件
[root@apache ~]# vim /etc/keepalived/keepalived.conf ! Configuration File for keepalived global_defs { notification_email { [email protected] [email protected] [email protected] } notification_email_from [email protected] smtp_server 192.168.200.1 smtp_connect_timeout 30 router_id LVS_DEVEL vrrp_skip_check_adv_addr vrrp_strict vrrp_garp_interval 0 vrrp_gna_interval 0 } vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 1 priority 100 advert_int 1 unicast_src_ip 10.0.0.30 unicast_peer { 10.0.0.20 } authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 10.0.0.99/24 dev eth0 label eth0:111 } }
第二台启动
[root@mysql nginx]# cat /etc/keepalived/keepalived.conf vr