Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

redis-server in ubuntu14.04: Bind address already in use

I started redis server on ubuntu by typing this on terminal: $redis-server

This results in following > http://paste.ubuntu.com/12688632/

aruns ~ $ redis-server 27851:C 05 Oct 15:16:17.955 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf 27851:M 05 Oct 15:16:17.957 # You requested maxclients of 10000 requiring at least 10032 max file descriptors. 27851:M 05 Oct 15:16:17.957 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted. 27851:M 05 Oct 15:16:17.958 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'. 27851:M 05 Oct 15:16:17.958 # Creating Server TCP listening socket *:6379: bind: Address already in use 

How can I fix this problem, it there any manual or automated process to fix this binding.

like image 742
aruns Avatar asked Oct 05 '15 11:10

aruns


People also ask

How do I fix my address already in use?

The Error “address already in use” occurred because some process was already running on the same port. So we can resolve the issue just by killing the process. To stop the process, we need the process ID (PID), which we can fetch using the lsof command.

What is bind in redis?

It binds the redis instance to specific interface (and hence specific ip address). Basically your redis server will only listen to connections made to the address specified in via the bind option. This is a security measure that allows for dropping connections not made inside the particular network.

How do I change the default port for redis?

You can edit the Redis server configuration file and specify the startup port to make the changes permanent. Locate the entry as shown below and change the value to your desired port. Once you set your desired port, save and close the file. Next, restart the Redis service to apply the changes.

How do I turn off redis on Mac?

Stopping the Redis Server If you started the Redis server using the redis-server command, you could stop the Redis server by pressing CTRL + C.


1 Answers

$ ps aux | grep redis 

Find the port that its running on.. In my case..

MyUser  8821   0.0  0.0  2459704    596   ??  S    4:54PM   0:03.40 redis-server *:6379 

And then close the port manually

$ kill -9 8821 

Re-run redis

$ redis-server 
like image 125
SerKnight Avatar answered Oct 19 '22 14:10

SerKnight