在使用idea连接服务器端的redis时失败!
服务器操作系统 CentOS8
redis版本 7.x.x
按照网上的教程,已经将
- protected-mode 设置成 no
- 将bind注释掉
- daemonize 设置成yes
- 设置了密码
- 服务器安全组也开放了6379端口
- 防火墙也打开了6379
使用idea连接时报错pom.xml
<!--导包-->
<dependencies>
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>4.4.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 -->
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.38</version>
</dependency>
</dependencies>
public class TestPing {
public static void main(String[] args) {
Jedis jedis = new Jedis("47.96.39.104", 6379);
jedis.auth("123456");
System.out.println(jedis.ping());
}
}
报错