1.配置安全组规则

2.redis 配置protected-model
连接redis并执行命令:config set protected-model no
3.测试:
Jedis conn = new Jedis("公网IP",6379);
conn.set("hello", "world");
System.out.println(conn.get("hello"));

本文介绍了如何配置Redis的安全模式并设置云服务器的安全组规则,确保Redis服务可以从外网访问。通过示例代码展示了如何使用Java Jedis客户端连接到Redis并进行读写操作。
1.配置安全组规则

2.redis 配置protected-model
连接redis并执行命令:config set protected-model no
3.测试:
Jedis conn = new Jedis("公网IP",6379);
conn.set("hello", "world");
System.out.println(conn.get("hello"));

1654
296

被折叠的 条评论
为什么被折叠?