【发布时间】:2016-12-02 02:51:34
【问题描述】:
在向 Sentinel 添加 master 时,我总是通过编辑 sentinel.conf 添加条目,但我经常发现应用程序正在被另一个用户 (Sentinel) 重写。
我想知道是否有更合适和更有效的方式将主机添加到 Sentinel,而无需手动编辑配置文件。
【问题讨论】:
标签: redis sentinel redis-sentinel
在向 Sentinel 添加 master 时,我总是通过编辑 sentinel.conf 添加条目,但我经常发现应用程序正在被另一个用户 (Sentinel) 重写。
我想知道是否有更合适和更有效的方式将主机添加到 Sentinel,而无需手动编辑配置文件。
【问题讨论】:
标签: redis sentinel redis-sentinel
您可以配置 sentinel 以在运行时监控新的 master。
例子:
SENTINEL MONITOR {cluster_name} {master_ip} {master_port} {quorum}
SENTINEL SET {cluster_name} auth-pass {password}
SENTINEL FLUSHCONFIG # Force Sentinel to rewrite its configuration file
有关更多信息,请查看 Redis Sentinel 文档: https://redis.io/topics/sentinel#reconfiguring-sentinel-at-runtime
希望有帮助!
【讨论】: