redis哨兵-5
#地址:
https://www.cnblogs.com/PatrickLiu/p/8444546.html #常用架构
redis1主1从+3哨兵 实现redis高可用 #redis主从
###############################主######################################
daemonize yes
protected-mode no
pidfile "/var/run/redis_6379.pid"
port
bind 0.0.0.0
timeout
tcp-keepalive
loglevel notice
logfile "/opt/redis/logs/redis_6379.log"
databases
save
save
save
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename "dump.rdb"
dir "/opt/redis/data/6379"
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage
auto-aof-rewrite-min-size 64mb
lua-time-limit
slowlog-log-slower-than
slowlog-max-len
hash-max-ziplist-entries
hash-max-ziplist-value
list-max-ziplist-entries
list-max-ziplist-value
set-max-intset-entries
zset-max-ziplist-entries
zset-max-ziplist-value
activerehashing yes
client-output-buffer-limit normal
client-output-buffer-limit slave 256mb 64mb
client-output-buffer-limit pubsub 32mb 8mb
hz
slave-read-only yes ################################从##########################################
daemonize yes
protected-mode no
pidfile "/var/run/redis_6379.pid"
port
bind 0.0.0.0
timeout
tcp-keepalive
loglevel notice
logfile "/opt/redis/logs/redis_6379.log"
databases
save
save
save
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename "dump.rdb"
dir "/opt/redis/data/6379"
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage
auto-aof-rewrite-min-size 64mb
lua-time-limit
slowlog-log-slower-than
slowlog-max-len
hash-max-ziplist-entries
hash-max-ziplist-value
list-max-ziplist-entries
list-max-ziplist-value
set-max-intset-entries
zset-max-ziplist-entries
zset-max-ziplist-value
activerehashing yes
client-output-buffer-limit normal
client-output-buffer-limit slave 256mb 64mb
client-output-buffer-limit pubsub 32mb 8mb
hz
#主的连接
slaveof 172.16.0.22 6379 #####################################redis哨兵配置################################################
port
dir /opt/redis/data/
daemonize yes
protected-mode no
logfile "/opt/redis/logs/redis_16379.log"
pidfile "/var/run/redis_16379.pid"
#Sentinel(哨兵)进程去监视一个名为 mymaster 的主服务器,这个主服务器的 IP 地址为 172.16.0.23 , 端口号为 ,而将这个主服务器判断为失效至少需要 个 Sentinel(哨兵)进程的同意
#注意:
#.如果2个哨兵,有1个哨兵挂了,那么主从是不会切换的,状态都会在odwon(客观下线状态),所以要哨兵高可用,至少要3个哨兵
#.如果只有1个哨兵 最后面的1是无所谓的。状态会是sdown(主观下线状态)。
sentinel monitor mymaster 172.16.0.23
#(哨兵)进程判断服务器已经掉线所需的毫秒数
sentinel down-after-milliseconds mymaster
#在执行故障转移时,最多可以有多少个从服务器同时对新的主服务器进行同步,这个数字越小,完成故障转移所需的时间就越长。(一般设置为1)
sentinel parallel-syncs mymaster
#实现主从切换,完成故障转移的所需要的最大时间值。若Sentinel(哨兵)进程在该配置值内未能完成故障转移的操作(即故障时master/slave自动切换),则认为本次故障转移操作失败
sentinel failover-timeout mymaster ###############哨兵启动
/opt/redis/bin/redis-server /opt/redis/.conf --sentinel ###sping boot配置连接哨兵 spring.redis.database=xxx spring.redis.sentinel.master=mymaster
spring.redis.sentinel.nodes=10.150.0.104:26379,10.150.0.104:26380,10.150.0.105:26379
redis哨兵-5的更多相关文章
- Redis 哨兵模式实现主从故障互切换
200 ? "200px" : this.width)!important;} --> 介绍 Redis Sentinel 是一个分布式系统, 你可以在一个架构中运行多个 S ...
- redis哨兵配置
redis哨兵配置主从 redis哨兵的启动和redis实例的启动没有关系.所以可以在任何机器上启动redis哨兵.至少要保证有两个哨兵在运行,要不然宕机后哨兵会找不到主节点. 配置步骤: 1.在 ...
- redis哨兵配置主从
redis哨兵的启动和redis实例的启动没有关系.所以可以在任何机器上启动redis哨兵.至少要保证有两个哨兵在运行,要不然宕机后哨兵会找不到主节点. 配置步骤: 1.在redis的配置文件中添加鉴 ...
- redis单点、redis主从、redis哨兵sentinel,redis集群cluster配置搭建与使用
目录 redis单点.redis主从.redis哨兵 sentinel,redis集群cluster配置搭建与使用 1 .redis 安装及配置 1.1 redis 单点 1.1.2 在命令窗口操作r ...
- Redis哨兵
Redis Sentinel Redis哨兵为Redis提供高可用.这就意味着你用哨兵可以创建一个Redis部署,在没有人为干预的情况下抵抗某些失败.(PS:自动故障转移) Redis哨兵还提供其他的 ...
- redis哨兵架构的基础知识及部署和管理
一.前言 1.哨兵的介绍 sentinal,中文名是哨兵 哨兵是redis集群架构中非常重要的一个组件,主要功能如下 ()集群监控,负责监控redis master和slave进程是否正常工作 ()消 ...
- Redis 哨兵
作用 Redis Sentinel,即Redis哨兵,在Redis 2.8版本开始引入. 主要提供了配置提供者,通知,哨兵的监控和自动故障转移功能.哨兵的核心功能是主节点的自动故障转移. 下面是Red ...
- SpringBoot整合redis哨兵主从服务
前提环境: 主从配置 http://www.cnblogs.com/zwcry/p/9046207.html 哨兵配置 https://www.cnblogs.com/zwcry/p/9134721. ...
- redis 哨兵模式 Connection refused
spring整合redis哨兵,修改了bind ,protected 任然连接拒绝,是因为哨兵的mastername 和spring里面的名称不一致..导致拒绝了...... 哨兵模式配置文件 属性 ...
- redis 哨兵(sentinel)
redis哨兵 哨兵自动故障转移 自动通知应用最新master信息 无需担心,master挂了,程序不需要修改IP啥的,由哨兵自动完成 修改sentinel.conf protected-mode n ...
随机推荐
- firefox SSL_ERROR_RX_RECORD_TOO_LONG burpsuit 报错 解决方案
禁用TLS 1.3 .在Firefox的地址栏中输入“ about:config ”. .在搜索条目“tls.version.max ”.将值从4更改为3. .值4所表示TLS 1.3,3个代表TLS ...
- curl 和 wget 命令
1. curl curl 支持 HTTP.HTTPS.FTP 等协议,还支持 POST.cookies.认证.从指定偏移处下载部分文件.User-Agent.限速.文件大小.进度条等特征. 1.1 选 ...
- netcore之mysql中文乱码问题解决记录
尝试了netcore代码里面设置基本无效了 https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core- ...
- 正则表达式从入门到放弃「Java」
正则表达式能做什么? 正则表达式可以用来搜索.编辑或处理文本. 「都懂它可以处理文本,可到底是怎么回事?」 正则表达式的定义 百度百科:正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特 ...
- [Codeforces 865C]Gotta Go Fast(期望dp+二分答案)
[Codeforces 865C]Gotta Go Fast(期望dp+二分答案) 题面 一个游戏一共有n个关卡,对于第i关,用a[i]时间通过的概率为p[i],用b[i]通过的时间为1-p[i],每 ...
- P5030 长脖子鹿放置
题目背景 众周所知,在西洋棋中,我们有城堡.骑士.皇后.主教和长脖子鹿. 题目描述 如图所示,西洋棋的"长脖子鹿",类似于中国象棋的马,但按照"目"字攻击,且没 ...
- python学习第三十天函数的形参,实参及函数文档
python函数的形参是定义函数def 函数名 小括号里面的变量,实参是调用函数时候的值,函数文档是提供函数功能的开发文档,下面 详细说明系列方法 1,函数的形参 def chan(name): pr ...
- Maven入门指南10:Maven的生命周期和插件
一个完整的项目构建过程通常包括清理.编译.测试.打包.集成测试.验证.部署等步骤,Maven从中抽取了一套完善的.易扩展的生命周期.Maven的生命周期是抽象的,其中的具体任务都交由插件来完成.Mav ...
- 攻防世界--insanity
测试文件:https://adworld.xctf.org.cn/media/task/attachments/d2a7dde552e647688230e80b2767b912 1.准备 获得信息: ...
- XMPP即时通讯协议使用(三)——订阅发布、断开重连与Ping
package com.testV3; import java.util.List; import org.jivesoftware.smack.ConnectionListener; import ...