Last active
January 3, 2016 04:59
-
-
Save dotmanila/8412562 to your computer and use it in GitHub Desktop.
keepalived.conf 1 writer and 1 reader VIP for Percona XtraDB Cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global_defs { | |
notification_email { | |
[email protected] | |
} | |
notification_email_from [email protected] | |
smtp_server 127.0.0.1 | |
smtp_connect_timeout 30 | |
router_id pxc-cluster | |
} | |
vrrp_script prefer_pxc01 { | |
script "/usr/bin/pxc-track prefer_pxc01" | |
interval 2 | |
} | |
vrrp_script prefer_pxc02 { | |
script "/usr/bin/pxc-track prefer_pxc02" | |
interval 2 | |
} | |
vrrp_script nopreempt_writer_vip { | |
script "/usr/bin/pxc-track nopreempt_writer" | |
interval 2 | |
} | |
vrrp_script nopreempt_reader_vip { | |
script "/usr/bin/pxc-track nopreempt_reader" | |
interval 2 | |
} | |
vrrp_script repel_writer_vip { | |
script "/usr/bin/pxc-track repel_writer" | |
interval 2 | |
} | |
vrrp_script repel_reader_vip { | |
script "/usr/bin/pxc-track repel_reader" | |
interval 2 | |
} | |
vrrp_script bad_pxc { | |
script "/usr/bin/pxc-track bad_pxc" | |
interval 2 | |
} | |
vrrp_instance writer_vip { | |
interface eth5 | |
state BACKUP | |
virtual_router_id 60 | |
priority 101 | |
virtual_ipaddress { | |
192.168.56.83 | |
} | |
track_script { | |
!repel_reader_vip weight 30 | |
!prefer_pxc01 weight 30 | |
nopreempt_writer_vip weight 50 | |
bad_pxc weight -100 | |
} | |
track_interface { | |
eth5 | |
} | |
smtp_alert | |
!nopreempt | |
notify_master "/bin/echo 'writer now master' > /tmp/keepalived-w.state" | |
notify_backup "/bin/echo 'writer now backup' > /tmp/keepalived-w.state" | |
notify_fault "/bin/echo 'writer now fault' > /tmp/keepalived-w.state" | |
} | |
vrrp_instance reader_vip { | |
interface eth5 | |
state BACKUP | |
virtual_router_id 61 | |
priority 101 | |
virtual_ipaddress { | |
192.168.56.84 | |
} | |
track_script { | |
repel_writer_vip weight 30 | |
!prefer_pxc02 weight 30 | |
nopreempt_reader_vip weight 50 | |
bad_pxc weight -100 | |
} | |
track_interface { | |
eth5 | |
} | |
smtp_alert | |
!nopreempt | |
notify_master "/bin/echo 'reader now master' > /tmp/keepalived-r.state" | |
notify_backup "/bin/echo 'reader now backup' > /tmp/keepalived-r.state" | |
notify_fault "/bin/echo 'reader now fault' > /tmp/keepalived-r.state" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment