Skip to content

Instantly share code, notes, and snippets.

@abg
abg / master_switch.sh
Last active June 18, 2018 13:33
Script to serve as a master_ip_{failover,online_change}_script for MHA
#!/bin/bash
# Source the user config - Mostly useful for setting interface, vip, label as desired
# Example:
# # cat /etc/mha/switch.conf
# vip=172.16.3.1
# interface=eth2
# label=eth2:0
config=/etc/mysql-masterha/vip.conf
[ -e "${config}" ] && . "${config}"