本文整理了Java中redis.clients.jedis.Jedis.sentinelMasters()
方法的一些代码示例,展示了Jedis.sentinelMasters()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.sentinelMasters()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:sentinelMasters
[英]```
redis 127.0.0.1:26381> sentinel masters
[中]```
redis 127.0.0.1:26381> sentinel masters
1) 1) "name"
2) "mymaster"
3) "ip"
4) "127.0.0.1"
5) "port"
6) "6379"
7) "runid"
8) "93d4d4e6e9c06d0eea36e27f31924ac26576081d"
9) "flags"
10) "master"
11) "pending-commands"
12) "0"
13) "last-ok-ping-reply"
14) "423"
15) "last-ping-reply"
16) "423"
17) "info-refresh"
18) "6107"
19) "num-slaves"
20) "1"
21) "num-other-sentinels"
22) "2"
23) "quorum"
24) "2"
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public List<RedisServer> masters() {
return JedisConverters.toListOfRedisServer(jedis.sentinelMasters());
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public List<Map<String, String>> sentinelMasters() {
return jedis.sentinelMasters();
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public List<Map<String, String>> sentinelMasters() {
return jedis.sentinelMasters();
}
代码示例来源:origin: wso2/msf4j
private static Jedis getJedisInternal(Jedis sentinel) {
List<Map<String, String>> masters = sentinel.sentinelMasters();
for (Map<String, String> master : masters) {
if (MASTER_NAME.equals(master.get("name"))) {
String masterIP = master.get("ip");
int masterPort = Integer.parseInt(master.get("port"));
log.info("Redis master : {}:{}", masterIP, masterPort);
return new Jedis(masterIP, masterPort);
}
}
return null;
}
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public List<Map<String, String>> sentinelMasters() {
String command = "sentinelMasters";
return instrumented(command, () -> delegated.sentinelMasters());
}
代码示例来源:origin: org.springframework.data/spring-data-redis
@Override
public List<RedisServer> masters() {
return JedisConverters.toListOfRedisServer(jedis.sentinelMasters());
}
代码示例来源:origin: org.wso2.carbon.mss/petstore-util
private static Jedis getJedisInternal(Jedis sentinel) {
List<Map<String, String>> masters = sentinel.sentinelMasters();
for (Map<String, String> master : masters) {
if (MASTER_NAME.equals(master.get("name"))) {
String masterIP = master.get("ip");
int masterPort = Integer.parseInt(master.get("port"));
log.info("Redis master : {}:{}", masterIP, masterPort);
return new Jedis(masterIP, masterPort);
}
}
return null;
}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public List<RedisServer> masters() {
return JedisConverters.toListOfRedisServer(jedis.sentinelMasters());
}
代码示例来源:origin: org.nutz/nutz-integration-jedis
Jedis jedis = getJedis();
try {
return jedis.sentinelMasters();
} finally {Streams.safeClose(jedis);}
代码示例来源:origin: penggle/jedis-ms-sentinel
@Test
public void sentinelMasters() throws Exception {
Jedis sentinel = null;
try {
sentinel = new Jedis("192.168.137.101", 63791);
System.out.println(String.format(">>> sentinel = %s", sentinel));
List<Map<String, String>> masters = sentinel.sentinelMasters();
for(Map<String,String> master : masters){
System.out.println("----------------------------------------------");
for(Map.Entry<String,String> entry : master.entrySet()){
System.out.println(entry.getKey() + " : " + entry.getValue());
}
}
} finally {
if(sentinel != null){
sentinel.close();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!