Article Title: keepalived master-slave installation configuration. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Tar xf keepalived-1.1.19.tar.gz
Cd keepalived-1.1.19
./Configure -- prefix =/opt/keepalived & make install
Cp keepalived/etc/init. d/keepalived. sysconfig/etc/sysconfig/keepalived
Cp keepalived/etc/init. d/keepalived. rh. init/etc/init. d/keepalived
Chmod + x/etc/init. d/keepalived
Ln-s/opt/keepalived/sbin/keepalived
Chkconfig -- add keepalived
Cp-a keepalived/etc/keepalived // etc/
Vi/etc/keepalived. conf
! Configuration File for keepalived
Global_defs {
Notification_email {
Mymail@mail.com
}
Notification_email_from NX_LB@gzk.sdo.com
Smtp_server 127.0.0.1
Smtp_connect_timeout 30
Router_id NX_LB
}
Vrrp_instance VI_1 {
State BACKUP # BACKUP is required for both instances. Use priority to distinguish between primary and secondary instances.
Interface eth0
Virtual_router_id 51
Priority 100 # priority
Mcast_src_ip 10.10.81.100 # primary/secondary IP
Advert_int 1 # primary/secondary check interval
Nopreempt # used on the host. If the host is no longer switched after the switch
Authentication {
Auth_type PASS
Auth_pass 55555
}
Virtual_ipaddress {
XX. XX/24 dev eth0 scope global
}
}