透過 keepalived 達成簡單的 linux H.A 架構. (linux vrrp)
http://www.keepalived.org/
[root@Test-Tomcat1 ~]# cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
xrcd2@xrcd2.com.tw
}
notification_email_from keepalived@xrcd2.com.tw
smtp_server 192.168.1.100
smtp_connect_timeout 30
router_id NodeA
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 1
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1234
}
virtual_ipaddress {
192.168.1.3
}
}
[root@Test-Tomcat2 ~]# cat /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
xrcd2@xrcd2.com.tw
}
notification_email_from keepalived@xrcd2.com.tw
smtp_server 192.168.1.100
smtp_connect_timeout 30
router_id NodeB
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 1
priority 90
advert_int 1
authentication {
auth_type PASS
auth_pass 1234
}
virtual_ipaddress {
192.168.1.3
}
}