server

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugins = []Plugin{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}
View Source
var Users = []UserSetting{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}

Functions

func GetMySQLConnLocalSocket added in v0.6.0

func GetMySQLConnLocalSocket(user, password, socket string) (*sqlx.DB, error)

func Init added in v0.6.0

func Init(ctx context.Context, db *sqlx.DB, socket string) error

func InitExternal added in v0.6.0

func InitExternal(ctx context.Context, db *sqlx.DB) error

func IsAccessDenied added in v0.6.0

func IsAccessDenied(err error) bool

func IsRestartFailed added in v0.6.0

func IsRestartFailed(err error) bool

func NewAgentService added in v0.6.0

func NewAgentService(agent *Agent) proto.AgentServer

NewAgentService creates a new AgentServer

Types

type Agent

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

Agent is the agent to executes some MySQL commands of the own Pod

func New

func New(config MySQLAccessorConfig, clusterName, socket, logDir string, maxDelay time.Duration, logger logr.Logger) (*Agent, error)

New returns an Agent

func (*Agent) Clone

func (a *Agent) Clone(ctx context.Context, req *proto.CloneRequest) error

func (*Agent) CloseDB added in v0.6.0

func (a *Agent) CloseDB() error

func (*Agent) GetMySQLCloneStateStatus added in v0.6.0

func (a *Agent) GetMySQLCloneStateStatus(ctx context.Context) (*MySQLCloneStateStatus, error)

func (*Agent) GetMySQLGlobalVariable added in v0.6.0

func (a *Agent) GetMySQLGlobalVariable(ctx context.Context) (*MySQLGlobalVariablesStatus, error)

func (*Agent) GetMySQLPrimaryStatus added in v0.6.0

func (a *Agent) GetMySQLPrimaryStatus(ctx context.Context) (*MySQLPrimaryStatus, error)

func (*Agent) GetMySQLReplicaStatus added in v0.6.0

func (a *Agent) GetMySQLReplicaStatus(ctx context.Context) (*MySQLReplicaStatus, error)

func (*Agent) GetTransactionTimestamps added in v0.6.5

func (a *Agent) GetTransactionTimestamps(ctx context.Context) (queued, applied time.Time, err error)

func (*Agent) MySQLDHealth added in v0.6.0

func (a *Agent) MySQLDHealth(w http.ResponseWriter, r *http.Request)

Health returns the health check result of own MySQL

func (*Agent) MySQLDReady added in v0.6.0

func (a *Agent) MySQLDReady(w http.ResponseWriter, r *http.Request)

func (*Agent) RotateLog

func (a *Agent) RotateLog()

RotateLog rotates log files

type MySQLAccessorConfig added in v0.6.0

type MySQLAccessorConfig struct {
	Host              string
	Port              int
	Password          string
	ConnMaxIdleTime   time.Duration
	ConnectionTimeout time.Duration
	ReadTimeout       time.Duration
}

type MySQLCloneStateStatus added in v0.6.0

type MySQLCloneStateStatus struct {
	State sql.NullString `db:"state"`
}

MySQLCloneStateStatus defines the observed clone state of a MySQL instance

type MySQLGlobalVariablesStatus added in v0.6.0

type MySQLGlobalVariablesStatus struct {
	ReadOnly                           bool           `db:"@@read_only"`
	SuperReadOnly                      bool           `db:"@@super_read_only"`
	RplSemiSyncMasterWaitForSlaveCount int            `db:"@@rpl_semi_sync_master_wait_for_slave_count"`
	CloneValidDonorList                sql.NullString `db:"@@clone_valid_donor_list"`
}

MySQLGlobalVariablesStatus defines the observed global variable state of a MySQL instance

type MySQLPrimaryStatus added in v0.6.0

type MySQLPrimaryStatus struct {
	ExecutedGtidSet string `db:"Executed_Gtid_Set"`

	// All of variables from here are NOT used in MOCO's reconcile
	File           string `db:"File"`
	Position       string `db:"Position"`
	BinlogDoDB     string `db:"Binlog_Do_DB"`
	BinlogIgnoreDB string `db:"Binlog_Ignore_DB"`
}

MySQLPrimaryStatus defines the observed state of a primary

type MySQLReplicaStatus added in v0.6.0

