This article originates from: http://blog.csdn.net/lulidaitian/article/details/51946169
A problem description appears:
1.Could not get a resource from the pool, Connection refused:connect
Windows Java side Client link is rejected, think about the problem
1.Vmware Linux installed Redis has started normally
2. In Windows with SSH Client link Linux can operate Redis
3. Turn on the Redis port and modify the firewall configuration file
Vi/etc/sysconfig/iptables
Join Port Configuration
-A rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 6379-j ACCEPT
Reload Rule
Service Iptables Restart
4. The IP of Linux can also be spelled through
Supposedly, it should be okay, use Telnet to test the lower port.
telnet 192.168.6.129 6379
The discovery port is not able to be spelled, but the other ports on Linux can be spelled, which means Redis has its own configuration problem.
Looked under the configuration file, found that the configuration file is bound to the local IP, this configuration will cause the other IP login is rejected, so we commented it out
The next test run, sent first has been linked, the problem solved, but there are new problems: DENIED Redis is running in protected mode because protected mode is enabled ...
The problem is that Redis is currently in protected mode, does not allow non-local client links, we can set a password to Redis, and then the client link, the time to write a password can be resolved
Commands for configuring Redis
Config set Requirepass 123->123 is the password
Now the Java client configures the host IP number, the password can be linked to the
"Reprint" Java Client link not on Redis solution (Jedis)