monitor

package
v0.0.0-...-3430a5a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

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

Types

type ManualMonitor

type ManualMonitor struct {
	// contains filtered or unexported fields
}

func (*ManualMonitor) AllNodeMonitored

func (s *ManualMonitor) AllNodeMonitored(ctx context.Context) (bool, error)

func (*ManualMonitor) Failover

func (s *ManualMonitor) Failover(ctx context.Context) error

func (*ManualMonitor) Inited

func (s *ManualMonitor) Inited(ctx context.Context) (bool, error)

func (*ManualMonitor) Master

func (s *ManualMonitor) Master(ctx context.Context, flags ...bool) (*rediscli.SentinelMonitorNode, error)

func (*ManualMonitor) Monitor

func (s *ManualMonitor) Monitor(ctx context.Context, masterNode redis.RedisNode) error

func (*ManualMonitor) Policy

func (*ManualMonitor) Replicas

func (s *ManualMonitor) Replicas(ctx context.Context) (ret []*rediscli.SentinelMonitorNode, err error)

func (*ManualMonitor) UpdateConfig

func (s *ManualMonitor) UpdateConfig(ctx context.Context, params map[string]string) error

type SentinelMonitor

type SentinelMonitor struct {
	// contains filtered or unexported fields
}

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) Failover

func (s *SentinelMonitor) Failover(ctx context.Context) error

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) Monitor

func (s *SentinelMonitor) Monitor(ctx context.Context, masterNode redis.RedisNode) error

Monitor monitors the redis master node on the sentinel nodes

func (*SentinelMonitor) Policy

func (*SentinelMonitor) Replicas

func (*SentinelMonitor) UpdateConfig

func (s *SentinelMonitor) UpdateConfig(ctx context.Context, params map[string]string) error

type SentinelNode

type SentinelNode struct {
	// contains filtered or unexported fields
}

func NewSentinelNode

func NewSentinelNode(ctx context.Context, addr, username, password string, tlsConf *tls.Config) (*SentinelNode, error)

func (*SentinelNode) Failover

func (sn *SentinelNode) Failover(ctx context.Context, name string) error

func (*SentinelNode) IsReady

func (sn *SentinelNode) IsReady() bool

func (*SentinelNode) Monitor

func (sn *SentinelNode) Monitor(ctx context.Context, name, ip, port string, quorum int, params map[string]string) error

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 (sn *SentinelNode) UpdateConfig(ctx context.Context, name string, params map[string]string) error

func (*SentinelNode) Version

func (sn *SentinelNode) Version() rtypes.RedisVersion

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL