In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces mairadb+galera+haproxy+keepalived how to achieve mysql load balancing and high availability, which has a certain reference value. Interested friends can refer to it. I hope you will learn a lot after reading this article.
One: server resources
Haproxy+keepalived node1 10.116.19.251
Haproxy+keepalived node2 10.44.90.201
Mariadb+galera node1 10.44.66.2
Mariadb+galera node2 10.116.148.103
Mariadb+galera node3 10.170.142.108
Second: mariadb cluster installation
Please refer to the previous blog post. After the installation is successful, new haproxy users have been added to the cluster.
Mysql-u root-p
CREATE USER 'haproxy'@' 10.116.19.251'
CREATE USER 'haproxy'@' 10.44.90.201'
FLUSH PRIVILEGES
Three: haproxy installation
Sudo yum install haproxy
Configure haproxy vi / etc/haproxy/haproxy.cfg
Click (here) to collapse or open
Global_defs {
Lvs_id LBL01
}
Vrrp_sync_group SyncGroup01 {
Group {
FloatIP1
}
}
Vrrp_script check_haproxy {
Script "killall-0 haproxy"
Interval 2
Weight 2
}
Vrrp_instance FloatIP1 {
State BACKUP
Interface eth0
Virtual_router_id 10
Priority 100
Advert_int 1
Virtual_ipaddress {
192.168.1.60
}
Track_script {
Check_haproxy
}
}
Start keepalived
Chkconfig keepalived on
/ etc/init.d/keepalived start
Thank you for reading this article carefully. I hope the article "how to achieve mysql load balancing and high availability" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.