-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsentinel.conf
35 lines (29 loc) · 1.46 KB
/
sentinel.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Sentinel.conf
# 端口号
port 26379
# 配置哨兵的监控参数
# 格式:sentinel monitor <mastername> <masterip> <masterport> <quorum>
# mastername 是为这个被监控的 master 起的名字
# masterip 是被监控的 master 的 IP 或主机名。因为 Docker 容器之间可以使用容器名访问,所以这里写 master 节点的容器名
# masterport 是被监控节点所监听的端口号
# quorom 设定了当几个哨兵判定这个节点失效后,才认为这个节点真的失效了
sentinel myid 3af4477184a27c5cd2b8cffe777305a3e84253a3
# 连接主节点的密码
# 格式:sentinel auth-pass <master-name> <password>
# sentinel auth-pass 172.20.0.7 redis
# master 在连续多长时间无法响应 PING 指令后,就会主观判定节点下线,默认是 30s
# 格式:sentinel down-after-milliseconds <mastername> <milliseconds>
sentinel deny-scripts-reconfig yes
# 日志文件
logfile "/var/log/redis/sentinel.log"
# Generated by CONFIG REWRITE
dir "/data"
sentinel monitor redis-master 172.20.0.8 6379 2
sentinel down-after-milliseconds redis-master 20000
sentinel config-epoch redis-master 1
sentinel leader-epoch redis-master 1
sentinel known-replica redis-master 172.20.0.4 6379
sentinel known-replica redis-master 172.20.0.9 6379
sentinel known-sentinel redis-master 172.20.0.9 26379 bbc97991cae04a23433d114fb5550212b8c511f8
sentinel known-sentinel redis-master 172.20.0.4 26379 f84599e4178829e48714ca7a1418db972414b34c
sentinel current-epoch 1