首页 > 其他 > 详细

Redis 学习-Redis Sentinel

时间:2019-12-23 16:53:48      阅读:103      评论:0      收藏:0      [点我收藏+]

一、启动服务

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 服务

 

二、SpringBoot 集成 sentintl

修改配置文件

spring.redis.sentinel.master=mymaster
spring.redis.sentinel.nodes=127.0.0.1:26379,127.0.0.1:26380,127.0.0.1:26381

 

Redis 学习-Redis Sentinel

原文:https://www.cnblogs.com/libra0920/p/12084047.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!