I apparently have a redis-server
instance running because when I try to start a new server by entering redis-server
, I\'m greeted with the followin
Option 1: go to redis installation directory and navigate to src
, in my case :
/opt/redis3/src/redis-cli -p 6379 shutdown
where 6379 is the default port.
Option 2: find redis process and kill
ps aux | grep redis-server
t6b3fg 22292 0.0 0.0 106360 1588 pts/0 S+ 01:19 0:00 /bin/sh /sbin/service redis start
t6b3fg 22299 0.0 0.0 11340 1200 pts/0 S+ 01:19 0:00 /bin/sh /etc/init.d/redis start
And Then initiate kill:
kill -9 22292
kill -9 22299
I'm using Centos 6.7 , x86_64
hope it helps
Another way could be :
brew services stop redis
Try killall redis-server
. You may also use ps aux
to find the name and pid of your server, and then kill it with kill -9 here_pid_number
.
If you know on what port it would be running(by default it would be 6379), you can use below command to get the pid of the process using that port and then can execute kill command for the same pid.
sudo lsof -i : <port> | awk '{print $2}'
the above command will give you pid.
kill <pid>
;
This would shutdown your server.
On MacOSX,
This is what worked for me
/etc/init.d/redis restart
/etc/init.d/redis stop
/etc/init.d/redis start
You can try this code:
sudo kill -9 $(ps aux | grep 'redis' | awk '{print $2}')