Stop the mysql + keepalived database and stop suicide.

Source: Internet
Author: User
Global_defs {icationication_email {test@sina.com} notification_email_fromadmin@test.comsmtp_server127.0.0.1smtp _ connect_timeout30router_idMYSQL_HA # identification, dual master identical} vrrp_instanceVI_1 {stateBACKUP # both sets mysql database...

Global_defs {
Notification_email {
Test@sina.com
}
Notification_email_from admin@test.com
Smtp_server 127.0.0.1
Smtp_connect_timeout 30
Router_id MYSQL_HA # ID, the same as the dual-Master
}
Vrrp_instance VI_1 {
State BACKUP # BACKUP is set for both sets
Interface eth0
Virtual_router_id 51 # Same as Master/backup
Priority 100 # priority, 90 for backup
Advert_int 1
Nopreempt # Do not take the initiative to seize resources, only in the master priority settings, backup is not set
Authentication {
Auth_type PASS
Auth_pass 1111
}
Virtual_ipaddress {
192.168.42.170
}
}
Virtual_server 192.168.42.170 3306 {
Delay_loop 2
# Lb_algo rr # LVS algorithm. if it is not used, we close it.
# Lb_kind DR # LVS mode. if this mode is not disabled, the slave server cannot connect to the master MySQL instance through VIP.
Persistence_timeout 50 # connections from the same IP address are allocated to the same real server within 60 seconds.
Protocol TCP
Real_server 192.168.42.128 3306 {# Check local mysql, backup also needs to write to check local mysql
Weight 3
Notify_down/etc/keepalived/mysql. sh # execute this script when mysq server is down to kill keepalived for failover
TCP_CHECK {
Connect_timeout 3 # connection timeout
Nb_get_retry 3 # Number of retries
Delay_before_retry 3 # retry interval
}
}

#! /Bin/sh

Killall keepalived

When mysql is stopped, keepalived cannot stop.

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.