19,612
社区成员
发帖
与我相关
我的任务
分享
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
priority 80
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
10.1.19.250
}
notify_backup "/etc/keepalived/notify.sh backup"
notify_master "/etc/keepalived/notify.sh master"
#notify_backup "/bin/echo backup >> /etc/keepalived/temp.txt"
#notify_master "/bin/echo master >> /etc/keepalived/temp.txt"
}
virtual_server 10.1.19.250 80 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.0
persistence_timeout 50
protocol TCP
real_server 10.1.19.12 80 {
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 30
nb_get_retry 3
delay_before_retry 3
}
}
real_server 10.1.19.13 80 {
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 30
nb_get_retry 3
delay_before_retry 3
}
}
}
#!/bin/bash
case "$1" in
master)
echo master >> temp.txt
;;
backup)
echo backup >> temp.txt
;;
*)
echo nothing >> temp.txt
;;
esac
Feb 20 19:31:59 host1 Keepalived[1681]: Stopping Keepalived v1.2.7 (02/14,2014)
Feb 20 19:31:59 host1 Keepalived_vrrp[1683]: VRRP_Instance(VI_1) sending 0 priority
Feb 20 19:31:59 host1 Keepalived_vrrp[1683]: VRRP_Instance(VI_1) removing protocol VIPs.
Feb 20 19:31:59 host1 Keepalived[1727]: Starting Keepalived v1.2.7 (02/14,2014)
Feb 20 19:31:59 host1 Keepalived[1728]: Starting Healthcheck child process, pid=1729
Feb 20 19:31:59 host1 Keepalived[1728]: Starting VRRP child process, pid=1730
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Interface queue is empty
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Netlink reflector reports IP 10.1.19.11 added
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Netlink reflector reports IP fe80::5054:ff:fe06:1799 added
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Interface queue is empty
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Registering Kernel netlink reflector
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Netlink reflector reports IP 10.1.19.11 added
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Registering Kernel netlink command channel
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Registering gratuitous ARP shared channel
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Netlink reflector reports IP fe80::5054:ff:fe06:1799 added
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Registering Kernel netlink reflector
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Registering Kernel netlink command channel
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Opening file '/etc/keepalived/keepalived.conf'.
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Opening file '/etc/keepalived/keepalived.conf'.
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Configuration is using : 14363 Bytes
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Configuration is using : 63800 Bytes
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: Using LinkWatch kernel netlink reflector...
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: VRRP_Instance(VI_1) Entering BACKUP STATE
Feb 20 19:31:59 host1 Keepalived_vrrp[1730]: VRRP sockpool: [ifindex(2), proto(112), fd(10,11)]
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Using LinkWatch kernel netlink reflector...
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Activating healthchecker for service [10.1.19.12]:80
Feb 20 19:31:59 host1 Keepalived_healthcheckers[1729]: Activating healthchecker for service [10.1.19.13]:80
Feb 20 19:32:00 host1 Keepalived_healthcheckers[1729]: TCP connection to [10.1.19.13]:80 failed !!!
Feb 20 19:32:00 host1 Keepalived_healthcheckers[1729]: Removing service [10.1.19.13]:80 from VS [10.1.19.250]:80
Feb 20 19:32:00 host1 Keepalived_healthcheckers[1729]: Remote SMTP server [192.168.200.1]:25 connected.
Feb 20 19:32:03 host1 Keepalived_vrrp[1730]: VRRP_Instance(VI_1) Transition to MASTER STATE
Feb 20 19:32:04 host1 Keepalived_vrrp[1730]: VRRP_Instance(VI_1) Entering MASTER STATE
Feb 20 19:32:04 host1 Keepalived_vrrp[1730]: VRRP_Instance(VI_1) setting protocol VIPs.
Feb 20 19:32:04 host1 Keepalived_vrrp[1730]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 10.1.19.250
Feb 20 19:32:04 host1 Keepalived_healthcheckers[1729]: Netlink reflector reports IP 10.1.19.250 added
Feb 20 19:32:09 host1 Keepalived_vrrp[1730]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 10.1.19.250
Feb 20 19:32:30 host1 Keepalived_healthcheckers[1729]: Timeout reading data to remote SMTP server [192.168.200.1]:25.