Redis-server in ubuntu14.04: binding address is already in use

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

This leads to the 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, there is some kind of manual or automated process to fix this binding.

+17
source share
9 answers
 $ ps aux | grep redis 

Find the port where it works .. In my case ..

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

Then close the port manually

 $ kill -9 8821 

Re-run redis

 $ redis-server 
+55
source

for me, after many problems, this solved my problem:

 root@2c2379a99b47 :/home/ ps -aux | grep redis redis 3044 0.0 0.0 37000 8780 ? Ssl 14:59 0:00 /usr/bin/redis-server *:6379 

after finding redis, kill him!

 root@2c2379a99b47 :/home# sudo kill -9 3044 root@2c2379a99b47 :/homek# sudo service redis-server restart Stopping redis-server: redis-server. Starting redis-server: redis-server. root@2c2379a99b47 :/home# sudo service redis-server status redis-server is running 
+12
source

I read the documentation at http://www.redis.io , opened the redis.conf file to configure redis-server , it is located at /etc/redis/redis.conf

 $ sudo subl /etc/redis/redis.conf 

Instead of a sublime editor, you can use the editor of your choice, namely. nano, vi, emacs, vim, gedit.

In this file, I uncommented #bind 127.0.0.1 . Therefore, instead of 0.0.0.0:6379 now its 127.0.0.1:6379

Reboot the Redis server

 $ sudo service redis-server restart 

It will indicate that the server is ready to accept connections through port 6379

This will raise your server. For more detailed configuration and settings, you can monitor this redis server in Ubuntu.

+7
source

I solved this problem on a Mac by simply typing redis-cli shutdown, after that just reopen the terminal and enter redid-server and it will work.

+3
source

I prefer to use the param -ef ,

 ps -ef|grep redis 

-ef means

 -A Display information about other users' processes, including those without controlling terminals. -e Identical to -A. -f Display the uid, pid, parent pid, recent CPU usage, process start time, controlling tty, elapsed CPU usage, and the associated com- mand. If the -u option is also used, display the user name rather then the numeric uid. When -o or -O is used to add to the display following -f, the command field is not truncated as se- verely as it is in other formats. 

then kill pid

 kill -9 $pid 
+2
source
 sudo service redis-server stop 
+2
source

So, as they say, the process is already running, so it is best to stop it, analyze and restart it, and then run the following commands:

 redis-cli ping #should return 'PONG' 

And this solved my problem:

 $ ps -ef |grep redis root 6622 4836 0 11:07 pts/0 00:00:00 grep redis redis 6632 1 0 Jun23 ? 04:21:50 /usr/bin/redis-server *:6379 

Find the redis process and stop it!

 $ kill -9 6632 $ service redis restart Stopping redis-server: [ OK ] Starting redis-server: [ OK ] $ service redis status 

Otherwise, if all this does not work, just try typing redis-cli

Hope it helps :)

+1
source

You can try

$ make

then

$ sudo cp src/redis-cli /usr/local/bin/ on the terminal to install the redis and it redis-cli commands.

finally, you can use the redis-cli shutdown . Hope this answer can help you.

+1
source

Killing the process that started after booting into the OS worked for me. To prevent redis from starting when launched on Ubuntu OS:

 sudo systemctl disable redis-server 
0
source

Source: https://habr.com/ru/post/1232968/


All Articles