Redis binds multiple listening IPs or unbind

Source: Internet
Author: User

If a system port 6379 is bound to listen on ip127.0.0.1, the port will only deny connections to non-listening IP hosts through connection requests from this IP.

Telnet 10.10.86.211 9000
Trying 10.10.86.211 ...
Telnet:connect to address 10.10.86.211:connection refused

Another reason: firewall interception. (only need to release the corresponding host IP in the firewall of the Telnet server, the port can be)


If the port is bound to listen to IP, which causes connection refused, the analysis resolves:

[Email protected] xinetd.d]# NETSTAT-ANP |grep 6379

TCP 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 12159/redis-server

TCP 0 0 127.0.0.1:40345 127.0.0.1:6379 established 14735/python

TCP 0 0 127.0.0.1:6379 127.0.0.1:40337 established 12159/redis-server

TCP 0 0 127.0.0.1:6379 127.0.0.1:40335 established 12159/redis-server

TCP 0 0 127.0.0.1:40339 127.0.0.1:6379 established 14735/python

TCP 0 0 127.0.0.1:40343 127.0.0.1:6379 established 14735/python

TCP 0 0 127.0.0.1:40347 127.0.0.1:6379 established 14735/python

TCP 0 0 127.0.0.1:6379 127.0.0.1:40345 established 12159/redis-server

6379 Port monitoring Local address 127.0.0.1

or modify the configuration document (e.g. REDIS,/ETC/REDIS.CNF)

Vim/etc/redis.cnf

Bind 127.0.0.1 before adding #, the 6379 port will not only listen on the local IP


$ telnet 10.10.86.211 6379

[Email protected] xinetd.d]# NETSTAT-ANP |grep 6379

TCP 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 12341/redis-server

TCP 0 0 10.10.86.211:6379 10.10.86.200:52808 established 12341/redis-server

TCP6 0 0::: 6379:::* LISTEN 12341/redis-server

TCP6 0 0:: 1:6379:: 1:54007 established 12341/redis-server

TCP6 0 0:: 1:6379:: 1:54009 established 12341/redis-server

TCP6 0 0:: 1:54009:: 1:6379 established 14735/python

TCP6 0 0:: 1:6379:: 1:54005 established 12341/redis-server

TCP6 0 0:: 1:54006:: 1:6379 established 14735/python

TCP6 0 0:: 1:6379:: 1:54008 established 12341/redis-server

Show other IPs can telnet the server to that port.



Redis binds multiple listening IPs or unbind

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.