Double KEEPALIVED+MYSQL Email notification when switching VIP

Source: Internet
Author: User

The basic idea to solve the problem is to send a message reminder when the standby machine is switched to a master.

Specific way:

The following configuration can be configured in the keepalived configuration:

Vrrp_instance Vi_1 {
State MASTER
Interface eth0
virtual_router_id 13
Priority 100
Advert_int 1
Authentication {
Auth_type Pass
Auth_pass 6d02896810d442478799edcc47bcd62c
}
virtual_ipaddress {
x.x.x.x
}
Track_script {
Chk_haproxy
}
notify_master/usr/bin/change_master.sh
}

In this way, the change_master.sh script is executed when the standby is switched to a host. In this script you can write an email notification function. When the host is hung up, the standby machine automatically cut to the master, will perform this function to notify.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.