Documentation ¶
Index ¶
- Constants
- func CheckQuorum(sCfg *SentinelConfig, instanceID int) (string, bool)
- func Failover(sCfg *SentinelConfig, instanceID int) error
- func GetMasterIP(sCfg *SentinelConfig, instanceID int) (string, error)
- func IsSentinelMonitors(sCfg *SentinelConfig, instanceID int) bool
- func Monitor(sCfg *SentinelConfig, iCfg *InstanceConfig) error
- func Remove(sCfg *SentinelConfig, instanceID int) error
- func Reset(sCfg *SentinelConfig) error
- type Auth
- type Info
- type InfoItem
- type InfoSlice
- type InstanceConfig
- type SentinelConfig
Constants ¶
View Source
const NAME_PREFIX = "rds-"
NAME_PREFIX used for instance name generation
Variables ¶
This section is empty.
Functions ¶
func CheckQuorum ¶
func CheckQuorum(sCfg *SentinelConfig, instanceID int) (string, bool)
CheckQuorum checks if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the majority needed to authorize the failover
func Failover ¶
func Failover(sCfg *SentinelConfig, instanceID int) error
Failover sends FAILOVER command to Sentinel
func GetMasterIP ¶
func GetMasterIP(sCfg *SentinelConfig, instanceID int) (string, error)
GetMasterIP returns master IP
func IsSentinelMonitors ¶
func IsSentinelMonitors(sCfg *SentinelConfig, instanceID int) bool
IsSentinelMonitors returns true if instance already monitored by Sentinel
func Monitor ¶
func Monitor(sCfg *SentinelConfig, iCfg *InstanceConfig) error
Monitor adds instance to Sentinel monitoring
func Remove ¶
func Remove(sCfg *SentinelConfig, instanceID int) error
Remove removes instance from Sentinel monitoring
Types ¶
type InstanceConfig ¶
type InstanceConfig struct { ID int IP string Port int Quorum int DownAfterMilliseconds int FailoverTimeout int ParallelSyncs int Auth Auth }
InstanceConfig contains info about instance for Sentinel monitoring
type SentinelConfig ¶
Click to show internal directories.
Click to hide internal directories.