Java Connectivity Redis Issues

Source: Internet
Author: User

Package Com.guo.redis;import Redis.clients.jedis.Jedis; Public classRedis_1 { Public Static voidMain (string[] args) {//TODO auto-generated Method Stub//Connect to a remote Redis serviceJedis Jedis =NewJedis ("192.168.80.1",6379); //Permission Validation//Jedis.auth ("admin"); //See if the service is runningSystem. out. println (Jedis.ping ()); }}

The above code is the Java connection Redis but in the time of the connection always error, the method also found on the Internet, is basically comments off #127.0.0.1 firewall iptables, but the connection is not successful, finally found that these methods are actually correct only the configuration file is wrong, Because I registered Redis with the Linux system service, the Redis configuration file is also transferred from the Redis installation directory to the/etc/redis/6379.conf, if it is not useful to modify the configuration file under the Redis installation directory, And remember to put access rights off Proteced-mode No

Java Connectivity Redis Issues

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.