@@ -25,14 +25,16 @@ public static void main(String[] args) {
2525 // C2.基于sentinel和连接池的demo
2626// Jedis sjedis = SentinelJedis.getJedis();
2727// System.out.println(sjedis.info());
28- // sjedis.set("uptime ", new Long(System.currentTimeMillis()).toString());
29- // System.out.println(sjedis.get("uptime "));
28+ // sjedis.set("uptime2 ", new Long(System.currentTimeMillis()).toString());
29+ // System.out.println(sjedis.get("uptime2 "));
3030// SentinelJedis.close();
3131
3232 // C3. 直接连接sentinel进行操作
33- // Jedis jedis = new Jedis("localhost", 26380); // 连接到sentinel
34- // List<Map<String, String>> masters = jedis .sentinelMasters();
33+ // Jedis jedisSentinel = new Jedis("localhost", 26380); // 连接到sentinel
34+ // List<Map<String, String>> masters = jedisSentinel .sentinelMasters();
3535// System.out.println(JSON.toJSONString(masters));
36+ // List<Map<String, String>> slaves = jedisSentinel.sentinelSlaves("mymaster");
37+ // System.out.println(JSON.toJSONString(slaves));
3638
3739
3840 // 作业:
@@ -48,11 +50,11 @@ public static void main(String[] args) {
4850 // 4. 使用C3的方式,使用java代码手动操作sentinel
4951
5052
51- // C4. Cluster
53+ // C4. Redis Cluster
5254 // 作业:
53- // 5.使用命令行配置cluster :
55+ // 5.使用命令行配置Redis cluster :
5456 // 1) 以cluster方式启动redis-server
55- // 2) 添加cluster节点,确认集群节点数目
57+ // 2) 用meet, 添加cluster节点,确认集群节点数目
5658 // 3) 分配槽位,确认分配成功
5759 // 4) 测试简单的get/set是否成功
5860 // 然后运行如下代码
0 commit comments