mant1988 / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Unable to connect redis running on fedora 14 linux from windows client #478

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using redis 2.2.1 and my operation system is fedora 14.

I started redis on fedora and then try to connect it from windows using a tiny 
programme written by myself. But I got an error saying "connection time out", 
when I try to connect redis from fedora with the same programme, this time it 
worked!

Just connect redis from windows will reproduce the problem.

Here is the stack trace:
java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at com.test.redis.RedisClientMain.main(RedisClientMain.java:17)

Original issue reported on code.google.com by lamusico...@gmail.com on 5 Mar 2011 at 7:48

GoogleCodeExporter commented 8 years ago
You did not give much details ...

Here are a few points you may want to check:
 - which Java client do you use? Is it your own?
 - How about using an existing client first? (Jedis for instance)
 - Please attach your small program
 - Please check that Redis is listening on a port (and not only on a Unix socket)
 - Can you connect from Windows directly by using telnet?
   For instance; assuming you use the default port for Redis

telnet <your ip address> 6379
*1
$4
INFO

*1                                                                              

$4                                                                              

QUIT

 - If telnet does not work you may want to check your connectivity, firewall
   configuration, etc ...

Regards,
Didier.

Original comment by didier...@gmail.com on 5 Mar 2011 at 9:08

GoogleCodeExporter commented 8 years ago
It's my own java client. Jedis didn't work so I made one but it failed as well 
as telnet. Now I'm going to check whether Redis's listening only on a Unix 
socket.

Original comment by lamusico...@gmail.com on 5 Mar 2011 at 11:46

GoogleCodeExporter commented 8 years ago
Redis is listening on tcp socket. The small programme only create a socket to 
connect <host port>, it worked in linux and failed in windows. BTW, telnet 
failed too...

Original comment by lamusico...@gmail.com on 5 Mar 2011 at 12:13

GoogleCodeExporter commented 8 years ago
Well, if telnet fails too, it means you have some kind
of connectivity problems between your two boxes
(at least for the port Redis listen to).

My advice is to start with stuff like ping, tracert, etc ...
and then check the firewall/security configuration of your
machines (both machines).

Original comment by didier...@gmail.com on 5 Mar 2011 at 12:56

GoogleCodeExporter commented 8 years ago
Now I fixed the problem. I forgot to have the port redis listen to included in 
the firewall configuration... What a silly mistake..

Original comment by lamusico...@gmail.com on 6 Mar 2011 at 4:59

GoogleCodeExporter commented 8 years ago

Original comment by pcnoordh...@gmail.com on 6 Mar 2011 at 2:06