From 9f421ded5a153502ac6c55947d2c73ff194625ec Mon Sep 17 00:00:00 2001 From: heibaiying <31504331+heibaiying@users.noreply.github.com> Date: Thu, 18 Jul 2019 17:57:23 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Redis=5F=E5=93=A8=E5=85=B5=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/Redis_哨兵模式.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notes/Redis_哨兵模式.md b/notes/Redis_哨兵模式.md index 8951df7..5931695 100644 --- a/notes/Redis_哨兵模式.md +++ b/notes/Redis_哨兵模式.md @@ -52,6 +52,7 @@ slaveof{newMasterIp} {newMasterPort} 哨兵模式的主要作用在于它能够自动完成故障发现和故障转移,并通知客户端,从而实现高可用。哨兵模式通常由一组 Sentinel 节点和一组(或多组)主从复制节点组成,架构如下:
+ ### 2.1 架构说明 #### 1. Sentinel 与 Redis Node @@ -180,9 +181,11 @@ redis-sentinel sentinel-26381.conf 使用 `ps -ef | grep redis` 命令查看进程,此时输出应该如下:
+ 可以使用 `info replication` 命令查看 Redis 复制集的状态,此时输出如下。可以看到 6379 节点为 master 节点,并且有两个从节点,分别为 slave0 和 slave1,对应的端口为 6380 和 6381。
+ 可以使用 `info Sentinel` 命令查看任意 Sentinel 节点的状态,从最后一句输出可以看到 Sentinel 节点已经感知到 6379 的 master 节点,并且也知道它有两个 slaves 节点;同时 Sentinel 节点彼此之间也感知到,共有 3 个 Sentinel 节点。
@@ -191,4 +194,4 @@ redis-sentinel sentinel-26381.conf ## 参考资料 1. 付磊,张益军 . 《Redis 开发与运维》. 机械工业出版社 . 2017-3-1 -2. 官方文档:[Redis Sentinel Documentation](https://redis.io/topics/sentinel) \ No newline at end of file +2. 官方文档:[Redis Sentinel Documentation](https://redis.io/topics/sentinel)