1

So I'm trying to use my redis from another machine (just like here). It seems like I have to specify the ips from which redis is accessible. Following prior suggestions, I created a configuration file:

bind 0.0.0.0 127.0.0.1  

which I load when running the server: redis-server redis.config

The issue is that I am getting the following error:

[4323] 25 Jan 14:12:00.770 # Creating Server TCP listening socket 0.0.0.0:6379: bind: Address already in use

I tried it on two machines and got the same error on both of them. Any ideas where I'm going wrong?

Community
  • 1
  • 1
Daniel
  • 5,839
  • 9
  • 46
  • 85

1 Answers1

3

Since 0.0.0.0 already contains 127.0.0.1, there is a collision, so you can't bind to both - and you shouldn't, it is meaningless.

binding to 0.0.0.0 means "listen from all addresses on all interfaces", which includes 127.0.0.1, thus making it reundant.

What you should do is one of either:

  1. listen on specific interfaces you trust.

  2. listen on 0.0.0.0 but PLEASE MAKE SURE that the port on your firewall is closed and the redis port cannot be reached from the outside world.

Not_a_Golfer
  • 47,012
  • 14
  • 126
  • 92
  • So just `bind 0.0.0.0` should be enough? – Daniel Jan 25 '17 at 22:11
  • @Daniel yes but please please please make sure that a. you have a properly configured firewall or AWS security group, etc, and your instance cannot be reached from outside your servers. and b. that redis is in "safe mode" – Not_a_Golfer Jan 25 '17 at 22:20
  • Actually I have the same error when I'm using `bind 0.0.0.0`. You think it might be a firewall issue? – Daniel Jan 25 '17 at 22:26
  • more likely another running redis instance on the server? run `ps ax | grep redis` and see – Not_a_Golfer Jan 25 '17 at 22:53