从命令行关闭 redis-server [英] shutdown redis-server from command line
问题描述
我正在尝试从 redis-cli 关闭我的 redis-server.每当我从客户端发出命令时,我都会收到错误(错误)需要 NOAUTH 身份验证".我试过命令SHUTDOWN"和SHUTDOWN NOSAVE".
I am trying to shutdown my redis-server from a redis-cli. Whenever I issue a command from a client I receive the error "(error) NOAUTH Authentication required." I have tried the commands "SHUTDOWN" and "SHUTDOWN NOSAVE".
我也尝试过从另一个终端窗口redis-server stop",但收到错误#致命错误,无法打开配置文件‘停止’"
I have also tried "redis-server stop" from another terminal window but received the error "# Fatal error, can't open config file 'stop'"
如何关闭此服务器?(我在 OSX 上).
How can I shut down this server? (I am on OSX).
推荐答案
您的 Redis 服务器显然配置了密码.因此,在使用 redis-cli 时,您需要在任何其他命令之前发出 AUTH password
命令,否则您将收到该错误消息(将 password
替换为您服务器的密码).
Your Redis server is configured with a password apparently. Therefore, when using redis-cli, you'll need to issue the AUTH password
command before any other command or else you'll be getting that error message (replace password
with your server's password).
或者,您可以使用 -a
开关和密码来调用 redis-cli
以获得相同的结果.
Alternatively, you can invoke redis-cli
with the -a
switch followed by your password for the same result.
要查找服务器的密码,请打开 Redis 配置文件(默认为 /etc/redis/6379.conf
)并查找以 requirepass
开头的行- 旁边的任何值都是密码.
To find the password of your server, open the Redis configuration file (by default /etc/redis/6379.conf
) and look for the line starting with requirepass
- whatever value is next to it, is the password.
这篇关于从命令行关闭 redis-server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!