1

I always face the problem of having two instances of redis running in my login and also in the root like below

aarish@aarish:~/redis# tcp        0      0 0.0.0.0:6379            0.0.0.0:*                  LISTEN      2036/redis-server      


root@aarish:~/redis# tcp        0      0 0.0.0.0:6379            0.0.0.0:*                  LISTEN      2036/redis-server

So if I have to kill the server I have the overhead of having to kill both the instances of process i.e from my login and then as root. So can someone firstly why is this happening in the first place?

Aarish Ramesh
  • 6,745
  • 15
  • 60
  • 105
  • It is not possible to have two processes listening on the same port. Run `netstat -nltp` and you will see the PID of the Redis process. – VolenD Feb 17 '15 at 12:26
  • @user3584460 Ya I do that and I find the PIDs same for the user and server processes. If i sound ambiguous and unclear, please refer the below comments and see if that helps – Aarish Ramesh Feb 17 '15 at 13:06

2 Answers2

2

I observed this as well. It seems that redis forks itself when dumping the data to disk. You can configure when this happens in the redis config (if you think it is happening too often).

The second process should go away after the dump is complete.

chaimp
  • 16,897
  • 16
  • 53
  • 86
1

The question is sort of ambiguous,

Are you having two instances running simultaneously ?

If yes, then check your redis config files /etc/redis there should be only one config file, if there are more, figure out why they are there, you probably will need to remove it from system startup as well.

If an instance of redis is running every time you are logging-in to some user, check the .bashrc for each user.

Need more help ? then provide some info, on what is you situation.

deimus
  • 9,565
  • 12
  • 63
  • 107
  • To be precise, even after killing the redis server from my login, the redis server keeps running in the root. Why does this happen? why is that the server is not killed even after killing it from my login? – Aarish Ramesh Feb 17 '15 at 13:02
  • 1
    When i try killing the server from my login and try restarting the server, I get address bind exception which is because of the server or instance running in the root. Thus only after killing the server from root also I am able to re-start the server. Why does this happen? – Aarish Ramesh Feb 17 '15 at 13:05