1.导入相关jar包 jedis.jar和commons.jar包
2.通过Jedis 类连接Redis
@SuppressWarnings("resource")
Jedis jedis = new Jedis("192.168.56.128");
2.保护模式
DENIED Redis is running in protected mode because protected mode is enabled…
redis处于保护模式,只能本地链接,我们需要修改配置文件redis.conf,将protected-mode yes改成no
原文:https://www.cnblogs.com/user001/p/11181879.html