cluster

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-3.0 Imports: 56 Imported by: 1

Documentation

Overview

replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL Copyright 2017 Signal 18 SARL Authors: Guillaume Lefranc <guillaume@signal18.io>

Stephane Varoqui  <svaroqui@gmail.com>

This source code is licensed under the GNU General Public License, version 3. Redistribution/Reuse of this code is permitted under the GNU v3 license, as an additional term, ALL code must carry the original Author(s) credit in comment form. See LICENSE in this directory for the integral text.

display.go

replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL Copyright 2017 Signal 18 SARL Authors: Guillaume Lefranc <guillaume@signal18.io>

Stephane Varoqui  <svaroqui@gmail.com>

This source code is licensed under the GNU General Public License, version 3. Redistribution/Reuse of this code is permitted under the GNU v3 license, as an additional term, ALL code must carry the original Author(s) credit in comment form. See LICENSE in this directory for the integral text.

replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL Copyright 2017 Signal 18 SARL Authors: Guillaume Lefranc <guillaume@signal18.io>

Stephane Varoqui  <svaroqui@gmail.com>

This source code is licensed under the GNU General Public License, version 3. Redistribution/Reuse of this code is permitted under the GNU v3 license, as an additional term, ALL code must carry the original Author(s) credit in comment form. See LICENSE in this directory for the integral text.

replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL Copyright 2017 Signal 18 SARL Authors: Guillaume Lefranc <guillaume@signal18.io>

Stephane Varoqui  <svaroqui@gmail.com>

This source code is licensed under the GNU General Public License, version 3. Redistribution/Reuse of this code is permitted under the GNU v3 license, as an additional term, ALL code must carry the original Author(s) credit in comment form. See LICENSE in this directory for the integral text.

replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL Copyright 2017 Signal 18 SARL Authors: Guillaume Lefranc <guillaume@signal18.io>

Stephane Varoqui  <svaroqui@gmail.com>

This source code is licensed under the GNU General Public License, version 3. Redistribution/Reuse of this code is permitted under the GNU v3 license, as an additional term, ALL code must carry the original Author(s) credit in comment form. See LICENSE in this directory for the integral text.

replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL Copyright 2017 Signal 18 SARL Authors: Guillaume Lefranc <guillaume@signal18.io>

Stephane Varoqui  <svaroqui@gmail.com>

This source code is licensed under the GNU General Public License, version 3. Redistribution/Reuse of this code is permitted under the GNU v3 license, as an additional term, ALL code must carry the original Author(s) credit in comment form. See LICENSE in this directory for the integral text.

replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL Copyright 2017 Signal 18 SARL Authors: Guillaume Lefranc <guillaume@signal18.io>

Stephane Varoqui  <svaroqui@gmail.com>

This source code is licensed under the GNU General Public License, version 3. Redistribution/Reuse of this code is permitted under the GNU v3 license, as an additional term, ALL code must carry the original Author(s) credit in comment form. See LICENSE in this directory for the integral text.

replication-manager - Replication Manager Monitoring and CLI for MariaDB and MySQL Copyright 2017 Signal 18 SARL Authors: Guillaume Lefranc <guillaume@signal18.io>

Stephane Varoqui  <svaroqui@gmail.com>

This source code is licensed under the GNU General Public License, version 3. Redistribution/Reuse of this code is permitted under the GNU v3 license, as an additional term, ALL code must carry the original Author(s) credit in comment form. See LICENSE in this directory for the integral text.

Index

Constants

View Source
const (
	LvlInfo = "INFO"
	LvlWarn = "WARN"
	LvlErr  = "ERROR"
	LvlDbg  = "DEBUG"
)

Log levels

Variables

This section is empty.

Functions

This section is empty.

Types

type Alerts

type Alerts struct {
	Errors   []state.StateHttp `json:"errors"`
	Warnings []state.StateHttp `json:"warnings"`
}

type Backend

type Backend struct {
	Host           string
	Port           string
	Status         string
	PrxName        string
	PrxStatus      string
	PrxConnections string
	PrxHostgroup   string
	PrxByteOut     string
	PrxByteIn      string
	PrxLatency     string
	PrxMaintenance bool
}

type Cluster

type Cluster struct {
	CleanAll bool

	HaveWriteDuringCatchBinlog bool
	// contains filtered or unexported fields
}

func (*Cluster) AddSeededServer

func (cluster *Cluster) AddSeededServer(srv string) error

func (*Cluster) AllDatabaseCanConn

func (cluster *Cluster) AllDatabaseCanConn() bool

func (*Cluster) Bootstrap

func (cluster *Cluster) Bootstrap() error

Bootstrap provisions && setup topology

func (*Cluster) BootstrapReplication

func (cluster *Cluster) BootstrapReplication() error

func (*Cluster) BootstrapReplicationCleanup

func (cluster *Cluster) BootstrapReplicationCleanup() error

func (*Cluster) CheckFailed

func (cluster *Cluster) CheckFailed()

func (*Cluster) CheckSlavesRunning

func (cluster *Cluster) CheckSlavesRunning() bool

func (*Cluster) CheckTableConsistency

func (cluster *Cluster) CheckTableConsistency(table string) bool

func (*Cluster) ChecksumBench

func (cluster *Cluster) ChecksumBench() bool

func (*Cluster) CleanupBench

func (cluster *Cluster) CleanupBench() error

func (*Cluster) Close

func (cluster *Cluster) Close()

func (*Cluster) CloseRing

func (cluster *Cluster) CloseRing(oldMaster *ServerMonitor) error

func (*Cluster) CloseTestCluster

func (cluster *Cluster) CloseTestCluster(conf string, test *Test) bool

