14、高可用keepalived搭建及切换

keepalived主从切换试验:

1、先搭建192.168.1.20与192.168.1.21的主主架构     192.168.1.76为VIP

2、在2机都安装keepalived

  1.  tar -zxvf keepalived-1.2.13.tar.gz 
  2.  cd keepalived-1.2.13
  3.  ./configure -prefix=/usr/local/keepalived
  4.  make
  5. make install
  6.  [[email protected] keepalived-1.2.13]# cat /opt/mysql/mysql.sh 
  7. #!/bin/sh
  8. pkill keepalived
  9. [[email protected] keepalived-1.2.13]# chmod +x /opt/mysql/mysql.sh

3、配置20机器的keepalived配置文件

  1. [[email protected] keepalived-1.2.13]# cat /usr/local/keepalived/etc/keepalived.conf
  2. !ConfigurationFilefor keepalived 
  3.  
  4. global_defs { 
  5.    notification_email { 
  6.      [email protected].com 
  7.    } 
  8.    router_id mysql-ha 
  9.  
  10. vrrp_instance VI_20 { 
  11.     state BACKUP
  12.     interface eth0 
  13.     virtual_router_id 20
  14.     priority 90
  15.     advert_int 1 
  16.     nopreempt        
  17.     authentication { 
  18.         auth_type PASS 
  19.         auth_pass 1111  
  20.     } 
  21.     virtual_ipaddress {   
  22.         192.168.1.76
  23.     } 
  24.  
  25. virtual_server 192.168.1.763306{ 
  26.     delay_loop 2 
  27.     lb_algo wrr 
  28.     lb_kind DR 
  29.     persistence_timeout 60 
  30.     protocol TCP 
  31.  
  32.     real_server 192.168.1.203306{
  33.         weight 3 
  34.         notify_down /opt/mysql/mysql.sh 
  35.             TCP_CHECK { 
  36.             connect_timeout 10 
  37.             nb_get_retry 3 
  38.             delay_before_retry 3 
  39.             connect_port 3306
  40.         } 
  41.     } 

4、配置21机器的keepalived配置文件

  1. !ConfigurationFilefor keepalived 
  2.  
  3. global_defs { 
  4.    notification_email { 
  5.      [email protected].com 
  6.    } 
  7.    router_id mysql-ha 
  8.  
  9. vrrp_instance VI_21 { 
  10.     state BACKUP
  11.     interface eth0 
  12.     virtual_router_id 20        --注意2边要一致
  13.     priority 100
  14.     advert_int 1 
  15.     nopreempt        
  16.     authentication { 
  17.         auth_type PASS 
  18.         auth_pass 1111  
  19.     } 
  20.     virtual_ipaddress {   
  21.         192.168.1.76
  22.     } 
  23.  
  24. virtual_server 192.168.1.763306{ 
  25.     delay_loop 2 
  26.     lb_algo wrr 
  27.     lb_kind DR 
  28.     persistence_timeout 60 
  29.     protocol TCP 
  30.  
  31.     real_server 192.168.1.213306{
  32.         weight 3 
  33.         notify_down /opt/mysql/mysql.sh 
  34.             TCP_CHECK { 
  35.             connect_timeout 10 
  36.             nb_get_retry 3 
  37.             delay_before_retry 3 
  38.             connect_port 3306
  39.         } 
  40.     } 

5、测试

  • 在20机器测试,mysql没有启动的情况下,keepalived启动会被自动杀掉,证明keepalived配置正确

service mysql stop

/usr/local/keepalived/sbin/keepalived -f /usr/local/keepalived/etc/keepalived.conf -D

ps -ef|grep keepalived        看到没有keepalived进程

  • 在2边启动mysql并启动keepalived,测试用vip登陆数据库
  1. [[email protected] keepalived-1.2.13]# mysql -h192.168.1.76-P3306 -uroot -proot
  2. Welcome to the MySQL monitor.  Commands end with ; or \g.
  3. YourMySQL connection id is 682
  4. Server version:5.5.30-log Source distribution
  5. Copyright(c)2000,2013,Oracle and/or its affiliates.All rights reserved.
  6. Oracle is a registered trademark of OracleCorporation and/or its
  7. affiliates.Other names may be trademarks of their respective
  8. owners.
  9. Type‘help;‘ or ‘\h‘for help.Type‘\c‘ to clear the current input statement.
  10. mysql> 

21机器查看IP:

  1. [[email protected] keepalived-1.2.13]# ip addr show
  2. 1: lo:<LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.     inet6 ::1/128 scope host 
  6.        valid_lft forever preferred_lft forever
  7. 2: eth0:<BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
  8.     link/ether 08:00:27:5d:ef:c3 brd ff:ff:ff:ff:ff:ff
  9.     inet 192.168.1.21/24 brd 192.168.1.255 scope global eth0
  10.     inet 192.168.1.76/32 scope global eth0
  11.     inet6 fe80::a00:27ff:fe5d:efc3/64 scope link 
  12.        valid_lft forever preferred_lft forever

20机器查看IP:

  1. [[email protected] keepalived-1.2.13]# ip addr show
  2. 1: lo:<LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.     inet6 ::1/128 scope host 
  6.        valid_lft forever preferred_lft forever
  7. 2: eth0:<BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
  8.     link/ether 08:00:27:00:58:57 brd ff:ff:ff:ff:ff:ff
  9.     inet 192.168.1.20/24 brd 192.168.1.255 scope global eth0
  10.     inet6 fe80::a00:27ff:fe00:5857/64 scope link 
  11.        valid_lft forever preferred_lft forever

关闭20节点的mysql,发现VIP漂移到21上,并且20上的keepalived被kill

  • 杀掉master的keepalived,vip会飘到slave上,slave的日志:
  1. Jul2020:03:31 likun Keepalived_vrrp[8547]: VRRP_Instance(VI_20)Transition to MASTER STATE
  2. Jul2020:03:32 likun Keepalived_vrrp[8547]: VRRP_Instance(VI_20)Entering MASTER STATE
  3. Jul2020:03:32 likun Keepalived_vrrp[8547]: VRRP_Instance(VI_20) setting protocol VIPs.
  4. Jul2020:03:32 likun Keepalived_vrrp[8547]: VRRP_Instance(VI_20)Sending gratuitous ARPs on eth0 for192.168.1.76
  5. Jul2020:03:32 likun Keepalived_healthcheckers[8546]:Netlink reflector reports IP 192.168.1.76 added
  • 再启动master的keepalived,不会抢vip,变为backup state,master的日志:
  1. Jul2020:03:49 likun1 Keepalived[7416]:StartingKeepalived v1.2.13(07/20,2014)
  2. Jul2020:03:49 likun1 Keepalived[7417]:StartingHealthcheck child process, pid=7418
  3. Jul2020:03:49 likun1 Keepalived[7417]:Starting VRRP child process, pid=7419
  4. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Netlink reflector reports IP 192.168.1.21 added
  5. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Netlink reflector reports IP 192.168.1.21 added
  6. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Netlink reflector reports IP fe80::a00:27ff:fe5d:efc3 added
  7. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:RegisteringKernel netlink reflector
  8. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:RegisteringKernel netlink command channel
  9. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Netlink reflector reports IP fe80::a00:27ff:fe5d:efc3 added
  10. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:RegisteringKernel netlink reflector
  11. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:RegisteringKernel netlink command channel
  12. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Registering gratuitous ARP shared channel
  13. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Opening file ‘/usr/local/keepalived/etc/keepalived.conf‘.
  14. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:Configuration is using:62953Bytes
  15. Jul2020:03:49 likun1 Keepalived_vrrp[7419]:UsingLinkWatch kernel netlink reflector...
  16. Jul2020:03:49 likun1 Keepalived_vrrp[7419]: VRRP_Instance(VI_21)Entering BACKUP STATE
  17. Jul2020:03:49 likun1 Keepalived_vrrp[7419]: VRRP sockpool:[ifindex(2), proto(112), unicast(0), fd(10,11)]
  18. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Opening file ‘/usr/local/keepalived/etc/keepalived.conf‘.
  19. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Configuration is using:11555Bytes
  20. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:UsingLinkWatch kernel netlink reflector...
  21. Jul2020:03:49 likun1 Keepalived_healthcheckers[7418]:Activating healthchecker for service [192.168.1.21]:3306

切换时不会kill keepalived的方式

20、21先配置主主架构

2边数据库做授权:

[email protected] 19:30:38 [db3]> GRANT REPLICATION CLIENT ON *.* TO ‘monitor‘@‘%‘ IDENTIFIED BY ‘m0n1tor‘;

Query OK, 0 rows affected (0.00 sec)

flush privileges

2边系统拷贝检测脚本并+x

chmod +x /usr/local/keepalived/checkMySQL.py        (脚本在附件,要检查一下脚本变量值)

两边配置文件做成如下:

20:

  1. [[email protected] ~]# cat /usr/local/keepalived/etc/keepalived.conf 
  2. vrrp_script vs_mysql_20 {
  3.     script "/usr/local/keepalived/checkMySQL.py -h 192.168.1.20 -P 3306"
  4.     interval 60 
  5. }
  6. vrrp_instance VI_20 {
  7.     state BACKUP
  8.     nopreempt
  9.     interface eth0
  10.     virtual_router_id 21
  11.     priority 100
  12.     advert_int 5
  13.     authentication {
  14.         auth_type PASS
  15.         auth_pass 1111
  16.     }
  17.     track_script {
  18.        vs_mysql_20
  19.     }
  20.     virtual_ipaddress {
  21.         192.168.1.76
  22.     }

21:

  1. [[email protected] ~]# cat /usr/local/keepalived/etc/keepalived.conf 
  2. vrrp_script vs_mysql_21 {
  3.     script "/usr/local/keepalived/checkMySQL.py -h 192.168.1.21 -P 3306"
  4.     interval 60 
  5. }
  6. vrrp_instance VI_21 {
  7.     state BACKUP
  8.     nopreempt
  9.     interface eth0
  10.     virtual_router_id 21
  11.     priority 90
  12.     advert_int 5
  13.     authentication {
  14.         auth_type PASS
  15.         auth_pass 1111
  16.     }
  17.     track_script {
  18.        vs_mysql_21
  19.     }
  20.     virtual_ipaddress {
  21.         192.168.1.76
  22.     }

启动20的keepalived,并查看日志,发现启动为master状态,vip绑定:

  1. [[email protected] ~]#/usr/local/keepalived/sbin/keepalived -f /usr/local/keepalived/etc/keepalived.conf -D
  2. [[email protected] ~]# tail -f /var/log/messages
  3. Aug  820:58:41 likun Keepalived[8023]:StoppingKeepalived v1.2.13(07/20,2014)
  4. Aug  820:59:04 likun Keepalived[8064]:StartingKeepalived v1.2.13(07/20,2014)
  5. Aug  820:59:04 likun Keepalived[8065]:StartingHealthcheck child process, pid=8066
  6. Aug  820:59:04 likun Keepalived[8065]:Starting VRRP child process, pid=8067
  7. Aug  820:59:04 likun Keepalived_vrrp[8067]:Netlink reflector reports IP 192.168.1.20 added
  8. Aug  820:59:04 likun Keepalived_vrrp[8067]:Netlink reflector reports IP 10.0.3.15 added
  9. Aug  820:59:04 likun Keepalived_vrrp[8067]:Netlink reflector reports IP fe80::a00:27ff:fe00:5857 added
  10. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP 192.168.1.20 added
  11. Aug  820:59:04 likun Keepalived_vrrp[8067]:Netlink reflector reports IP fe80::a00:27ff:fe5d:683a added
  12. Aug  820:59:04 likun Keepalived_vrrp[8067]:RegisteringKernel netlink reflector
  13. Aug  820:59:04 likun Keepalived_vrrp[8067]:RegisteringKernel netlink command channel
  14. Aug  820:59:04 likun Keepalived_vrrp[8067]:Registering gratuitous ARP shared channel
  15. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP 10.0.3.15 added
  16. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP fe80::a00:27ff:fe00:5857 added
  17. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP fe80::a00:27ff:fe5d:683a added
  18. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:RegisteringKernel netlink reflector
  19. Aug  820:59:04 likun Keepalived_healthcheckers[8066]:RegisteringKernel netlink command channel
  20. Aug  820:59:05 likun Keepalived_vrrp[8067]:Opening file ‘/usr/local/keepalived/etc/keepalived.conf‘.
  21. Aug  820:59:05 likun Keepalived_healthcheckers[8066]:Opening file ‘/usr/local/keepalived/etc/keepalived.conf‘.
  22. Aug  820:59:05 likun Keepalived_vrrp[8067]:Configuration is using:62993Bytes
  23. Aug  820:59:05 likun Keepalived_healthcheckers[8066]:Configuration is using:5287Bytes
  24. Aug  820:59:05 likun Keepalived_vrrp[8067]:UsingLinkWatch kernel netlink reflector...
  25. Aug  820:59:05 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Entering BACKUP STATE
  26. Aug  820:59:05 likun Keepalived_vrrp[8067]: VRRP sockpool:[ifindex(2), proto(112), unicast(0), fd(10,11)]
  27. Aug  820:59:05 likun Keepalived_healthcheckers[8066]:UsingLinkWatch kernel netlink reflector...
  28. Aug  820:59:07 likun Keepalived_vrrp[8067]: VRRP_Script(vs_mysql_20) succeeded
  29. Aug  820:59:20 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Transition to MASTER STATE
  30. Aug  820:59:25 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Entering MASTER STATE
  31. Aug  820:59:25 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20) setting protocol VIPs.
  32. Aug  820:59:25 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Sending gratuitous ARPs on eth0 for192.168.1.76
  33. Aug  820:59:25 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP 192.168.1.76 added
  34. Aug  820:59:30 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Sending gratuitous ARPs on eth0 for192.168.1.76

启动21的keepalived,并查看日志,启动为backup状态:

  1. [[email protected] ~]#/usr/local/keepalived/sbin/keepalived -f /usr/local/keepalived/etc/keepalived.conf -D
  2. [[email protected] ~]# tail -f /var/log/messages
  3. Aug  918:11:27 likun1 Keepalived[3355]:StartingKeepalived v1.2.13(07/20,2014)
  4. Aug  918:11:27 likun1 Keepalived[3356]:StartingHealthcheck child process, pid=3357
  5. Aug  918:11:27 likun1 Keepalived[3356]:Starting VRRP child process, pid=3358
  6. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Netlink reflector reports IP 192.168.1.21 added
  7. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP 192.168.1.21 added
  8. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP 10.0.3.15 added
  9. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP fe80::a00:27ff:fe5d:efc3 added
  10. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Netlink reflector reports IP 10.0.3.15 added
  11. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP fe80::a00:27ff:fe97:754a added
  12. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:RegisteringKernel netlink reflector
  13. Aug  918:11:27 likun1 Keepalived_healthcheckers[3357]:RegisteringKernel netlink command channel
  14. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Netlink reflector reports IP fe80::a00:27ff:fe5d:efc3 added
  15. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Netlink reflector reports IP fe80::a00:27ff:fe97:754a added
  16. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:RegisteringKernel netlink reflector
  17. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:RegisteringKernel netlink command channel
  18. Aug  918:11:27 likun1 Keepalived_vrrp[3358]:Registering gratuitous ARP shared channel
  19. Aug  918:11:30 likun1 Keepalived_vrrp[3358]:Opening file ‘/usr/local/keepalived/etc/keepalived.conf‘.
  20. Aug  918:11:30 likun1 Keepalived_healthcheckers[3357]:Opening file ‘/usr/local/keepalived/etc/keepalived.conf‘.
  21. Aug  918:11:30 likun1 Keepalived_vrrp[3358]:Configuration is using:63001Bytes
  22. Aug  918:11:30 likun1 Keepalived_healthcheckers[3357]:Configuration is using:5295Bytes
  23. Aug  918:11:30 likun1 Keepalived_vrrp[3358]:UsingLinkWatch kernel netlink reflector...
  24. Aug  918:11:30 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Entering BACKUP STATE
  25. Aug  918:11:30 likun1 Keepalived_vrrp[3358]: VRRP sockpool:[ifindex(2), proto(112), unicast(0), fd(10,11)]
  26. Aug  918:11:30 likun1 Keepalived_healthcheckers[3357]:UsingLinkWatch kernel netlink reflector...
  27. Aug  918:11:31 likun1 Keepalived_vrrp[3358]: VRRP_Script(vs_mysql_21) succeeded

20机器关闭mysql,看到20 keepalived切换为fault状态,21机器切换为master状态并绑定vip

  1. 20日志:
  2. Aug  823:09:05 likun Keepalived_vrrp[8067]: VRRP_Script(vs_mysql_20) failed
  3. Aug  823:09:08 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Entering FAULT STATE
  4. Aug  823:09:08 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20) removing protocol VIPs.
  5. Aug  823:09:08 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Now in FAULT state
  6. Aug  823:09:08 likun Keepalived_healthcheckers[8066]:Netlink reflector reports IP 192.168.1.76 removed
  1. 21日志:
  2. Aug  920:21:00 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Transition to MASTER STATE
  3. Aug  920:21:05 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Entering MASTER STATE
  4. Aug  920:21:05 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21) setting protocol VIPs.
  5. Aug  920:21:05 likun1 Keepalived_healthcheckers[3357]:Netlink reflector reports IP 192.168.1.76 added
  6. Aug  920:21:05 likun1 avahi-daemon[1320]:Registeringnew address record for192.168.1.76 on eth0.IPv4.
  7. Aug  920:21:05 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Sending gratuitous ARPs on eth0 for192.168.1.76
  8. Aug  920:21:10 likun1 Keepalived_vrrp[3358]: VRRP_Instance(VI_21)Sending gratuitous ARPs on eth0 for192.168.1.76

20机器再次启动mysql,keepalived会切换为backup状态,但不会抢vip

  1. Aug  823:49:05 likun Keepalived_vrrp[8067]: VRRP_Script(vs_mysql_20) succeeded
  2. Aug  823:49:08 likun Keepalived_vrrp[8067]: VRRP_Instance(VI_20)Entering BACKUP STATE

keepalived双主带一从的配置方式

20 <-->21(双主)

|

22(从库)

时间: 2024-10-11 22:32:55

14、高可用keepalived搭建及切换的相关文章

drbd+heartbeat+nfs高可用架构搭建

一.客户需求 1.需求描述 有些客户有自己的存储设备,但是并没有集群文件系统服务,所以如果我们多个节点(计算节点)如果想同时使用其中的一个块且要保证高可用的话,就需要我们自己来完成类似集群文件系统的服务组合,在此我们使用的服务组合是:iscsi共享+drbd+heartbeat+nfs. 2.服务说明 Iscsi共享:这里通过iscsi共享服务将存储设备上的存储块共享出去,提供节点(NC1+NC2)使用,此处我们将在iscsi服务短创建两个镜像充当块设备. Drbd   :服务器之间镜像块设备内

mysql高可用+keepalived

生产环境中一台mysql主机存在单点故障,所以我们要确保mysql的高可用性,即俩台mysql服务器如果其中有一台mysql服务器挂掉后,另外一台就能立刻接替进行工作. MYSQL的高可用方案一般有 Keepalived+双主,MHA,PXC,MMM,Heartbeat+DRBD等 比较常用的是keepalived+双主MHA和PXC 这次主要介绍利用keepalived实现MYSQL数据库的高可用. 基本思路:俩台MYSQL互为主从关系(双主),通过keepalived配置配置虚拟IP,实现当

openstack高可用环境搭建(二):高可环境的搭建

1.   高可用方案 1.1 网络 网段划分: 管理网络:10.192.44.148~10.192.44.151(需要接网线,后台登陆,openstack各组件的endpoint使用) 外部网络:10.192.45.211-10.192.45.220,这里外部网络需要一个段,供虚拟机绑定浮动IP使用 虚拟机网络:192.168.0.0/24 (需要实际网卡,但不需要接网线) 存储集群网络(cluster ip):目前和管理网络复用,真正部署单独划分会更好 张工申请到的合法IP: 实机环境的10.

Mysql_MHA高可用架构搭建

Mysql_MHA高可用架构搭建 窗体顶端 窗体底端 环境及兼容包 系统环境:centos6.5 Mysql: mysql-5.5.6 数据库用源码安装,这里就不介绍了 主机分配: Master : 192.168.0.101 node1 (主库) Slave1 : 192.168.0.102 node2 (备用主库) Slave2 : 192.168.0.103 node3 (从库+MHA控制节点) MHA兼容包见附件 窗体顶端 窗体底端 添加免密码登录,互为认证 ++++++++++以下操作

K8S 1.1.10 高可用环境搭建实战

服务器信息如下: 主机名称 IP 备注 node01 10.150.27.51 master and etcd rode02 10.150.27.65 master and etcd node03 10.150.27.66 node VIP 10.150.27.99 软件版本: docker17.03.2-cesocat-1.7.3.2-2.el7.x86_64 kubelet-1.10.0-0.x86_64 kubernetes-cni-0.6.0-0.x86_64 kubectl-1.10.

haproxy + rabbitmq + keepalived的高可用环境搭建

一.rabbitmq的搭建:参考rabbimq的安装及集群设置 二.安装和配置haproxy 1.安装haproxyyum install haproxy 2.安装rsysloga. 检查rsyslog是否已安装rpm -q rsyslog b. 添加haproxy的log配置cd /etc/rsyslog.dvim haproxy.conf === 文件内容$ModLoad imudp$UDPServerRun 514local2.* /var/log/haproxy.loglocal3.*

基于DR模式的keepalived主从模式高可用架构搭建

一:架构图示 2.keepalived是什么? Keepalived的作用是检测服务器的状态,如果有一台web服务器宕机 ,或工作出现故障,Keepalived将检测到,通过VRRP协议,将有故障的服务器从系统中剔除,同时使用其他服务器代替该服务器的工作,当服务器工作正常后 Keepalived自动将服务器加入到服务器群中,这些工作全部自动完成,不需要人工干涉,需要人工做的只是修复故障的服务器. 3.VRRP协议是什么? VRRP(Virtual Router Redundancy Protoc

keepalived+nginx高可用环境搭建

高可用方案其实很多,而且有很多成本是非常低和简单的.比如你如果有一个网站,高可用最简单的就是nds+nginx+两台机器. 我们由于是客户的一个项目,dns申请是非常麻烦的,所以才考虑用keepalived+nginx做高可用方案. 从网上整理了HA常用组合. heartbeat v2+crm heartbeat v3+pacemaker corosync+pacemaker cman + rgmanager keepalived+lvs. 这里我们没有用lvs,而是直接用了nginx,感觉就两

Redis + keepalived 高可用群集搭建

本次实验环境介绍: 操作系统: Centos 7.3 IP : 192.168.10.10 Centos 7.3 IP : 192.168.10.20  VIP    地址   : 192.168.10.254 软件版本介绍: redis : redis-3.2.8 下载链接: http://download.redis.io/releases/redis-3.2.8.tar.gz keepalived : keepalived-1.2.10  下载链接: http://www.keepaliv