Home > Database > Redis > body text

Reasons and solutions for redis exceptions

王林
Release: 2021-03-15 09:34:29
forward
4349 people have browsed it

Reasons and solutions for redis exceptions

The following are redis exception problems encountered at work, and the reasons and solutions for the exceptions are given at the end of the article. I hope it will be helpful to everyone.

Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
at redis.clients.jedis.Connection.connect(Connection.java:155)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:83)
at redis.clients.jedis.Connection.sendCommand(Connection.java:94)
at redis.clients.jedis.Connection.sendCommand(Connection.java:89)
at redis.clients.jedis.BinaryClient.auth(BinaryClient.java:539)
at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2000)
at com.cheguanjia.test.Jdeis.main(Jdeis.java:20)
Copy after login
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
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:149)
... 6 more
Copy after login

The reason for the exception:

The firewall of the liunx server does not allow port 6379 to be accessed from the external network

Solution:

vim   /etc/sysconfig/iptables
Copy after login

Related recommendations: redis database tutorial

The above is the detailed content of Reasons and solutions for redis exceptions. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template