func (*Cluster) CountFailed

func (cluster *Cluster) CountFailed(s []*ServerMonitor) int

CountFailed Count number of failed node

func (*Cluster) CreateKey

func (cluster *Cluster) CreateKey() error

func (*Cluster) DelayAllSlaves

func (cluster *Cluster) DelayAllSlaves() error

func (*Cluster) DisableSemisync

func (cluster *Cluster) DisableSemisync() error

func (*Cluster) DisplayHelp

func (cluster *Cluster) DisplayHelp()

func (*Cluster) EnableSemisync

func (cluster *Cluster) EnableSemisync() error

func (*Cluster) FailedMasterDiscovery

func (cluster *Cluster) FailedMasterDiscovery()

func (*Cluster) FailoverAndWait

func (cluster *Cluster) FailoverAndWait()

func (*Cluster) FailoverForce

func (cluster *Cluster) FailoverForce() error

func (*Cluster) FailoverNow

func (cluster *Cluster) FailoverNow()

func (*Cluster) ForgetTopology

func (cluster *Cluster) ForgetTopology() error

func (*Cluster) FoundDatabaseAgent

func (cluster *Cluster) FoundDatabaseAgent(server *ServerMonitor) (opensvc.Host, error)

func (*Cluster) FoundProxyAgent

func (cluster *Cluster) FoundProxyAgent(proxy *Proxy) (opensvc.Host, error)

func (*Cluster) GetClusterName

func (cluster *Cluster) GetClusterName() string

func (*Cluster) GetClusterProxyConn

func (cluster *Cluster) GetClusterProxyConn() (*sqlx.DB, error)

func (*Cluster) GetClusterThisProxyConn

func (cluster *Cluster) GetClusterThisProxyConn(prx *Proxy) (*sqlx.DB, error)

func (*Cluster) GetConf

func (cluster *Cluster) GetConf() config.Config

func (*Cluster) GetCrashes

func (cluster *Cluster) GetCrashes() crashList

GetCrashes return crashes

func (*Cluster) GetDatabaseTags

func (cluster *Cluster) GetDatabaseTags() []string

func (*Cluster) GetDbPass

func (cluster *Cluster) GetDbPass() string

func (*Cluster) GetDbUser

func (cluster *Cluster) GetDbUser() string

func (*Cluster) GetDockerDiskTemplate

func (cluster *Cluster) GetDockerDiskTemplate(collector opensvc.Collector) string

func (*Cluster) GetFailSync

func (cluster *Cluster) GetFailSync() bool

func (*Cluster) GetFailedServer

func (cluster *Cluster) GetFailedServer() *ServerMonitor

func (*Cluster) GetFailoverCtr

func (cluster *Cluster) GetFailoverCtr() int

func (*Cluster) GetFailoverTs

func (cluster *Cluster) GetFailoverTs() int64

func (*Cluster) GetGComm

func (cluster *Cluster) GetGComm() string

func (*Cluster) GetHaproxyTemplate

func (cluster *Cluster) GetHaproxyTemplate(collector opensvc.Collector, servers string, agent opensvc.Host, prx *Proxy) (string, error)

func (*Cluster) GetIndiceServerFromId

func (cluster *Cluster) GetIndiceServerFromId(Id string) int

func (*Cluster) GetLocalProxy

func (cluster *Cluster) GetLocalProxy(this *Proxy) Proxy

func (*Cluster) GetLogLevel

func (cluster *Cluster) GetLogLevel() int

func (*Cluster) GetMaster

func (cluster *Cluster) GetMaster() *ServerMonitor

func (*Cluster) GetMasterFailCount

func (cluster *Cluster) GetMasterFailCount() int

func (*Cluster) GetMasterFromReplication

func (cluster *Cluster) GetMasterFromReplication(s *ServerMonitor) (*ServerMonitor, error)

func (*Cluster) GetMaxFail

func (cluster *Cluster) GetMaxFail() int

func (*Cluster) GetMaxscaleTemplate

func (cluster *Cluster) GetMaxscaleTemplate(collector opensvc.Collector, servers string, agent opensvc.Host, prx *Proxy) (string, error)

func (*Cluster) GetName

func (cluster *Cluster) GetName() string

func (*Cluster) GetOpenSVCSeviceStatus

func (cluster *Cluster) GetOpenSVCSeviceStatus() (int, error)

OpenSVCSeviceStatus 0 not provision , 1 prov and up ,2 on error error

func (*Cluster) GetPodDiskTemplate

func (cluster *Cluster) GetPodDiskTemplate(collector opensvc.Collector, pod string) string

func (*Cluster) GetPodDockerHaproxyTemplate

func (cluster *Cluster) GetPodDockerHaproxyTemplate(collector opensvc.Collector, pod string) string

func (*Cluster) GetPodDockerMaxscaleTemplate

func (cluster *Cluster) GetPodDockerMaxscaleTemplate(collector opensvc.Collector, pod string) string

func (*Cluster) GetPodDockerProxysqlTemplate

func (cluster *Cluster) GetPodDockerProxysqlTemplate(collector opensvc.Collector, pod string) string

func (*Cluster) GetPodDockerShardproxyTemplate

func (cluster *Cluster) GetPodDockerShardproxyTemplate(collector opensvc.Collector, pod string) string

func (*Cluster) GetPodDockerSphinxTemplate

func (cluster *Cluster) GetPodDockerSphinxTemplate(collector opensvc.Collector, pod string) string

func (*Cluster) GetPodNetTemplate

func (cluster *Cluster) GetPodNetTemplate(collector opensvc.Collector, pod string, i int) string

func (*Cluster) GetPodPackageTemplate

func (cluster *Cluster) GetPodPackageTemplate(collector opensvc.Collector, pod string) string

func (*Cluster) GetProxies

func (cluster *Cluster) GetProxies() proxyList

func (*Cluster) GetProxiesEnv

func (cluster *Cluster) GetProxiesEnv(collector opensvc.Collector, servers string, agent opensvc.Host, prx *Proxy) string

func (*Cluster) GetProxyFromName

func (cluster *Cluster) GetProxyFromName(name string) *Proxy

func (*Cluster) GetProxyTags

func (cluster *Cluster) GetProxyTags() []string

func (*Cluster) GetProxysqlTemplate

func (cluster *Cluster) GetProxysqlTemplate(collector opensvc.Collector, servers string, agent opensvc.Host, prx *Proxy) (string, error)

func (*Cluster) GetRejoin

func (cluster *Cluster) GetRejoin() bool

func (*Cluster) GetRejoinBackupBinlog

func (cluster *Cluster) GetRejoinBackupBinlog() bool

func (*Cluster) GetRejoinDump

func (cluster *Cluster) GetRejoinDump() bool

func (*Cluster) GetRejoinFlashback

func (cluster *Cluster) GetRejoinFlashback() bool

func (*Cluster) GetRejoinSemisync

func (cluster *Cluster) GetRejoinSemisync() bool

func (*Cluster) GetRelayServer

func (cluster *Cluster) GetRelayServer() *ServerMonitor

func (*Cluster) GetRingChildServer

func (cluster *Cluster) GetRingChildServer(oldMaster *ServerMonitor) *ServerMonitor

func (*Cluster) GetRingParentServer

func (cluster *Cluster) GetRingParentServer(oldMaster *ServerMonitor) *ServerMonitor

func (*Cluster) GetRplChecks

func (cluster *Cluster) GetRplChecks() bool

func (*Cluster) GetRunStatus

func (cluster *Cluster) GetRunStatus() string

func (*Cluster) GetServerFromId

func (cluster *Cluster) GetServerFromId(serverid uint) *ServerMonitor

func (*Cluster) GetServerFromName

func (cluster *Cluster) GetServerFromName(name string) *ServerMonitor

func (*Cluster) GetServerFromURL

func (cluster *Cluster) GetServerFromURL(url string) *ServerMonitor

func (*Cluster) GetServers

func (cluster *Cluster) GetServers() serverList

func (*Cluster) GetShardproxyTemplate

func (cluster *Cluster) GetShardproxyTemplate(collector opensvc.Collector, servers string, agent opensvc.Host, prx *Proxy) (string, error)

func (*Cluster) GetSlaves

func (cluster *Cluster) GetSlaves() serverList

func (*Cluster) GetSphinxTemplate

func (cluster *Cluster) GetSphinxTemplate(collector opensvc.Collector, servers string, agent opensvc.Host, prx *Proxy) (string, error)

func (*Cluster) GetStateMachine

func (cluster *Cluster) GetStateMachine() *state.StateMachine

func (*Cluster) GetStatus

func (cluster *Cluster) GetStatus() bool

func (*Cluster) GetSwitchSync

func (cluster *Cluster) GetSwitchSync() bool

func (*Cluster) GetTestMode

func (cluster *Cluster) GetTestMode() bool

func (*Cluster) GetTopology

func (cluster *Cluster) GetTopology() string

func (*Cluster) GetTraffic

func (cluster *Cluster) GetTraffic() bool

func (*Cluster) GetWaitTrx

func (cluster *Cluster) GetWaitTrx() int64

func (*Cluster) Init

func (cluster *Cluster) Init(conf config.Config, cfgGroup string, tlog *termlog.TermLog, httplog *httplog.HttpLog, termlength int, runUUID string, repmgrVersion string, repmgrHostname string, key []byte) error

Init initial cluster definition

func (*Cluster) InitAgent

func (cluster *Cluster) InitAgent(conf config.Config)

func (*Cluster) InitBenchTable

func (cluster *Cluster) InitBenchTable() error

func (*Cluster) InitDatabaseService

func (cluster *Cluster) InitDatabaseService(server *ServerMonitor) error

func (*Cluster) InitProxyService

func (cluster *Cluster) InitProxyService(prx *Proxy) error

func (*Cluster) InitTestCluster

func (cluster *Cluster) InitTestCluster(conf string, test *Test) bool

func (*Cluster) InjectTraffic

func (cluster *Cluster) InjectTraffic()

func (*Cluster) IsActive

func (cluster *Cluster) IsActive() bool

func (*Cluster) IsCurrentGTIDSync

func (cluster *Cluster) IsCurrentGTIDSync(m *ServerMonitor, s *ServerMonitor) bool

func (*Cluster) IsDiscovered

func (cluster *Cluster) IsDiscovered() bool

func (*Cluster) IsEqualBinlogFilters

func (cluster *Cluster) IsEqualBinlogFilters(m *ServerMonitor, s *ServerMonitor) (bool, error)

func (*Cluster) IsEqualReplicationFilters

func (cluster *Cluster) IsEqualReplicationFilters(m *ServerMonitor, s *ServerMonitor) bool

func (*Cluster) IsInFailover

func (cluster *Cluster) IsInFailover() bool

func (*Cluster) IsInHostList

func (cluster *Cluster) IsInHostList(host string) bool

func (*Cluster) IsInIgnoredHosts

func (cluster *Cluster) IsInIgnoredHosts(host string) bool

func (*Cluster) IsInPreferedHosts

func (cluster *Cluster) IsInPreferedHosts(host string) bool

func (*Cluster) IsMasterFailed

func (cluster *Cluster) IsMasterFailed() bool

func (*Cluster) IsProvision

func (cluster *Cluster) IsProvision() bool

