keepalived+nginx配置
1.yum -y install keepalived 2.vi /etc/keepalived/keepalived.conf vrrp_instance VI_1 { state MASTER #从为BACKUP interface eth0 virtual_router_id 51 priority 100 #MASTER 优先级高 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.2.199 #VIP } } 3.service keepalived start 4.ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo