如何成功启动`redis-sentinel`服务器

时间:2018-11-11 02:42:41

标签: redis redis-sentinel redis-server

抱歉,在这里是新手。

我运行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应该在哪里?

1 个答案:

答案 0 :(得分:2)

在运行Sentinel时必须使用配置文件,因为系统将使用此文件来保存当前状态,以便在重启时重新加载。如果未提供配置文件或配置文件路径不可写,Sentinel只会拒绝启动。

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

redis-sentinel /path/to/sentinel.conf

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

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

您可以将文件放置在所需的任何位置,只需确保提供正确的路径即可。例如,如果您使用的是Linux,并且该文件位于主目录中,则该命令将为

redis-sentinel ~/sentinel.conf