func (*Cluster) IsProxyEqualMaster

func (cluster *Cluster) IsProxyEqualMaster() bool

func (*Cluster) IsVerbose

func (cluster *Cluster) IsVerbose() bool

func (*Cluster) LocalhostProvisionCluster

func (cluster *Cluster) LocalhostProvisionCluster() error

func (*Cluster) LocalhostProvisionDatabaseService

func (cluster *Cluster) LocalhostProvisionDatabaseService(server *ServerMonitor) error

func (*Cluster) LocalhostProvisionDatabases

func (cluster *Cluster) LocalhostProvisionDatabases() error

func (*Cluster) LocalhostProvisionProxies

func (cluster *Cluster) LocalhostProvisionProxies() error

func (*Cluster) LocalhostProvisionProxyService

func (cluster *Cluster) LocalhostProvisionProxyService(prx *Proxy) error

func (*Cluster) LocalhostStartDatabaseService

func (cluster *Cluster) LocalhostStartDatabaseService(server *ServerMonitor) error

func (*Cluster) LocalhostStopDatabaseService

func (cluster *Cluster) LocalhostStopDatabaseService(server *ServerMonitor) error

func (*Cluster) LocalhostUnprovision

func (cluster *Cluster) LocalhostUnprovision() error

func (*Cluster) LocalhostUnprovisionDatabaseService

func (cluster *Cluster) LocalhostUnprovisionDatabaseService(server *ServerMonitor) error

func (*Cluster) LogPrint

func (cluster *Cluster) LogPrint(msg ...interface{})

func (*Cluster) LogPrintf

func (cluster *Cluster) LogPrintf(level string, format string, args ...interface{})

func (*Cluster) LostMajority

func (cluster *Cluster) LostMajority() bool

LostMajority should be call in case of splitbrain to set maintenance mode

func (*Cluster) MasterFailover

func (cluster *Cluster) MasterFailover(fail bool) bool

MasterFailover triggers a master switchover and returns the new master URL

func (*Cluster) MdbsproxyCopyTable

func (cluster *Cluster) MdbsproxyCopyTable(oldmaster *ServerMonitor, newmaster *ServerMonitor, proxy *Proxy)

func (*Cluster) MultipleSlavesUp

func (cluster *Cluster) MultipleSlavesUp(candidate *ServerMonitor) bool

func (*Cluster) OpenSVCConnect

func (cluster *Cluster) OpenSVCConnect() opensvc.Collector

func (*Cluster) OpenSVCProvisionCluster

func (cluster *Cluster) OpenSVCProvisionCluster() error

func (*Cluster) OpenSVCProvisionDatabaseService

func (cluster *Cluster) OpenSVCProvisionDatabaseService(s *ServerMonitor)

func (*Cluster) OpenSVCProvisionOneSrvPerDB

func (cluster *Cluster) OpenSVCProvisionOneSrvPerDB() error

func (*Cluster) OpenSVCProvisionProxies

func (cluster *Cluster) OpenSVCProvisionProxies() error

func (*Cluster) OpenSVCProvisionProxyService

func (cluster *Cluster) OpenSVCProvisionProxyService(prx *Proxy) error

func (*Cluster) OpenSVCProvisionReloadHaproxyConf

func (cluster *Cluster) OpenSVCProvisionReloadHaproxyConf(Conf string) string

func (*Cluster) OpenSVCStartService

func (cluster *Cluster) OpenSVCStartService(server *ServerMonitor) error

func (*Cluster) OpenSVCStopDatabaseService

func (cluster *Cluster) OpenSVCStopDatabaseService(server *ServerMonitor) error

func (*Cluster) OpenSVCUnprovision

func (cluster *Cluster) OpenSVCUnprovision()

func (*Cluster) OpenSVCUnprovisionDatabaseService

func (cluster *Cluster) OpenSVCUnprovisionDatabaseService(db *ServerMonitor)

func (*Cluster) OpenSVCUnprovisionProxyService

func (cluster *Cluster) OpenSVCUnprovisionProxyService(prx *Proxy)

func (*Cluster) OpenSVCWaitDequeue

func (cluster *Cluster) OpenSVCWaitDequeue(svc opensvc.Collector, idaction int) error

func (*Cluster) PrepareBench

func (cluster *Cluster) PrepareBench() error

func (*Cluster) PrintTopology

func (cluster *Cluster) PrintTopology()

func (*Cluster) ProvisionServices

func (cluster *Cluster) ProvisionServices() error

func (*Cluster) RejoinFixRelay

func (cluster *Cluster) RejoinFixRelay(slave *ServerMonitor, relay *ServerMonitor) error

func (*Cluster) RejoinMysqldump

func (cluster *Cluster) RejoinMysqldump(source *ServerMonitor, dest *ServerMonitor) error

func (*Cluster) ReloadConfig

func (cluster *Cluster) ReloadConfig(conf config.Config)

func (*Cluster) ReloadFromSave

func (cluster *Cluster) ReloadFromSave() error

func (*Cluster) ResetFailoverCtr

func (cluster *Cluster) ResetFailoverCtr()

func (*Cluster) RestoreConf

func (cluster *Cluster) RestoreConf()

func (*Cluster) RollingUpgrade

func (cluster *Cluster) RollingUpgrade()

func (*Cluster) Run

func (cluster *Cluster) Run()

func (*Cluster) RunBench

func (cluster *Cluster) RunBench() error

func (*Cluster) RunSysbench

func (cluster *Cluster) RunSysbench() error

func (*Cluster) Save

func (cluster *Cluster) Save() error

func (*Cluster) SendProxyStats

func (cluster *Cluster) SendProxyStats(proxy *Proxy) error

func (*Cluster) SetActiveStatus

