搭建哨兵架构(windows)

参考文章:Windows CMD常用命令大全(值得收藏)_cmd命令-CSDN博客

搭建哨兵架构:redis-server.exe sentinel.conf --sentinel
1.在主节点上创建哨兵配置
- 在Master对应redis.conf同目录下新建sentinel.conf文件,名字绝对不能错;

使用cd命令导航Redis-x64-3.2.100\sentinel目录

创建一个空的sentinel.conf文件命令:

echo. > sentinel.conf

搭建哨兵架构(windows)_第1张图片

2.配置哨兵,在sentinel.conf文件中填入内容:&&& 3.启动哨兵模式进行测试
- sentinel monitor 被监控数据库名字(自己起名字) ip port 1

redis-sentinel可执行文件没有单独提供。

在命令行中运行redis-server并指定配置文件为sentinel.conf来启动Redis Sentinel模式。在sentinel目录中创建一个名为sentinel.conf的配置文件,并在其中添加必要的配置选项。然后,使用以下命令启动Redis Sentinel:

# redis-server sentinel.conf --sentinel
sentinel monitor mymaster 172.0.0.1 6379 1

搭建哨兵架构(windows)_第2张图片

redis正在监视一个名为mymaster的主服务器。它检测到主服务器的故障,并尝试执行故障转移 。

然而,在尝试故障转移时,它发现没有可用的从服务器来接管主服务器的角色,因此故障转移被中止。

问题:

搭建哨兵架构(windows)_第3张图片

参考文章:

Windows下Redis哨兵模式搭建_redis 哨兵模式window搭建-CSDN博客

redis哨兵搭建(windows)_windows配置redis哨兵模式-CSDN博客

最终结果:

搭建哨兵架构(windows)_第4张图片

搭建哨兵架构(windows)_第5张图片

重要的两步:

分别在各文件夹下创建sentinel.conf文件

sentinel auth-pass mymaster 123456
#主服务有密码所以这也要配置

搭建哨兵架构(windows)_第6张图片

将主服务器6380那个重启。

问题:

搭建哨兵架构(windows)_第7张图片

故障转移失败的原因是主服务器要求进行身份验证,但从服务器未能提供有效的身份验证凭据。

masterauth


 

你可能感兴趣的:(架构)