图: 配置文件: 主服务器的配置如下: global_defs { router_id NodeA}vrrp_instance VI_1 { state MASTER #设置为主服务器 interface ens33 #监测网络接口 virtual_router_id 51 #主.备必须一样 priority 100 #(主.备机取不同的优先级,主机值较大,备份机值较小,值越大优先级越高) advert_int 1 #VRRP Multicast广播周期秒数 authentication { a…
图: 配置文件: 主服务器的配置如下: global_defs { router_id NodeA}vrrp_instance VI_1 { state MASTER #设置为主服务器 interface ens33 #监测网络接口 virtual_router_id 51 #主.备必须一样 priority 100 #(主.备机取不同的优先级,主机值较大,备份机值较小,值越大优先级越高) advert_int 1 #VRRP Multicast广播周期秒数 authentication { a…
keepalived  nginx 主备配置(多主多备同理) 1.Nginx服务安装 nginx 不区分主备,在两台服务上安装两个即可. 安装参考:https://www.cnblogs.com/zwcry/p/9454647.html 2.Keepalived服务安装 keepalived 区分主备.多主多备的. keepalived 多主多备 是把 单主单备 复制多份,调下优先级配置即可. 安装参考:https://www.cnblogs.com/zwcry/p/9542867.html 主…
binlog-do-db和replicate-do-db表示需要同步的数据库 binlog-ignore-db和replicate-ignore-db表示不需要同步的数据库 云端服务器为master配置如下: [root@DB data]# egrep "server-id|log-bin|binlog-ignore-db|auto-increment-increment|auto-increment-offset|slave-skip-errors" /etc/my.cnf log-…
1. 热备方案 硬件:server两台,分别用于master-redis及slave-redis 软件:redis.keepalived 实现目标: 由keepalived对外提供虚拟IP(VIP)进行redis访问 主从redis正常工作,主负责处理业务,从进行数据备份 当主出现故障时,从切换为主,接替主的业务进行工作 当主恢复后,拷贝从的数据,恢复主身份,从恢复从身份 数据采用aof方式进行持久化存储,秒级备份,当出现故障后,损失数据不超过1s Keepalived提供以下服务: 对用户提供…
这是一个坑...磨了不少时间.见证自己功力有待提升... 架构图 数据库 1.安装数据库 这块不难, 直接引用:mysql安装 2.数据库主备 这块不难, 直接引用: mysql主备 虚拟VIP 重点来了!! 上脚本, 把这个脚本命名后仍进/etc/init.d, 然后授予权限755或者+x SNS_VIP=192.168.158.110 /etc/rc.d/init.d/functions case "$1" in start) ifconfig eth0:0 $SNS_VIP ne…
global_defs { router_id k8s_master} vrrp_script chk_http_port {script "/etc/keepalived/check_haproxy.sh"interval 2} vrrp_instance k8s_master { state MASTER interface bond1 virtual_router_id 188 priority 100 advert_int 1 authentication { auth_typ…
1:主库设置(1)修改配置文件vi /etc/my.cnf[mysqld]log-bin=master-binserver-id=1 (2)创建用户#mysql -u root -pmysql>create user test identified by 'test';>grant all privileges on *.* to 'test'@'%' identified by 'test' with grant option;//赋予主从同步权限>grant replication…
环境前提:     redis sentinel配置,三台主机,且配置运行良好        配置文件中添加: frontend ft_redis  bind 0.0.0.0:6379 name redis  default_backend bk_redis   backend bk_redis  option tcp-check  tcp-check connect  tcp-check send PING\r\n  tcp-check expect string +PONG  tcp-che…
keepalived工作原理和配置说明 腾讯云VPC内通过keepalived搭建高可用主备集群 内网路由都用mac地址 一个mac地址绑定多个ip一个网卡只能一个mac地址,而且mac地址无法改,但是一个网卡可以绑定多个ip地址 keepalived是集群管理中保证集群高可用的一个服务软件,其功能类似于heartbeat,用来防止单点故障. keepalived工作原理 keepalived是以VRRP协议为实现基础的,VRRP全称Virtual Router Redundancy Proto…