public final class SentinelHandler extends Object implements RedisHandler
Modifier and Type | Method and Description |
---|---|
void |
failover(String masterName)
故障转移
|
org.springframework.data.redis.core.RedisTemplate<String,Object> |
getRedisTemplate()
获取spring redis模板
|
void |
isOpen()
是否连接
|
Collection<org.springframework.data.redis.connection.RedisServer> |
masters()
主服务器列表
|
void |
monitor(org.springframework.data.redis.connection.RedisServer master)
监控主服务器
|
void |
monitor(String name,
String ip,
String port,
String quorum)
监控主服务器
|
void |
remove(String masterName)
移除主服务器
|
Collection<org.springframework.data.redis.connection.RedisServer> |
slaves(String masterName)
从服务器列表
|
public void isOpen()
public void failover(String masterName)
masterName
- 主服务名称public Collection<org.springframework.data.redis.connection.RedisServer> masters()
public Collection<org.springframework.data.redis.connection.RedisServer> slaves(String masterName)
masterName
- 主服务器名称public void monitor(org.springframework.data.redis.connection.RedisServer master)
master
- 主服务器对象public void monitor(String name, String ip, String port, String quorum)
name
- 主服务器名称ip
- 主服务器IPport
- 主服务器端口quorum
- 确认故障的最少哨兵数量public void remove(String masterName)
masterName
- 主服务器名称Copyright © 2019. All rights reserved.