Keepalived setting both nodes as master
Kaushal Shriyan <[email protected]>
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Message-ID | <CAD7Ssm9yHv2-Z9kTkr6Ejg5AezLDhBGuPV830JK9UFdfGEm-Cg@mail.gmail.com> |
Hi,
I am running keepalived 1.3.2 on CentOS 6.8. I am setting up HA load
balancer HAProxy setup. My configs are as below
Master Server ----
cat keepalived.conf
global_defs {
# Keepalived process identifier
#lvs_id haproxy_DH
}
# Script used to check if HAProxy is running
vrrp_script check_haproxy {
script "/usr/bin/killall -0 haproxy"
interval 2
weight 2
}
# Virtual interface
# The priority specifies the order in which the assigned interface to take
over in a failover
vrrp_instance VI_01 {
state MASTER
interface eth0
virtual_router_id 51
priority 200
# The virtual ip address shared between the two loadbalancers
virtual_ipaddress {
172.16.0.75/32
}
track_script {
check_haproxy
}
}
keepalived -f /etc/keepalived/keepalived.conf --dont-fork --log-console
--log-detail
Starting Keepalived v1.3.2 (12/21,2016)
WARNING - default user 'keepalived_script' for script execution does not
exist - please create.
Opening file '/etc/keepalived/keepalived.conf'.
Starting Healthcheck child process, pid=4198
Starting VRRP child process, pid=4199
Initializing ipvs
Netlink reflector reports IP 172.16.0.20 added
Netlink reflector reports IP fe80::feaa:14ff:fede:c50a added
Netlink reflector reports IP 172.16.0.20 added
Registering Kernel netlink reflector
Registering Kernel netlink command channel
Netlink reflector reports IP fe80::feaa:14ff:fede:c50a added
Opening file '/etc/keepalived/keepalived.conf'.
Registering Kernel netlink reflector
Registering Kernel netlink command channel
Registering gratuitous ARP shared channel
Opening file '/etc/keepalived/keepalived.conf'.
VRRP_Instance(VI_01) removing protocol VIPs.
SECURITY VIOLATION - scripts are being executed but script_security not
enabled.
Using LinkWatch kernel netlink reflector...
VRRP sockpool: [ifindex(2), proto(112), unicast(0), fd(10,11)]
Using LinkWatch kernel netlink reflector...
pid 4200 exited with status 1
VRRP_Instance(VI_01) Transition to MASTER STATE
VRRP_Instance(VI_01) Received advert with lower priority 102, ours 200,
forcing new election
pid 4202 exited with status 1
VRRP_Instance(VI_01) Entering MASTER STATE
VRRP_Instance(VI_01) setting protocol VIPs.
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Sending/queueing gratuitous ARPs on eth0 for
172.16.0.75
Netlink reflector reports IP 172.16.0.75 added
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Received advert with lower priority 102, ours 200,
forcing new election
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Sending/queueing gratuitous ARPs on eth0 for
172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Received advert with lower priority 102, ours 200,
forcing new election
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Sending/queueing gratuitous ARPs on eth0 for
172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
pid 4204 exited with status 1
VRRP_Instance(VI_01) Received advert with lower priority 102, ours 200,
forcing new election
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Sending/queueing gratuitous ARPs on eth0 for
172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Received advert with lower priority 102, ours 200,
forcing new election
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Sending/queueing gratuitous ARPs on eth0 for
172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
pid 4206 exited with status 1
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Sending/queueing gratuitous ARPs on eth0 for
172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Slave Server ----
cat keepalived.conf
global_defs {
# Keepalived process identifier
#lvs_id haproxy_DH_passive
}
# Script used to check if HAProxy is running
vrrp_script check_haproxy {
script "/usr/bin/killall -0 haproxy"
interval 2
weight 2
}
# Virtual interface
# The priority specifies the order in which the assigned interface to take
over in a failover
vrrp_instance VI_01 {
state BACKUP
interface eth0
virtual_router_id 51
priority 100
# The virtual ip address shared between the two loadbalancers
virtual_ipaddress {
172.16.0.75/32
}
track_script {
check_haproxy
}
}
keepalived -f /etc/keepalived/keepalived.conf --dont-fork --log-console
--log-detail
Starting Keepalived v1.3.2 (12/21,2016)
WARNING - default user 'keepalived_script' for script execution does not
exist - please create.
Opening file '/etc/keepalived/keepalived.conf'.
Starting Healthcheck child process, pid=4979
Starting VRRP child process, pid=4980
Initializing ipvs
Netlink reflector reports IP 172.16.0.21 added
Netlink reflector reports IP fe80::feaa:14ff:fede:c509 added
Registering Kernel netlink reflector
Registering Kernel netlink command channel
Netlink reflector reports IP 172.16.0.21 added
Opening file '/etc/keepalived/keepalived.conf'.
Netlink reflector reports IP fe80::feaa:14ff:fede:c509 added
Registering Kernel netlink reflector
Registering Kernel netlink command channel
Registering gratuitous ARP shared channel
Opening file '/etc/keepalived/keepalived.conf'.
VRRP_Instance(VI_01) removing protocol VIPs.
SECURITY VIOLATION - scripts are being executed but script_security not
enabled.
Using LinkWatch kernel netlink reflector...
VRRP_Instance(VI_01) Entering BACKUP STATE
VRRP sockpool: [ifindex(2), proto(112), unicast(0), fd(10,11)]
Using LinkWatch kernel netlink reflector...
VRRP_Script(check_haproxy) succeeded
VRRP_Instance(VI_01) Changing effective priority from 100 to 102
VRRP_Instance(VI_01) Transition to MASTER STATE
VRRP_Instance(VI_01) Entering MASTER STATE
VRRP_Instance(VI_01) setting protocol VIPs.
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Sending/queueing gratuitous ARPs on eth0 for
172.16.0.75
Netlink reflector reports IP 172.16.0.75 added
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
VRRP_Instance(VI_01) Sending/queueing gratuitous ARPs on eth0 for
172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Sending gratuitous ARP on eth0 for 172.16.0.75
Any help will be highly appreciable. Thanks in Advance. Please do let me
know if you need any additional information.
Regards,
Kaushal
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel