Documentation ¶
Index ¶
- Variables
- func IsMonitoringNodeOnline(node *rediscli.SentinelMonitorNode) bool
- func LoadFailoverMonitor(ctx context.Context, client clientset.ClientSet, ...) (types.FailoverMonitor, error)
- type ManualMonitor
- func (s *ManualMonitor) AllNodeMonitored(ctx context.Context) (bool, error)
- func (s *ManualMonitor) Failover(ctx context.Context) error
- func (s *ManualMonitor) Inited(ctx context.Context) (bool, error)
- func (s *ManualMonitor) Master(ctx context.Context, flags ...bool) (*rediscli.SentinelMonitorNode, error)
- func (s *ManualMonitor) Monitor(ctx context.Context, masterNode redis.RedisNode) error
- func (s *ManualMonitor) Policy() databasesv1.FailoverPolicy
- func (s *ManualMonitor) Replicas(ctx context.Context) (ret []*rediscli.SentinelMonitorNode, err error)
- func (s *ManualMonitor) UpdateConfig(ctx context.Context, params map[string]string) error
- type SentinelMonitor
- func (s *SentinelMonitor) AllNodeMonitored(ctx context.Context) (bool, error)
- func (s *SentinelMonitor) Failover(ctx context.Context) error
- func (s *SentinelMonitor) Inited(ctx context.Context) (bool, error)
- func (s *SentinelMonitor) Master(ctx context.Context, flags ...bool) (*rediscli.SentinelMonitorNode, error)
- func (s *SentinelMonitor) Monitor(ctx context.Context, masterNode redis.RedisNode) error
- func (s *SentinelMonitor) Policy() databasesv1.FailoverPolicy
- func (s *SentinelMonitor) Replicas(ctx context.Context) ([]*rediscli.SentinelMonitorNode, error)
- func (s *SentinelMonitor) UpdateConfig(ctx context.Context, params map[string]string) error
- type SentinelNode
- func (sn *SentinelNode) Failover(ctx context.Context, name string) error
- func (sn *SentinelNode) IsReady() bool
- func (sn *SentinelNode) Monitor(ctx context.Context, name, ip, port string, quorum int, ...) error
- func (sn *SentinelNode) MonitoringMaster(ctx context.Context, name string) (*rediscli.SentinelMonitorNode, error)
- func (sn *SentinelNode) MonitoringReplicas(ctx context.Context, name string) ([]*rediscli.SentinelMonitorNode, error)
- func (sn *SentinelNode) UpdateConfig(ctx context.Context, name string, params map[string]string) error
- func (sn *SentinelNode) Version() rtypes.RedisVersion
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoMaster = fmt.Errorf("no master") ErrDoFailover = fmt.Errorf("redis sentinel doing failover") ErrMultipleMaster = fmt.Errorf("multiple master without majority agreement") ErrAddressConflict = fmt.Errorf("master address conflict") ErrNotEnoughNodes = fmt.Errorf("not enough sentinel nodes") )
Functions ¶
func IsMonitoringNodeOnline ¶
func IsMonitoringNodeOnline(node *rediscli.SentinelMonitorNode) bool
func LoadFailoverMonitor ¶
Types ¶
type ManualMonitor ¶
type ManualMonitor struct {
// contains filtered or unexported fields
}
func NewManualMonitor ¶
func NewManualMonitor(ctx context.Context, client clientset.ClientSet, inst types.RedisFailoverInstance) (*ManualMonitor, error)
func (*ManualMonitor) AllNodeMonitored ¶
func (s *ManualMonitor) AllNodeMonitored(ctx context.Context) (bool, error)
func (*ManualMonitor) Master ¶
func (s *ManualMonitor) Master(ctx context.Context, flags ...bool) (*rediscli.SentinelMonitorNode, error)
func (*ManualMonitor) Policy ¶
func (s *ManualMonitor) Policy() databasesv1.FailoverPolicy
func (*ManualMonitor) Replicas ¶
func (s *ManualMonitor) Replicas(ctx context.Context) (ret []*rediscli.SentinelMonitorNode, err error)
func (*ManualMonitor) UpdateConfig ¶
type SentinelMonitor ¶
type SentinelMonitor struct {
// contains filtered or unexported fields
}
func NewSentinelMonitor ¶
func NewSentinelMonitor(ctx context.Context, k8scli clientset.ClientSet, inst types.RedisFailoverInstance) (*SentinelMonitor, error)
func (*SentinelMonitor) AllNodeMonitored ¶
func (s *SentinelMonitor) AllNodeMonitored(ctx context.Context) (bool, error)
AllNodeMonitored checks if all sentinel nodes are monitoring all the master and replicas
func (*SentinelMonitor) Inited ¶
func (s *SentinelMonitor) Inited(ctx context.Context) (bool, error)
func (*SentinelMonitor) Master ¶
func (s *SentinelMonitor) Master(ctx context.Context, flags ...bool) (*rediscli.SentinelMonitorNode, error)
func (*SentinelMonitor) Policy ¶
func (s *SentinelMonitor) Policy() databasesv1.FailoverPolicy
func (*SentinelMonitor) Replicas ¶
func (s *SentinelMonitor) Replicas(ctx context.Context) ([]*rediscli.SentinelMonitorNode, error)
func (*SentinelMonitor) UpdateConfig ¶
type SentinelNode ¶
type SentinelNode struct {
// contains filtered or unexported fields
}
func NewSentinelNode ¶
func (*SentinelNode) Failover ¶
func (sn *SentinelNode) Failover(ctx context.Context, name string) error
func (*SentinelNode) IsReady ¶
func (sn *SentinelNode) IsReady() bool
func (*SentinelNode) MonitoringMaster ¶
func (sn *SentinelNode) MonitoringMaster(ctx context.Context, name string) (*rediscli.SentinelMonitorNode, error)
func (*SentinelNode) MonitoringReplicas ¶
func (sn *SentinelNode) MonitoringReplicas(ctx context.Context, name string) ([]*rediscli.SentinelMonitorNode, error)
func (*SentinelNode) UpdateConfig ¶
func (*SentinelNode) Version ¶
func (sn *SentinelNode) Version() rtypes.RedisVersion
Click to show internal directories.
Click to hide internal directories.