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 following:
Opening port: bind: Address already in use
I can't figure out how to stop this server and start a new one.
Is there any command I can append to redis-server
when I'm typing in the CLI?
My OS is Ubuntu 10.04.
Another way could be :
Option 1: go to redis installation directory and navigate to
src
, in my case :where 6379 is the default port.
Option 2: find redis process and kill
And Then initiate kill:
I'm using Centos 6.7 , x86_64
hope it helps
On MacOSX,
This is what worked for me
Another way could be:
Works on *NIX & OSX
I don't know specifically for redis, but for servers in general:
What OS or distribution? Often there will be a stop or /etc/init.d/... command that will be able to look up the existing pid in a pid file.
You can look up what process is already bound to the port with
sudo netstat -nlpt
(linux options; other netstat flavors will vary) and signal it to stop. I would not usekill -9
on a running server unless there really is no other signal or method to shut it down.Usually this problem arises after I shut down my computer ( or leaving running ) an irregular way.. I believe the port gets stuck open, while the process stops but continues to be bound to the previous port.
9/10 times the fix can be:
Good to go.