Documentation ¶
Index ¶
- Constants
- type App
- func (app *App) CliAbort() int
- func (app *App) CliDisableMaintenance(waitTimeout time.Duration) int
- func (app *App) CliEnableMaintenance(waitTimeout time.Duration) int
- func (app *App) CliGetMaintenance() int
- func (app *App) CliHostAdd(host string, priority *int, dryRun bool, skipRedisCheck bool) int
- func (app *App) CliHostList() int
- func (app *App) CliHostRemove(host string) int
- func (app *App) CliInfo(verbose bool) int
- func (app *App) CliState(verbose bool) int
- func (app *App) CliSwitch(switchFrom, switchTo string, waitTimeout time.Duration) int
- func (app *App) GetActiveNodes() ([]string, error)
- func (app *App) GetMaintenance() (*Maintenance, error)
- func (app *App) Run() int
- type HostState
- type Maintenance
- type PoisonPill
- type ReplicaState
- type SentiCacheState
- type Switchover
- type SwitchoverProgress
- type SwitchoverResult
Constants ¶
const ( // CauseManual means switchover was issued via command line CauseManual = "manual" // CauseWorker means switchover was initated via MDB worker (set directly to dcs) CauseWorker = "worker" // CauseAuto means failover was started automatically by failure detection process CauseAuto = "auto" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is main application structure
func (*App) CliDisableMaintenance ¶
CliDisableMaintenance disables maintenance mode
func (*App) CliEnableMaintenance ¶
CliEnableMaintenance enables maintenance mode
func (*App) CliGetMaintenance ¶
CliGetMaintenance prints on/off depending on current maintenance status
func (*App) CliHostAdd ¶
CliHostAdd add hosts to the list of hosts in dcs
func (*App) CliHostList ¶
CliHostList prints list of hosts from dcs
func (*App) CliHostRemove ¶
CliHostRemove removes host from the list of hosts in dcs
func (*App) GetActiveNodes ¶
GetActiveNodes returns a list of active nodes from DCS
func (*App) GetMaintenance ¶
func (app *App) GetMaintenance() (*Maintenance, error)
GetMaintenance returns current maintenance status from dcs
type HostState ¶
type HostState struct { CheckBy string `json:"check_by"` CheckAt time.Time `json:"check_at"` PingOk bool `json:"ping_ok"` PingStable bool `json:"ping_stable"` IP string `json:"ip"` RunID string `json:"runid"` IsMaster bool `json:"is_master"` IsOffline bool `json:"is_offline"` IsReadOnly bool `json:"is_read_only"` IsReplPaused bool `json:"is_repl_paused"` MasterReplicationOffset int64 `json:"master_replication_offset"` SecondReplicationOffset int64 `json:"second_replication_offset"` ReplicationBacklogStart int64 `json:"replication_backlog_start"` ReplicationBacklogSize int64 `json:"replication_backlog_size"` ReplicationID string `json:"replication_id"` ReplicationID2 string `json:"replication_id2"` Error string `json:"error"` ConnectedReplicas []string `json:"connected_replicas"` ReplicaState *ReplicaState `json:"replica_state"` SentiCacheState *SentiCacheState `json:"senticache_state"` }
HostState contains status check performed by some rdsync process
type Maintenance ¶
type Maintenance struct { InitiatedBy string `json:"initiated_by"` InitiatedAt time.Time `json:"initiated_at"` RdSyncPaused bool `json:"rdsync_paused"` ShouldLeave bool `json:"should_leave"` }
Maintenance struct presence means that cluster under manual control
func (*Maintenance) String ¶
func (m *Maintenance) String() string
type PoisonPill ¶
type PoisonPill struct { Applied bool `json:"applied"` InitiatedAt time.Time `json:"initiated_at"` InitiatedBy string `json:"initiated_by"` TargetHost string `json:"target_host"` Cause string `json:"cause"` }
func (*PoisonPill) String ¶
func (pp *PoisonPill) String() string
type ReplicaState ¶
type ReplicaState struct { MasterHost string `json:"master_host"` MasterLinkState bool `json:"master_link_state"` MasterLinkDownTime int64 `json:"master_link_down_time"` MasterSyncInProgress bool `json:"master_sync_in_progress"` ReplicationOffset int64 `json:"replication_offset"` }
ReplicaState contains replica specific info. Master always has this state empty
func (*ReplicaState) String ¶
func (rs *ReplicaState) String() string
type SentiCacheState ¶
SentiCacheState contains senticache specific info. Cluster-mode nodes has this state empty
func (*SentiCacheState) String ¶
func (ss *SentiCacheState) String() string
type Switchover ¶
type Switchover struct { From string `json:"from"` To string `json:"to"` Cause string `json:"cause"` InitiatedBy string `json:"initiated_by"` InitiatedAt time.Time `json:"initiated_at"` StartedBy string `json:"started_by"` StartedAt time.Time `json:"started_at"` Result *SwitchoverResult `json:"result"` Progress *SwitchoverProgress `json:"progress"` RunCount int `json:"run_count"` }
Switchover contains info about currently running or scheduled switchover/failover process
func (*Switchover) String ¶
func (sw *Switchover) String() string