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.
systemd, ubuntu 16.04:
One thing to check if the redis commands are not working for you is if your redis-server.pid is actually being created. You specify the location of where this file is in
and it should have a section that looks something like this:
Check the location and permissions of the PIDFile directory (in my case, '/run/redis'). I was trying to restart the service logged in as deploy but the directory permissions were listed as
drwxrwsr-x 2 redis redis 40 Jul 20 17:37 redis
If you need a refresher on linux permissions, check this out. But the problem was I was executing the restart as my deploy user which the permissions above are r-x, not allowing my user to write to the PIDFile directory.
Once I realized that, I logged in using root, reran the restart command on the redis (
service redis restart
) and everything worked. That was a headache but hopefully this saves someone a little time.For osx I created the following aliases for starting and stopping redis (redis installed with homebrew):
This has worked great for me for local development.