从命令行关闭redis-server [英] shutdown redis-server from command line

查看:1467
本文介绍了从命令行关闭redis-server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从redis-cli关闭我的redis服务器。每当我从客户端发出命令时,我收到错误(错误)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服务器停止,但收到错误#致命错误,无法打开配置文件停止

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 命令,否则您将收到该错误消息(替换<$ c

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).

或者,您可以调用 redis-cli 使用 -a 开关,后跟您的密码以获得相同的结果。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