func (cluster *Cluster) SetActiveStatus(status string)

func (*Cluster) SetBenchMethod

func (cluster *Cluster) SetBenchMethod(m string)

func (*Cluster) SetBinlogServer

func (cluster *Cluster) SetBinlogServer(binlogserver bool)

func (*Cluster) SetCertificate

func (cluster *Cluster) SetCertificate(svc opensvc.Collector)

func (*Cluster) SetCfgGroupDisplay

func (cluster *Cluster) SetCfgGroupDisplay(cfgGroup string)

func (*Cluster) SetCheckFalsePositiveHeartbeat

func (cluster *Cluster) SetCheckFalsePositiveHeartbeat(CheckFalsePositiveHeartbeat bool)

func (*Cluster) SetCleanAll

func (cluster *Cluster) SetCleanAll(check bool)

func (*Cluster) SetClusterList

func (cluster *Cluster) SetClusterList(clusters map[string]*Cluster)

func (*Cluster) SetFailLimit

func (cluster *Cluster) SetFailLimit(limit int)

func (*Cluster) SetFailRestartUnsafe

func (cluster *Cluster) SetFailRestartUnsafe(check bool)

func (*Cluster) SetFailSync

func (cluster *Cluster) SetFailSync(check bool)

func (*Cluster) SetFailTime

func (cluster *Cluster) SetFailTime(time int64)

func (*Cluster) SetFailoverCtr

func (cluster *Cluster) SetFailoverCtr(failoverCtr int)

func (*Cluster) SetFailoverTs

func (cluster *Cluster) SetFailoverTs(failoverTs int64)

func (*Cluster) SetForceSlaveNoGtid

func (cluster *Cluster) SetForceSlaveNoGtid(forceslavenogtid bool)

func (*Cluster) SetInteractive

func (cluster *Cluster) SetInteractive(check bool)

func (*Cluster) SetLogLevel

func (cluster *Cluster) SetLogLevel(level int)

func (*Cluster) SetLogStdout

func (cluster *Cluster) SetLogStdout()

func (*Cluster) SetMasterReadOnly

func (cluster *Cluster) SetMasterReadOnly()

func (*Cluster) SetMasterStateFailed

func (cluster *Cluster) SetMasterStateFailed()

func (*Cluster) SetMultiMaster

func (cluster *Cluster) SetMultiMaster(multimaster bool)

func (*Cluster) SetMultiMasterRing

func (cluster *Cluster) SetMultiMasterRing(multimasterring bool)

func (*Cluster) SetMultiMasterWsrep

func (cluster *Cluster) SetMultiMasterWsrep(wsrep bool)

func (*Cluster) SetMultiTierSlave

func (cluster *Cluster) SetMultiTierSlave(multitierslave bool)

topology setter

func (*Cluster) SetPrefMaster

func (cluster *Cluster) SetPrefMaster(PrefMaster string)

func (*Cluster) SetProxyServerMaintenance

func (cluster *Cluster) SetProxyServerMaintenance(serverid uint)

func (*Cluster) SetReadOnly

func (cluster *Cluster) SetReadOnly(check bool)

func (*Cluster) SetRejoin

func (cluster *Cluster) SetRejoin(check bool)

func (*Cluster) SetRejoinBackupBinlog

func (cluster *Cluster) SetRejoinBackupBinlog(check bool)

func (*Cluster) SetRejoinDump

func (cluster *Cluster) SetRejoinDump(check bool)

func (*Cluster) SetRejoinFlashback

func (cluster *Cluster) SetRejoinFlashback(check bool)

func (*Cluster) SetRejoinSemisync

func (cluster *Cluster) SetRejoinSemisync(check bool)

func (*Cluster) SetRplChecks

func (cluster *Cluster) SetRplChecks(check bool)

func (*Cluster) SetRplMaxDelay

func (cluster *Cluster) SetRplMaxDelay(delay int64)

func (*Cluster) SetSlavesReadOnly

func (cluster *Cluster) SetSlavesReadOnly(check bool)

func (*Cluster) SetState

func (cluster *Cluster) SetState(key string, s state.State)

func (*Cluster) SetSwitchSync

func (cluster *Cluster) SetSwitchSync(check bool)

func (*Cluster) SetTestMode

func (cluster *Cluster) SetTestMode(check bool)

func (*Cluster) SetTestStartCluster

func (cluster *Cluster) SetTestStartCluster(check bool)

func (*Cluster) SetTestStopCluster

func (cluster *Cluster) SetTestStopCluster(check bool)

func (*Cluster) SetTraffic

func (cluster *Cluster) SetTraffic(traffic bool)

func (*Cluster) ShutdownDatabase

func (cluster *Cluster) ShutdownDatabase(server *ServerMonitor) error

func (*Cluster) SpiderSetShardsRepl

func (cluster *Cluster) SpiderSetShardsRepl()

func (*Cluster) SpiderShardsDiscovery

func (cluster *Cluster) SpiderShardsDiscovery()

func (*Cluster) StartAllNodes

func (cluster *Cluster) StartAllNodes() error

func (*Cluster) StartDatabaseService

func (cluster *Cluster) StartDatabaseService(server *ServerMonitor) error

func (*Cluster) StartDatabaseWaitRejoin

func (cluster *Cluster) StartDatabaseWaitRejoin(server *ServerMonitor) error

func (*Cluster) StartSlaves

func (cluster *Cluster) StartSlaves() error

func (*Cluster) Stop

func (cluster *Cluster) Stop()

func (*Cluster) StopDatabaseService

func (cluster *Cluster) StopDatabaseService(server *ServerMonitor) error

func (*Cluster) StopSlaves

func (cluster *Cluster) StopSlaves() error

