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 > Servers >
Share
Shulou(Shulou.com)06/02 Report--
参考:haproxy+keepalived(主从模式)实现高可用环境的简单配置 https://blog.51cto.com/sf1314/2357735
主主模式就是需要两个VIP,即两个haproxy节点都同时在提供服务,
当有一个haproxy挂掉后,它的vip资源就会漂到另一个haproxy节点上(此时它将有两个vip都在提供服务),故障转移无感知.
[root@Haproxy_Keepalived_Master ~]# vim /etc/keepalived/keepalived.conf! Configuration File for keepalivedglobal_defs { notification_email { root@localhost } notification_email_from keepalived@localhostsmtp_server 127.0.0.1smtp_connect_timeout 30router_id HAproxy237} vrrp_script chk_haproxy { #HAproxy 服务监控脚本 script "/etc/keepalived/check_haproxy.sh" interval 2 weight 2} vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111} track_script { chk_haproxy}virtual_ipaddress { 182.148.15.239}notify_master "/etc/keepalived/clean_arp.sh 182.148.15.239"}vrrp_instance VI_2 { state BACKUP interface eth0 virtual_router_id 52 priority 99 advert_int 1 authentication { auth_type PASS auth_pass 1111}virtual_ipaddress { 182.148.15.235}notify_master "/etc/keepalived/clean_arp.sh 182.148.15.235"} 3)Haproxy_Keepalived_Backup服务器上的Keepalived配置如下:[root@Haproxy_Keepalived_Backup ~]# /etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf-bak[root@Haproxy_Keepalived_Backup ~]# vim /etc/keepalived/keepalived.conf! Configuration File for keepalivedglobal_defs { notification_email { root@localhost } notification_email_from keepalived@localhostsmtp_server 127.0.0.1smtp_connect_timeout 30router_id HAproxy236} vrrp_script chk_haproxy { script "/etc/keepalived/check_haproxy.sh" interval 2 weight 2} vrrp_instance VI_1 { state BACKUP interface eth0 virtual_router_id 51 priority 99 advert_int 1 authentication { auth_type PASS auth_pass 1111} track_script { chk_haproxy}virtual_ipaddress { 182.148.15.239}notify_master "/etc/keepalived/clean_arp.sh 182.148.15.239"}vrrp_instance VI_2 { state MASTER interface eth0 virtual_router_id 52 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111}virtual_ipaddress { 182.148.15.235}notify_master "/etc/keepalived/clean_arp.sh 182.148.15.235"}
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.