keepalived高可用双主配置文件

###########################lb01

cat /etc/keepalived/keepalived.conf

! Configuration File for keepalived_lb01

global_defs {

#  notification_email {

#  [email protected]

#  }

router_id LB01

}

vrrp_script check_lb {

script "/server/scripts/check_lb.sh"

interval 2

weight 2

}

vrrp_instance VI_1 {

state BACKUP

interface eth0

virtual_router_id 51

priority 100

advert_int 1

authentication {

auth_type PASS

auth_pass 1111

}

virtual_ipaddress {

10.0.0.3/24 dev eth0 label eth0:1

}

track_script {

check_lb

}

}

vrrp_instance VI_2 {

state MASTER

interface eth0

virtual_router_id 52

priority 150

advert_int 1

authentication {

auth_type PASS

auth_pass 1111

}

virtual_ipaddress {

10.0.0.4/24 dev eth0 label eth0:2

}

}

#######################lb02

cat /etc/keepalived/keepalived.conf

! Configuration File for keepalived_lb01

global_defs {

#  notification_email {

#  [email protected]

#  }

router_id LB01

}

vrrp_script check_lb {

script "/server/scripts/check_lb.sh"

interval 2

weight 2

}

vrrp_instance VI_1 {

state MASTER

interface eth0

virtual_router_id 51

priority 150

advert_int 1

authentication {

auth_type PASS

auth_pass 1111

}

virtual_ipaddress {

10.0.0.3/24 dev eth0 label eth0:1

}

track_script {

check_lb

}

}

vrrp_instance VI_2 {

state BACKUP

interface eth0

virtual_router_id 52

priority 100

advert_int 1

authentication {

auth_type PASS

auth_pass 1111

}

virtual_ipaddress {

10.0.0.4/24 dev eth0 label eth0:2

}

}

原文地址:http://blog.51cto.com/13667111/2124815

时间: 2024-10-05 05:31:36

keepalived高可用双主配置文件的相关文章

Nginx+keepalived(高可用双主模式)

Nginx+keepalived(高可用双主模式) tips:前面已经介绍了nginx+keepalived高可用主从模式,今天补充下高可用的双主模式,均可以作为主机使用 server1:192.168.237.128             VIP1:192.168.237.10 server2:192.168.237.129             VIP2:192.168.237.20 vim /etc/keepalived/keepalived.conf //编辑配置文件,增加一段新的v

【转载】MySQL和Keepalived高可用双主复制

服务器主机IP和虚拟浮动IP配置 RealServer A 192.168.75.133 RealServer B 192.168.75.134 VIP A 192.168.75.110 VIP B 192.168.75.111 安装KeepAlived软件包 [[email protected] ~]# yum install keepalived =========================================================================

基于heartbeat v1配置mysql和httpd的高可用双主模型

一.配置高可用集群的前提:(以两节点的heartbeat为例) ⑴时间必须保持同步 ⑵节点之间必须用名称互相通信 建议使用/etc/hosts,而不要用DNS 集群中使用的主机名为`uname -n`表示的主机名: ⑶ping node(仅偶数节点才需要) ⑷ssh密钥认证进行无障碍通信: 二.heartbeat v1的配置 程序主配置文件:ha.cf 认证密钥:authkeys, 其权限必须为组和其它无权访问: 资源配置文件:haresources /usr/share/doc/heartbe

mysql高可用双主+keepalived

Mysql双主复制 实验拓扑:sql1  192.168.10.1   server id 1 vip 192.168.10.100 Sql2  192.168.10.2   server id 2 vip 192.168.10.100 客户端 192.168.10.3 Sql1配置双主 主库配置:vim /etc/my.cnf Log-bin=mysql-bin    //打开二进制日志 Server-id=1 Service mysqld start   //重启mysql进程 登录到mys

keepAlived+nginx实现高可用双主模型LVS

实验目的: 利用keepalived实现高可用反向代理的nginx.以及双主模型的ipvs 实验环境: node1:在nginx做代理时做反向代理节点,在keepalived实现LVS时做Director.VIP1:172.16.18.22 VIP2:172.16.18.23 node2:在nginx做代理时做反向代理节点,在keepalived实现LVS时做Director.VIP1:172.16.18.22 VIP2:172.16.18.23 node3:在nginx做代理时做web服务器.

[Mysql高可用]——双主互备+keepalived

实验架构图    实验环境 主机名 操作系统 Mysql版本 keepalived版本 主机IP VIP lyj1(Master/Slave) Red Hat release 6.5 Mysql5.6.31 keepalived-1.2.12 10.0.100.201 10.0.100.220 lyj2(Slave/Master) Red Hat release 6.5 Mysql5.6.31 keepalived-1.2.12 10.0.100.202 构建双主互备 1. 分别修改DB1和DB

ansible实现nginx双主模式反代,keepalived高可用,memcached缓存

ansible自动化运维工具配置ngnix前端反代到后端真实机,并设置keepalived高可用,在后端一台真实主机上配置httpd,mysql,php-fpm:设置memcached缓存服务器在这台真实主机上:(因为本人电脑配置问题,无法开启那么多虚拟机,所以就简单构建了一下) IP配置: Directory1(MASTER): eno16777736:172.16.72.5 eno16777736:0:172.16.72.1(虚拟VIP) eno33554976:192.168.72.1 e

keepalived高可用lvs集群,主/备和主/主模型

利用keepalived高可用lvs集群,主/备和主/主: vrrp_script高可用双主nginx: keepalived主备:lvs-dr工作模型 网络搭建: 在前端2台调度器: DR1:172.18.11.111 DR2:172.18.11.112 VIP:172.18.11.7 后端2台web服务器,运行nginx: RS1:172.18.11.11 RS2:172.18.11.12 搭建web服务器: 提供简单的测试页面,以便容易观测到哪台RS被调度响应: 在RS1上: ]# yum

keepalived高可用服务总结分享

一.keepalived介绍 keepalived软件起初是为LVS软件设计的,用来监控LVS集群中各个集群的节点状态,后来又加入了vrrp高可用功能,因此keepalived不但可以管理LVS集群节点,还可做其他服务(Nginx.Mysql.Haproxy等)的高可用解决方案 二.keepalived高可用工作原理 keepalived高可用服务之间的故障转移通过虚拟路由冗余协议vrrp来实现的,在keepalived正常工作的时候,主节点会不断的向备节点发送组播包,(224.0.0.18)告