Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comment the line of bind,redis server can not start #3241

Closed
zhangheng0527 opened this Issue May 18, 2016 · 14 comments

Comments

Projects
None yet
@zhangheng0527
Copy link

zhangheng0527 commented May 18, 2016

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
@HashZhang

This comment has been minimized.

Copy link

HashZhang commented May 19, 2016

Is the provided socket(ip:port) in used? or temporially unaccessible?

@zhangheng0527

This comment has been minimized.

Copy link
Author

zhangheng0527 commented May 19, 2016

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?

@antirez

This comment has been minimized.

Copy link
Owner

antirez commented May 19, 2016

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.

@antirez antirez closed this May 19, 2016

@zhangheng0527

This comment has been minimized.

Copy link
Author

zhangheng0527 commented May 19, 2016

Thanks,
i find the reason why we can not start the redis server,we disable the NETWORKING_IPV6.

@antirez

This comment has been minimized.

Copy link
Owner

antirez commented May 19, 2016

You are welcome @zhangheng0527

@tegansnyder

This comment has been minimized.

Copy link

tegansnyder commented May 26, 2016

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.

@Lynn7777777

This comment has been minimized.

Copy link

Lynn7777777 commented Jun 24, 2016

perfect!

@otheus

This comment has been minimized.

Copy link

otheus commented Sep 6, 2016

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.

@urosgruber

This comment has been minimized.

Copy link

urosgruber commented Oct 5, 2016

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?

@631320085

This comment has been minimized.

Copy link

631320085 commented Dec 6, 2016

i got the same issue, turn out it's LSP problem, must be the damn game edit it.

@dequn

This comment has been minimized.

Copy link

dequn commented Dec 15, 2017

@otheus works.

@emin63

This comment has been minimized.

Copy link

emin63 commented Aug 13, 2018

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.

@BrunIF

This comment has been minimized.

Copy link

BrunIF commented Dec 6, 2018

sed -i '/^bind/s/bind.*/bind 0.0.0.0/' /etc/redis/redis.conf

after

service redis-server restart
# or 
systemctl restart redis-derver
@mmstick

This comment has been minimized.

Copy link

mmstick commented Dec 10, 2018

Just ran across this issue trying to install redis on Pop!_OS (Ubuntu) 18.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.