Stop redis server. Neither shutdown nor stop works

2020-05-17 03:01发布

I want to stop the redis server and it just keeps going and going. I am using redis-2.6.7

Check that it is running:

redis-server

It says "...bind: Address already in use" so it is already running.

I have tried

redis-cli
redis 127.0.0.1:6379> shutdown

It just hangs and nothing happens. I break out and check, yes, it is still running.

I have tried

redis-server stop

I get "can't open config file 'stop'"

I tried:

killall redis-server

Still running.

The reason that I want to stop it is that it is just hanging when I try to set or get a value via Python. So I thought that I would restart it.

EDIT:

No commands seem to work from redis-cli. I also tried INFO and it just hangs.

标签: redis
12条回答
ら.Afraid
2楼-- · 2020-05-17 03:30
start redis: $REDIS_HOME/src/redis-server
stop redis: $REDIS_HOME/src/redis-cli shutdown

$REDIS_HOME where you have installed/extracted redis.

查看更多
在下西门庆
3楼-- · 2020-05-17 03:39

i think shutdown command can shutdown the redis server. Maybe strange,after typed shutdown command,the redis-cli does not exit.Meanwhile ,the server has shutdowned.

查看更多
Lonely孤独者°
4楼-- · 2020-05-17 03:40

Best way check pid of redis opened port :

lsof -i:<redis-port>

for default redis port

lsof -i:6379

kill -9 <pid>
查看更多
在下西门庆
5楼-- · 2020-05-17 03:41

Shutdown Redis Server $ redis-cli -a password -p 6379 shutdown

Start Redis Server $ sudo service redis_6379 start

It works on Ubuntu Server 14.04 x86 Redis v2.8.15.

查看更多
手持菜刀,她持情操
6楼-- · 2020-05-17 03:41

net stop redis

should do the trick

to start :

net start redis

see this https://stackoverflow.com/a/20153062

查看更多
Luminary・发光体
7楼-- · 2020-05-17 03:42

You use the following command to kill the running redis-server process.

ps aux |grep redis

This will list all the running processes for redis-server. Then you can use the following command to kill the redis processes

sudo kill <pid for redis>

sample here

sudo kill 7229 //for the above sample.
查看更多
登录 后发表回答