hi, The following is in redis3.2 conf file.
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 127.0.0.1
But when i comment the line of bind,redis server can not start.this is a bug for 3.2.0?.This is err info:Creating Server TCP listening socket *:6700: unable to bind socket
Comment From: HashJang
Is the provided socket(ip:port) in used? or temporially unaccessible?
Comment From: zhangheng0527
This error appear in redis3.2.0 only and i can start the redis server in other version(such as 2.8.24 or 3.0.7).
@HashZhang when you comment the bind line,you can start the redis server in 3.2.0?
Comment From: antirez
Hello, this error means that Redis is unable to bind both the ipv6 and ipv4 address in your host, since port 6700 is already busy in one of the two addresses (probably the IPv6 one).
Try the following:
telnet ::1 6700
And see if indeed, even if Redis is not running, you can talk with some service.
You are seeing this only in 3.2.0 since a bug was fixed where previously the instance would start just binding a single interface, causing a lot of confusion, since the same port was then bound to different services depending on which address you contact it.
Comment From: zhangheng0527
Thanks, i find the reason why we can not start the redis server,we disable the NETWORKING_IPV6.
Comment From: antirez
You are welcome @zhangheng0527
Comment From: tegansnyder
Thanks for sharing this information. Out of the box I had the same issue trying to bind on all interfaces. My log showed:
2336:M 26 May 14:02:42.581 # Creating Server TCP listening socket *:6379: unable to bind socket
After add changing the configuration to bind directly to the appropriate interface it worked.
Comment From: Lynn7777777
perfect!
Comment From: otheus
I'm sorry, but this is still a bug. It fails to bind to the socket and immediately quits. IPV6 is not loaded on my system. (RHEL6 with iPV6 disabled). Even with IPV6, this shouldn't happen.
A workaround is to use:
bind 0.0.0.0
But frankly, it's still a bug.
Comment From: urosgruber
I lost an hour because of this issue. We also disabled ipv6 and without specifying bind address redis wont start. Probably because it can't bind to ipv6 socket. Can this be fixed?
Comment From: lin2code
i got the same issue, turn out it's LSP problem, must be the damn game edit it.
Comment From: dequn
@otheus works.
Comment From: emin63
Apologies if this is solved but I seem to be having a similar issue.
When trying to start redis via something like /etc/init.d/redis-server start I get an error in /var/log/redis/redis-server.log of the form # Creating Server TCP listening socket ::1:6379: bind:
Cannot assign requested address. When I start redis manually via redis-server things work fine because I believe the default configuration file is not read.
When I change the line that reads
bind 127.0.0.1 ::1
in /etc/redis.conf to remove the ::1, then I can use /etc/init.d and things work fine.
I guess maybe this is intended behavior but it's pretty confusing to someone who doesn't use redis regularly. Hopefully this post will help others having a similar issue.
Comment From: BrunIF
sed -i '/^bind/s/bind.*/bind 0.0.0.0/' /etc/redis/redis.conf
after
service redis-server restart
# or
systemctl restart redis-derver
Comment From: mmstick
Just ran across this issue trying to install redis on Pop!_OS (Ubuntu) 18.10.
Comment From: ketanpokar
Thank you @otheus. That worked.
Comment From: Blueshawk
You might think almost ten years of hints might cause devs to consider the obvious answer here. Remove that ::1 from your default bind. Few users think defaulting the server to DMZ mode via IPV6 is a good idea and so we all get tripped up at install. Also, unrelated. please check your install scripts permission/user setup. It's a mess for ubuntu types.(sorry no time to make issues today) :)