type MySQLReplicaStatus struct {
	LastIOErrno      int    `db:"Last_IO_Errno"`
	LastIOError      string `db:"Last_IO_Error"`
	LastSQLErrno     int    `db:"Last_SQL_Errno"`
	LastSQLError     string `db:"Last_SQL_Error"`
	MasterHost       string `db:"Master_Host"`
	RetrievedGtidSet string `db:"Retrieved_Gtid_Set"`
	ExecutedGtidSet  string `db:"Executed_Gtid_Set"`
	SlaveIORunning   string `db:"Slave_IO_Running"`
	SlaveSQLRunning  string `db:"Slave_SQL_Running"`

	// All of variables from here are NOT used in MOCO's reconcile
	SlaveIOState              string        `db:"Slave_IO_State"`
	MasterUser                string        `db:"Master_User"`
	MasterPort                int           `db:"Master_Port"`
	ConnectRetry              int           `db:"Connect_Retry"`
	MasterLogFile             string        `db:"Master_Log_File"`
	ReadMasterLogPos          int           `db:"Read_Master_Log_Pos"`
	RelayLogFile              string        `db:"Relay_Log_File"`
	RelayLogPos               int           `db:"Relay_Log_Pos"`
	RelayMasterLogFile        string        `db:"Relay_Master_Log_File"`
	ReplicateDoDB             string        `db:"Replicate_Do_DB"`
	ReplicateIgnoreDB         string        `db:"Replicate_Ignore_DB"`
	ReplicateDoTable          string        `db:"Replicate_Do_Table"`
	ReplicateIgnoreTable      string        `db:"Replicate_Ignore_Table"`
	ReplicateWildDoTable      string        `db:"Replicate_Wild_Do_Table"`
	ReplicateWildIgnoreTable  string        `db:"Replicate_Wild_Ignore_Table"`
	LastErrno                 int           `db:"Last_Errno"`
	LastError                 string        `db:"Last_Error"`
	SkipCounter               int           `db:"Skip_Counter"`
	ExecMasterLogPos          int           `db:"Exec_Master_Log_Pos"`
	RelayLogSpace             int           `db:"Relay_Log_Space"`
	UntilCondition            string        `db:"Until_Condition"`
	UntilLogFile              string        `db:"Until_Log_File"`
	UntilLogPos               int           `db:"Until_Log_Pos"`
	MasterSSLAllowed          string        `db:"Master_SSL_Allowed"`
	MasterSSLCAFile           string        `db:"Master_SSL_CA_File"`
	MasterSSLCAPath           string        `db:"Master_SSL_CA_Path"`
	MasterSSLCert             string        `db:"Master_SSL_Cert"`
	MasterSSLCipher           string        `db:"Master_SSL_Cipher"`
	MasterSSLKey              string        `db:"Master_SSL_Key"`
	SecondsBehindMaster       sql.NullInt64 `db:"Seconds_Behind_Master"`
	MasterSSLVerifyServerCert string        `db:"Master_SSL_Verify_Server_Cert"`
	ReplicateIgnoreServerIds  string        `db:"Replicate_Ignore_Server_Ids"`
	MasterServerID            int           `db:"Master_Server_Id"`
	MasterUUID                string        `db:"Master_UUID"`
	MasterInfoFile            string        `db:"Master_Info_File"`
	SQLDelay                  int           `db:"SQL_Delay"`
	SQLRemainingDelay         sql.NullInt64 `db:"SQL_Remaining_Delay"`
	SlaveSQLRunningState      string        `db:"Slave_SQL_Running_State"`
	MasterRetryCount          int           `db:"Master_Retry_Count"`
	MasterBind                string        `db:"Master_Bind"`
	LastIOErrorTimestamp      string        `db:"Last_IO_Error_Timestamp"`
	LastSQLErrorTimestamp     string        `db:"Last_SQL_Error_Timestamp"`
	MasterSSLCrl              string        `db:"Master_SSL_Crl"`
	MasterSSLCrlpath          string        `db:"Master_SSL_Crlpath"`
	AutoPosition              string        `db:"Auto_Position"`
	ReplicateRewriteDB        string        `db:"Replicate_Rewrite_DB"`
	ChannelName               string        `db:"Channel_Name"`
	MasterTLSVersion          string        `db:"Master_TLS_Version"`
	Masterpublickeypath       string        `db:"Master_public_key_path"`
	Getmasterpublickey        string        `db:"Get_master_public_key"`
	NetworkNamespace          string        `db:"Network_Namespace"`
}

MySQLReplicaStatus defines the observed state of a replica

type Plugin added in v0.6.0

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

Plugin represents a plugin for mysqld.

type UserSetting added in v0.6.0

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

UserSetting represents settings for a MySQL user.

Jump to

Keyboard shortcuts

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