【问题标题】:How to start `redis-sentinel` server successfully如何成功启动`redis-sentinel`服务器
【发布时间】:2018-11-11 02:42:41
【问题描述】:

对不起这里的redis新手。

当我运行redis-sentinel

42533:X 10 Nov 21:21:30.345 # Warning: no config file specified, using 
the default config. In order to specify a config file use redis- 
sentinel /path/to/sentinel.conf
42533:X 10 Nov 21:21:30.346 * Increased maximum number of open files to 
10032 (it was originally set to 7168).
Redis 3.0.4 (00000000/0) 64 bit

Running in sentinel mode
Port: 26379
PID: 42533
http://redis.io

42533:X 10 Nov 21:21:30.347 # Sentinel runid is 
733213860cf470431c7441e5d6aaf9ed9b2d7c2f
42533:X 10 Nov 21:21:30.347 # Sentinel started without a config file. 
Exiting...

我错过了什么?我需要配置文件吗?如果是这样,我的/path/to/sentinel.conf 应该在哪里?

【问题讨论】:

    标签: redis redis-sentinel redis-server


    【解决方案1】:

    运行 Sentinel 时必须使用配置文件,因为系统将使用该文件来保存当前状态,以便在重启时重新加载。如果没有给出配置文件或配置文件路径不可写,Sentinel 将直接拒绝启动。

    您可以使用以下命令行运行 Sentinel:

    redis-sentinel /path/to/sentinel.conf
    

    否则你可以直接使用 redis-server 可执行文件以 Sentinel 模式启动它:

    redis-server /path/to/sentinel.conf --sentinel
    

    您可以将文件放在您想要的任何位置,只需确保为此提供正确的路径。例如,如果你在 linux 中并且文件在你的主目录中,那么命令将是

    redis-sentinel ~/sentinel.conf
    

    【讨论】:

    • 非常感谢。我能够通过以下结果做到这一点,一切看起来都好吗? # Sentinel sentinel_masters:1 sentinel_tilt:0 sentinel_running_scripts:0 sentinel_scripts_queue_length:0 master0:name=mymaster,status=odown,address=127.0.0.1:6666,slaves=2,sentinels=1 Status = odown 是否正确?我仍然没有可用的哨兵。 (Redis::CannotConnectError) 来自我的 rails 应用程序,但这可能是因为我在 rails 中的配置错误
    • 如果我想让哨兵在系统启动时启动怎么办@monzurul
    猜你喜欢
    • 1970-01-01
    • 2016-06-12
    • 2017-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-05
    • 1970-01-01
    • 2017-02-10
    相关资源
    最近更新 更多