Could not open connection to the host, on port [6379]: Connect failed

2,475 views
Skip to first unread message

san...@antfarm.in

unread,
Jul 11, 2014, 4:53:03 AM7/11/14
to redi...@googlegroups.com
Hello Experts,

I have installed Redis 2.4.10  on my Centos 6.3 VM on Xenserver 6.2.0

I have installed Redis using below tutorial.

Installation has done successfully, but i am not able to access redis from remote server.

I have commented 'bind 127.0.0.1' in /etc/redis.conf

Also i have disabled firewall on redis server.

Still i m not able to access redis from remote machine.

PFB nmap report from remote machine to redis server.
[root@localhost ~]# nmap 192.168.2.14

Starting Nmap 5.51 ( http://nmap.org ) at 2014-07-11 13:16 IST
Nmap scan report for 192.168.2.14
Host is up (0.00036s latency).
Not shown: 998 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
111/tcp open  rpcbind
MAC Address: 8A:56:A4:AA:81:CB (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 1.17 seconds

As per nmap report redis server port 6379 is not opened on redis server.

Also i have checked that redis service is properly running on redis server.
PFB netstat report of redis server.
[root@localhost ~]# netstat -a | egrep 'Proto|LISTEN'
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:33801                     *:*                         LISTEN
tcp        0      0 *:6379                      *:*                         LISTEN
tcp        0      0 *:sunrpc                    *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN
tcp        0      0 *:sunrpc                    *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN
tcp        0      0 *:57210                     *:*                         LISTEN
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     6930   @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     8299   /var/run/rpcbind.sock

Please help.

Regards
Santosh

Josiah Carlson

unread,
Jul 11, 2014, 5:22:18 PM7/11/14
to redi...@googlegroups.com
First, unless you need to run that specific version of Redis, I would recommend upgrading to the latest stable version: 2.8.12 .

Second, have you tried running redis-cli on the same machine to see if you can access Redis locally?

Third, nmap does not scan Redis by default. If I understand the docs correctly, nmap only scans the 1000 most likely listening services based on the contents of 'nmap-services', and checking the most recent revision of that file in the nmap repository, port 6379 isn't even listed (it's also not listed in the nmap-services that comes with version 5.21, which is the default available in the repositories for Ubuntu 12.04).

Fourth, have you tried running "redis-cli -h 192.168.2.14" on a machine that can otherwise ssh into your server? Or if you don't have redis-cli installed, have you tried running "telnet 192.168.2.14 6379"?

Finally, I'm not sure that you are having any problems at all, aside from not knowing how to test your Redis connectivity. Why? You've not shown any example that should have connected but didn't. Which suggests to me that you have a testing methodology problem, not a Redis problem.

 - Josiah





--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages