首页 新闻 会员 周边 捐助

java客户端就是连不上虚拟机的redis

1
悬赏园豆:5 [已解决问题] 解决于 2016-11-04 17:59

急,java客户端就是连不上虚拟机的redis? redis启着,防火墙也关了

 

Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect
at redis.clients.jedis.Connection.connect(Connection.java:164)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:80)
at redis.clients.jedis.Connection.sendCommand(Connection.java:100)
at redis.clients.jedis.BinaryClient.set(BinaryClient.java:97)
at redis.clients.jedis.Client.set(Client.java:32)
at redis.clients.jedis.Jedis.set(Jedis.java:68)
at com.aebiz.redis.RedisTest.main(RedisTest.java:12)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at redis.clients.jedis.Connection.connect(Connection.java:158)
... 6 more

孤独青鸟的主页 孤独青鸟 | 初学一级 | 园豆:150
提问于:2016-11-04 11:57
< >
分享
最佳答案
0

访问端口有没有开着?

 

----

加我微信214710841, 可以随时交流哦

收获园豆:5
小彬 | 小虾三级 |园豆:947 | 2016-11-04 16:23

找点原因了,bind 需要改成ip,不能用127.0.0.1

孤独青鸟 | 园豆:150 (初学一级) | 2016-11-04 17:54
其他回答(1)
0

bind改成ip,不要用127.0.0.1

孤独青鸟 | 园豆:150 (初学一级) | 2016-11-04 17:55

感谢!!

支持(0) 反对(0) 震灵 | 园豆:200 (初学一级) | 2018-02-04 21:50
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册