monitor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMaster        = fmt.Errorf("no master")
	ErrDoFailover      = fmt.Errorf("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 *vkcli.SentinelMonitorNode) bool

func LoadFailoverMonitor

func LoadFailoverMonitor(ctx context.Context, client clientset.ClientSet, inst types.FailoverInstance, logger logr.Logger) (types.FailoverMonitor, error)

Types

type ManualMonitor

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

func NewManualMonitor

func NewManualMonitor(ctx context.Context, client clientset.ClientSet, inst types.FailoverInstance) (*ManualMonitor, error)

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) (*vkcli.SentinelMonitorNode, error)

func (*ManualMonitor) Monitor

func (s *ManualMonitor) Monitor(ctx context.Context, masterNode types.ValkeyNode) error

func (*ManualMonitor) Policy

func (*ManualMonitor) Replicas

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

func (*ManualMonitor) Reset

func (s *ManualMonitor) Reset(ctx context.Context) 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 NewSentinelMonitor

func NewSentinelMonitor(ctx context.Context, k8scli clientset.ClientSet, inst types.FailoverInstance) (*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) 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) (*vkcli.SentinelMonitorNode, error)

func (*SentinelMonitor) Monitor

func (s *SentinelMonitor) Monitor(ctx context.Context, masterNode types.ValkeyNode) error

Monitor monitors the valkey master node on the sentinel nodes

func (*SentinelMonitor) Policy

func (*SentinelMonitor) Replicas

func (*SentinelMonitor) Reset

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

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) (*vkcli.SentinelMonitorNode, error)

func (*SentinelNode) MonitoringReplicas

func (sn *SentinelNode) MonitoringReplicas(ctx context.Context, name string) ([]*vkcli.SentinelMonitorNode, error)

func (*SentinelNode) Reset

func (sn *SentinelNode) Reset(ctx context.Context, name string) 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() version.ValkeyVersion

Jump to

Keyboard shortcuts

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