MySQL Cluster keepalived simple setup

Source: Internet
Author: User
Tags haproxy

1 installation of necessary related packages

Yum-y Install kernel-devel openssl* popt popt-devel


2 Download and install

wget http://www.keepalived.org/software/keepalived-1.2.9.tar.gz

TAR-XF keepalived-1.2.9.tar.gz

Mkdir/usr/local/keepalived

CD ~/keepalived-1.2.9

./configure--prefix=/usr/local/keepalived/

Make && make install

cp/usr/local/keepalived/sbin/keepalived/usr/sbin/

Cp/usr/local/keepalived/etc/sysconfig/keepalived/etc/sysconfig

cp/usr/local/keepalived/etc/rc.d/init.d/keepalived/etc/init.d/

chmod +x/etc/init.d/keepalived

Mkdir/etc/keepalived

Cp/usr/local/keepalived/etc/keepalived/keepalived.conf/etc/keepalived


3 Modify the configuration file as follows

[Email protected] ~]# vim/etc/keepalived/keepalived.conf

Global_defs {

Notification_email {

[Email protected]

}

Notification_email_from [email protected]

Smtp_server smtp.126.com # Mail server address

Smtp_connect_timeout 30 # Connection time-out

router_id Lvs_master

}

Vrrp_script Chk_http_port {

Script "/etc/keepalived/check_haproxy.sh" # Haproxy Run detection script [haproxy restart Haproxy service]

Interval 5 # Script execution interval

WEIGHT-5 # Priority change after script execution: 5 means priority +5;-5 is priority-5

}

Vrrp_instance Vi_a {

State MASTER # Lord This value is master, from top to backup

Interface eth0

VIRTUAL_ROUTER_ID 50 # This value must be consistent between master and slave

Priority 100

Advert_int 1

Authentication {# Authentication two parameter values, master and slave must also be consistent

Auth_type PASS

Auth_pass Yiban

}

Track_script {

Chk_http_port

}

virtual_ipaddress {

192.168.78.220

}

}


5 Start keepalived

Ensure network uptime

Service Network Restart (do not do this on line)

/etc/init.d/keepalived start

View Results

IP A



This article is from the "Snow Cane Six" blog, please be sure to keep this source http://879100963.blog.51cto.com/6686639/1705086

MySQL Cluster keepalived simple setup

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.