在windows中配置Redis Sentinel 环境

mac2022-07-05  15

一、修改配置文件

在Redis解压包的同级目录下,新建如下文件夹

将Redis6379【Redis解压包】中的文件全部复制到新建的三个文件夹中,并且将新建的三个文件夹中的redis.windows.conf文件修改成和文件夹名字一样,redis6380.conf、redis6381.conf、sentinel26379.conf

1、将redis6380.conf 和redis6381.conf文件中的port 分别修改成6380和6381  

2、将redis6380.conf 和redis6381.conf文件中的bind 127.0.0.1. 这一行末尾的.去掉,如果没有则不用去

3、将redis6380.conf 和redis6381.conf文件中的# slaveof 这一行去掉,修改成 slaveof 127.0.0.1 6379

4、将sentinel.conf文件清空,替换成下面的字符串【注意:开头不能有空格之类的】

port 26379dir ./sentinel monitor redisservice6379 127.0.0.1 6379 1sentinel down-after-milliseconds redisservice6379 30000sentinel parallel-syncs redisservice6379 1sentinel failover-timeout redisservice6379 180000

二、将服务端启设置为服务后,启动

注意启动的顺序:master=>slave =>sentinel

Redis的服务启动参照 这一篇的内容

分别将3个redis服务端,都启动后,启动sentinel服务端

在命令行中先进入sentinel文件目录:

redis-server.exe sentinel26379.conf --sentinel

就可以启动sentinel服务端了,也可以将这个设置成服务

 有关Redis的一些操作及介绍可以看这个系列的文章

 

转载于:https://www.cnblogs.com/zyc19910109/p/8351897.html

相关资源:windows下的redis-sentinel集群配置(非常难得哦)
最新回复(0)