1. 配置文件 sentinel.conf
daemonize yes # 是否守护进程启动 pidfile "/var/run/redis-sentinel-26379.pid" # pid文件 logfile "26379.log" # 日志文件 dir "/usr/local/src/redis/redis-5.0.7/data" # 工作空间 sentinel monitor mymaster 127.0.0.1 6379 2 # redis 主节点的 ip 和端口
2. 启动服务
redis-sentinel sentinel.conf
3. 最少启动 3 个 sentinel 服务
修改配置文件
spring.redis.sentinel.master=mymaster
spring.redis.sentinel.nodes=127.0.0.1:26379,127.0.0.1:26380,127.0.0.1:26381
原文:https://www.cnblogs.com/libra0920/p/12084047.html