Low network overhead: VRRP only defines one type of packet-VRRP announcement packet, and only a vro in the Master state can send VRRP packets.
The LAMP platform has been built .. For more information, see the previous article. Yum is easy to build and mainly wants to demonstrate keepalived.
Master server 192.168.1.111 eth0
Backup server 192.168.1.10 eth0
Vip 192. 168.1.222
Yum-y install gcc *
Yum install-y openssl-devel poptpopt-devel libnl-devel kernel-devel
Mkdir/usr/local/keepalived
Yum install popt-devel-y
Mv Desktop, keepalived-1.2.2.tar.gz, home/
Cd/home/
Tar-zxvf keepalived-1.2.2.tar.gz
Cd keepalived-1.2.2
./Configure -- prefix =/usr/local/keepalived
Make & make install
Cp/usr/local/keepalived/etc/rc. d/init. d/keepalived/etc/rc. d/init. d/
Cp/usr/local/keepalived/etc/sysconfig/
Mkdir/etc/keepalived
Cp/usr/local/keepalived/etc/keepalived. conf/etc/keepalived/
Cp/usr/local/keepalived/sbin/keepalived/usr/sbin/
Chkconfig -- add keepalived
Chkconfig keepalived on
Vim/etc/keepalived. conf -- edit the host configuration file
Service keepalived restart
Use ip a for viewing.
The method for installing keepalived on the backup is the same as that on the host ..
The configuration file of the backup server must also be modified:
Ip addr show dev eth0
View the associated ip Address
Let's test:
Next we will simulate host downtime.
Service keepalived stop
View the associated ip address on the slave machine.
View on the browser
Complete. The experiment on the master and slave machines is complete, which is very simple .. There is also the service load balancing of the primary node. I will give you a demonstration in the next day.