func (*Cluster) SwitchCleanAll

func (cluster *Cluster) SwitchCleanAll()

func (*Cluster) SwitchFailSync

func (cluster *Cluster) SwitchFailSync()

func (*Cluster) SwitchOver

func (cluster *Cluster) SwitchOver()

func (*Cluster) SwitchPseudoGTID

func (cluster *Cluster) SwitchPseudoGTID()

func (*Cluster) SwitchReadOnly

func (cluster *Cluster) SwitchReadOnly()

func (*Cluster) SwitchRejoin

func (cluster *Cluster) SwitchRejoin()

func (*Cluster) SwitchRejoinBackupBinlog

func (cluster *Cluster) SwitchRejoinBackupBinlog()

func (*Cluster) SwitchRejoinDump

func (cluster *Cluster) SwitchRejoinDump()

func (*Cluster) SwitchRejoinFlashback

func (cluster *Cluster) SwitchRejoinFlashback()

func (*Cluster) SwitchRejoinSemisync

func (cluster *Cluster) SwitchRejoinSemisync()

func (*Cluster) SwitchRplChecks

func (cluster *Cluster) SwitchRplChecks()

func (*Cluster) SwitchServerMaintenance

func (cluster *Cluster) SwitchServerMaintenance(serverid uint)

func (*Cluster) SwitchSwitchoverSync

func (cluster *Cluster) SwitchSwitchoverSync()

func (*Cluster) SwitchVerbosity

func (cluster *Cluster) SwitchVerbosity()

func (*Cluster) SwitchoverWaitTest

func (cluster *Cluster) SwitchoverWaitTest()

func (*Cluster) ToggleInteractive

func (cluster *Cluster) ToggleInteractive()

func (*Cluster) TopologyClusterDown

func (cluster *Cluster) TopologyClusterDown() bool

TopologyClusterDown track state all ckuster down

func (*Cluster) TopologyDiscover

func (cluster *Cluster) TopologyDiscover() error

Start of topology detection Create a connection to each host and build list of slaves.

func (*Cluster) Unprovision

func (cluster *Cluster) Unprovision()

func (*Cluster) UnprovisionDatabaseService

func (cluster *Cluster) UnprovisionDatabaseService(server *ServerMonitor) error

func (*Cluster) UnprovisionProxyService

func (cluster *Cluster) UnprovisionProxyService(prx *Proxy) error

func (*Cluster) VMasterFailover

func (cluster *Cluster) VMasterFailover(fail bool) bool

func (*Cluster) WaitBootstrapDiscovery

func (cluster *Cluster) WaitBootstrapDiscovery() error

func (*Cluster) WaitClusterStop

func (cluster *Cluster) WaitClusterStop() error

func (*Cluster) WaitDatabaseStart

func (cluster *Cluster) WaitDatabaseStart(server *ServerMonitor) error

func (*Cluster) WaitFailover

func (cluster *Cluster) WaitFailover(wg *sync.WaitGroup)

func (*Cluster) WaitFailoverEnd

func (cluster *Cluster) WaitFailoverEnd() error

func (*Cluster) WaitFailoverEndState

func (cluster *Cluster) WaitFailoverEndState()

func (*Cluster) WaitMariaDBStop

func (cluster *Cluster) WaitMariaDBStop(server *ServerMonitor) error

func (*Cluster) WaitProxyEqualMaster

func (cluster *Cluster) WaitProxyEqualMaster() error

func (*Cluster) WaitRejoin

func (cluster *Cluster) WaitRejoin(wg *sync.WaitGroup)

func (*Cluster) WaitSwitchover

func (cluster *Cluster) WaitSwitchover(wg *sync.WaitGroup)

type Crash

type Crash struct {
	URL                         string
	FailoverMasterLogFile       string
	FailoverMasterLogPos        string
	NewMasterLogFile            string
	NewMasterLogPos             string
	FailoverSemiSyncSlaveStatus bool
	FailoverIOGtid              *gtid.List
	ElectedMasterURL            string
}

Crash will store informations on a crash based on the replication stream

func (*Crash) Save

func (crash *Crash) Save(path string) error

type Endpoint

type Endpoint struct {
	Host string
	Port int
}

func (*Endpoint) String

func (endpoint *Endpoint) String() string

Returns an endpoint as ip:port formatted string

type Proxy

type Proxy struct {
	Id              string
	Type            string
	Host            string
	Port            string
	TunnelPort      int
	TunnelWritePort int
	Tunnel          bool
	User            string
	Pass            string
	WritePort       int
	ReadPort        int
	ReadWritePort   int
	ReaderHostgroup int
	WriterHostgroup int
	BackendsWrite   []Backend
	BackendsRead    []Backend
	Version         string
}

Proxy defines a proxy

type SSHTunnel

type SSHTunnel struct {
	Local  *Endpoint
	Server *Endpoint
	Remote *Endpoint

	Config *ssh.ClientConfig
}

func (*SSHTunnel) Start

func (tunnel *SSHTunnel) Start() error

Start the tunnel

type ServerMonitor

type ServerMonitor struct {
	Id       string //Unique name given by cluster & crc64(URL) used by test to provision
	Conn     *sqlx.DB
	User     string
	Pass     string `json:"-"`
	URL      string
	DSN      string `json:"-"`
	Host     string
	Port     string
	IP       string
	Strict   string
	ServerID uint

	LogBin                      string
	GTIDBinlogPos               *gtid.List
	CurrentGtid                 *gtid.List
	SlaveGtid                   *gtid.List
	IOGtid                      *gtid.List
	FailoverIOGtid              *gtid.List
	GTIDExecuted                string
	ReadOnly                    string
	State                       string
	PrevState                   string
	FailCount                   int
	FailSuspectHeartbeat        int64
	SemiSyncMasterStatus        bool
	SemiSyncSlaveStatus         bool
	RplMasterStatus             bool
	EventScheduler              bool
	EventStatus                 []dbhelper.Event
	ClusterGroup                *Cluster
	BinaryLogFile               string
	BinaryLogPos                string
	FailoverMasterLogFile       string
	FailoverMasterLogPos        string
	FailoverSemiSyncSlaveStatus bool
	Process                     *os.Process
	MxsServerName               string //Unique server Name in maxscale conf
	MxsServerStatus             string
	ProxysqlHostgroup           string
	HaveSemiSync                bool
	HaveInnodbTrxCommit         bool
	HaveSyncBinLog              bool
	HaveChecksum                bool
	HaveBinlogRow               bool
	HaveBinlogAnnotate          bool
	HaveBinlogSlowqueries       bool
	HaveBinlogCompress          bool
	HaveLogSlaveUpdates         bool
	HaveGtidStrictMode          bool
	HaveMySQLGTID               bool
	HaveMariaDBGTID             bool
	HaveWsrep                   bool
	HaveReadOnly                bool
	Version                     int
	IsWsrepSync                 bool
	IsWsrepDonor                bool
	IsMaxscale                  bool
	IsRelay                     bool
	IsSlave                     bool
	IsVirtualMaster             bool
	IsMaintenance               bool
	Ignored                     bool
	Prefered                    bool
	BinlogDumpThreads           int
	MxsVersion                  int
	MxsHaveGtid                 bool
	RelayLogSize                uint64
	Replications                []dbhelper.SlaveStatus
	LastSeenReplications        []dbhelper.SlaveStatus
	MasterStatus                dbhelper.MasterStatus
	ReplicationSourceName       string
	DBVersion                   *dbhelper.MySQLVersion
	Status                      map[string]string
	Variables                   map[string]string
	EngineInnoDB                map[string]string
	Queries                     map[string]string
	ReplicationHealth           string
	TestConfig                  string
	DictTables                  map[string]dbhelper.Table
	Users                       map[string]dbhelper.Grant `json:"-"`
	// contains filtered or unexported fields
}

ServerMonitor defines a server to monitor.

func (*ServerMonitor) CheckMasterSettings

func (server *ServerMonitor) CheckMasterSettings()

CheckMasterSettings check master variables & enforce if set

func (*ServerMonitor) CheckPrivileges

func (server *ServerMonitor) CheckPrivileges()

CheckPriviledges replication manager user privileges on live servers

func (*ServerMonitor) CheckReplication

func (server *ServerMonitor) CheckReplication() string

CheckReplication Check replication health and return status string

func (*ServerMonitor) CheckSlaveSameMasterGrants

func (server *ServerMonitor) CheckSlaveSameMasterGrants() bool

CheckSlaveSameMasterGrants check same serers grants as the master

func (*ServerMonitor) CheckSlaveSettings

func (server *ServerMonitor) CheckSlaveSettings()

CheckSlaveSettings check slave variables & enforce if set

func (*ServerMonitor) Close

func (server *ServerMonitor) Close()

func (*ServerMonitor) FlushTables

func (server *ServerMonitor) FlushTables() error

func (*ServerMonitor) GenerateDBTemplate

func (server *ServerMonitor) GenerateDBTemplate(collector opensvc.Collector, servers []string, ports []string, agents []opensvc.Host, name string, agent string) (string, error)

func (*ServerMonitor) GetBinlogPosAfterSkipNumberOfEvents

func (server *ServerMonitor) GetBinlogPosAfterSkipNumberOfEvents(file string, pos string, skip int) (string, string, error)

func (*ServerMonitor) GetBinlogPosFromPseudoGTID

func (server *ServerMonitor) GetBinlogPosFromPseudoGTID(GTID string) (string, string, error)

func (*ServerMonitor) GetLastPseudoGTID

func (server *ServerMonitor) GetLastPseudoGTID() (string, error)

func (*ServerMonitor) GetNumberOfEventsAfterPos

func (server *ServerMonitor) GetNumberOfEventsAfterPos(file string, pos string) (int, error)

func (*ServerMonitor) GetPodDockerDBTemplate

func (server *ServerMonitor) GetPodDockerDBTemplate(collector opensvc.Collector, pod string, i int) string

func (*ServerMonitor) GetReplicationDelay

func (server *ServerMonitor) GetReplicationDelay() int64

func (*ServerMonitor) GetReplicationHearbeatPeriod

func (server *ServerMonitor) GetReplicationHearbeatPeriod() float64

func (*ServerMonitor) GetReplicationMasterHost

func (server *ServerMonitor) GetReplicationMasterHost() string

func (*ServerMonitor) GetReplicationMasterPort

func (server *ServerMonitor) GetReplicationMasterPort() string

func (*ServerMonitor) GetReplicationServerID

func (server *ServerMonitor) GetReplicationServerID() uint

func (*ServerMonitor) GetReplicationUsingGtid

func (server *ServerMonitor) GetReplicationUsingGtid() string

func (*ServerMonitor) GetSchemas

func (server *ServerMonitor) GetSchemas() ([]string, error)

func (*ServerMonitor) GetSibling

func (server *ServerMonitor) GetSibling() *ServerMonitor

func (*ServerMonitor) GetSlaveStatus

func (server *ServerMonitor) GetSlaveStatus(name string) (*dbhelper.SlaveStatus, error)

func (*ServerMonitor) GetSlaveStatusLastSeen

func (server *ServerMonitor) GetSlaveStatusLastSeen(name string) (*dbhelper.SlaveStatus, error)

func (*ServerMonitor) GetSnapshot

func (server *ServerMonitor) GetSnapshot() string

func (*ServerMonitor) GetTableFromDict

func (server *ServerMonitor) GetTableFromDict(URI string) dbhelper.Table

func (*ServerMonitor) HasCycling

func (server *ServerMonitor) HasCycling() bool

func (*ServerMonitor) HasGTIDReplication

func (server *ServerMonitor) HasGTIDReplication() bool

func (*ServerMonitor) HasReplicationIssue

func (server *ServerMonitor) HasReplicationIssue() bool

func (*ServerMonitor) HasSiblings

func (server *ServerMonitor) HasSiblings(sib []*ServerMonitor) bool

check if node see same master as the passed list

func (*ServerMonitor) HasSlaves

func (server *ServerMonitor) HasSlaves(sib []*ServerMonitor) bool

func (*ServerMonitor) HasSuperReadOnly

func (server *ServerMonitor) HasSuperReadOnly() bool

func (*ServerMonitor) IsAcid

func (server *ServerMonitor) IsAcid() bool

Check Consistency parameters on server

func (*ServerMonitor) IsDown

func (server *ServerMonitor) IsDown() bool

IsDown() returns true is the server is Failed or Suspect

func (*ServerMonitor) IsIOThreadRunning

func (server *ServerMonitor) IsIOThreadRunning() bool

func (*ServerMonitor) IsIgnored

func (server *ServerMonitor) IsIgnored() bool

func (*ServerMonitor) IsMariaDB

func (server *ServerMonitor) IsMariaDB() bool

func (*ServerMonitor) IsMaster

func (server *ServerMonitor) IsMaster() bool

func (*ServerMonitor) IsMySQL

func (server *ServerMonitor) IsMySQL() bool

func (*ServerMonitor) IsPrefered

func (server *ServerMonitor) IsPrefered() bool

func (*ServerMonitor) IsReadOnly

func (server *ServerMonitor) IsReadOnly() bool

func (*ServerMonitor) IsReadWrite

func (server *ServerMonitor) IsReadWrite() bool

func (*ServerMonitor) IsReplicationBroken

func (server *ServerMonitor) IsReplicationBroken() bool

func (*ServerMonitor) IsSQLThreadRunning

func (server *ServerMonitor) IsSQLThreadRunning() bool

func (*ServerMonitor) Ping

func (server *ServerMonitor) Ping(wg *sync.WaitGroup)

func (*ServerMonitor) Provision

func (server *ServerMonitor) Provision()

func (*ServerMonitor) ReadAllRelayLogs

func (server *ServerMonitor) ReadAllRelayLogs() error

func (*ServerMonitor) Refresh

func (server *ServerMonitor) Refresh() error

Refresh a server object

func (*ServerMonitor) RejoinLoop

func (server *ServerMonitor) RejoinLoop() error

func (*ServerMonitor) RejoinMaster

func (server *ServerMonitor) RejoinMaster() error

RejoinMaster a server that just show up without slave status

func (*ServerMonitor) RejoinMasterSST

func (server *ServerMonitor) RejoinMasterSST() error

func (*ServerMonitor) ResetSlave

func (server *ServerMonitor) ResetSlave() error

func (*ServerMonitor) SendAlert

func (server *ServerMonitor) SendAlert() error

func (*ServerMonitor) SendDatabaseStats

func (server *ServerMonitor) SendDatabaseStats(slaveStatus *dbhelper.SlaveStatus) error

func (*ServerMonitor) SetIgnored

func (server *ServerMonitor) SetIgnored(ignored bool)

func (*ServerMonitor) SetMaintenance

func (server *ServerMonitor) SetMaintenance()

func (*ServerMonitor) SetPrefered

func (server *ServerMonitor) SetPrefered(pref bool)

func (*ServerMonitor) SetReadOnly

func (server *ServerMonitor) SetReadOnly() error

func (*ServerMonitor) SetReadWrite

func (server *ServerMonitor) SetReadWrite() error

func (*ServerMonitor) SetReplicationChannel

func (server *ServerMonitor) SetReplicationChannel(source string) error

func (*ServerMonitor) SetReplicationFromMaxsaleServer

func (server *ServerMonitor) SetReplicationFromMaxsaleServer(master *ServerMonitor) error

func (*ServerMonitor) SetReplicationGTIDCurrentPosFromServer

func (server *ServerMonitor) SetReplicationGTIDCurrentPosFromServer(master *ServerMonitor) error

func (*ServerMonitor) SetReplicationGTIDSlavePosFromServer

func (server *ServerMonitor) SetReplicationGTIDSlavePosFromServer(master *ServerMonitor) error

func (*ServerMonitor) StartSlave

func (server *ServerMonitor) StartSlave() error

func (*ServerMonitor) StopSlave

func (server *ServerMonitor) StopSlave() error

func (*ServerMonitor) StopSlaveIOThread

func (server *ServerMonitor) StopSlaveIOThread() error

func (*ServerMonitor) StopSlaveSQLThread

func (server *ServerMonitor) StopSlaveSQLThread() error

func (*ServerMonitor) SwitchMaintenance

func (server *ServerMonitor) SwitchMaintenance() error

func (*ServerMonitor) Uprovision

func (server *ServerMonitor) Uprovision()

func (*ServerMonitor) UsedGtidAtElection

func (server *ServerMonitor) UsedGtidAtElection(crash *Crash) bool

UseGtid check is replication use gtid

type Test

type Test struct {
	Name       string        `json:"name"`
	Result     string        `json:"result"`
	ConfigFile string        `json:"config-file"`
	ConfigInit config.Config `json:"config-init"`
	ConfigTest config.Config `json:"config-test"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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