I am using the Redis is installed on the native virtual machine, the use of Java connection encountered some errors, summed up the need to change the place as follows:
1, redis configuration file by default is bound 127.0.0.1 IP, need to find this line in redis.conf, comment out
2, Redis default does not allow non-native Client connection, itself is no password, need to set a login password, connect with a password
Set password command: Config set Requirepass xxx, after the password settings need to be certified to get the data in normal use get: Auth xxx, followed by the password just set
3, Java program Connection Redis also need to call Auth method authentication: Jedis.auth ("xxx");
Thanks to the following bloggers for sharing:
http://blog.csdn.net/yingxiake/article/details/51472810
http://blog.csdn.net/basycia/article/details/52176025
http://blog.csdn.net/wohaqiyi/article/details/65448235
This article is from a "little progress every Day" blog, make sure to keep this source http://wangguangshuo.blog.51cto.com/10283213/1951563
Java connect to Redis for issues with subscription publishing