server

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 23 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 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

func UserNotExists added in v0.12.1

func UserNotExists(err error) bool

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, transactionQueueingWait 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, uptime time.Duration, err error)

func (*Agent) IsMySQL84 added in v0.12.0

func (a *Agent) IsMySQL84(ctx context.Context) (bool, 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 file

func (*Agent) RotateLogIfSizeExceeded added in v0.13.0

func (a *Agent) RotateLogIfSizeExceeded(rotationSize int64)

RotateLogIfSizeExceeded rotates log file if it exceeds rotationSize

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"`
	SourceHost        string `db:"Source_Host"`
	RetrievedGtidSet  string `db:"Retrieved_Gtid_Set"`
	ExecutedGtidSet   string `db:"Executed_Gtid_Set"`
	ReplicaIORunning  string `db:"Replica_IO_Running"`
	ReplicaSQLRunning string `db:"Replica_SQL_Running"`

	// All of variables from here are NOT used in MOCO's reconcile
	ReplicaIOState            string        `db:"Replica_IO_State"`
	SourceUser                string        `db:"Source_User"`
	SourcePort                int           `db:"Source_Port"`
	ConnectRetry              int           `db:"Connect_Retry"`
	SourceLogFile             string        `db:"Source_Log_File"`
	ReadSourceLogPos          int           `db:"Read_Source_Log_Pos"`
	RelayLogFile              string        `db:"Relay_Log_File"`
	RelayLogPos               int           `db:"Relay_Log_Pos"`
	RelaySourceLogFile        string        `db:"Relay_Source_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"`
	ExecSourceLogPos          int           `db:"Exec_Source_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"`
	SourceSSLAllowed          string        `db:"Source_SSL_Allowed"`
	SourceSSLCAFile           string        `db:"Source_SSL_CA_File"`
	SourceSSLCAPath           string        `db:"Source_SSL_CA_Path"`
	SourceSSLCert             string        `db:"Source_SSL_Cert"`
	SourceSSLCipher           string        `db:"Source_SSL_Cipher"`
	SourceSSLKey              string        `db:"Source_SSL_Key"`
	SecondsBehindSource       sql.NullInt64 `db:"Seconds_Behind_Source"`
	SourceSSLVerifyServerCert string        `db:"Source_SSL_Verify_Server_Cert"`
	ReplicateIgnoreServerIds  string        `db:"Replicate_Ignore_Server_Ids"`
	SourceServerID            int           `db:"Source_Server_Id"`
	SourceUUID                string        `db:"Source_UUID"`
	SourceInfoFile            string        `db:"Source_Info_File"`
	SQLDelay                  int           `db:"SQL_Delay"`
	SQLRemainingDelay         sql.NullInt64 `db:"SQL_Remaining_Delay"`
	ReplicaSQLRunningState    string        `db:"Replica_SQL_Running_State"`
	SourceRetryCount          int           `db:"Source_Retry_Count"`
	SourceBind                string        `db:"Source_Bind"`
	LastIOErrorTimestamp      string        `db:"Last_IO_Error_Timestamp"`
	LastSQLErrorTimestamp     string        `db:"Last_SQL_Error_Timestamp"`
	SourceSSLCrl              string        `db:"Source_SSL_Crl"`
	SourceSSLCrlpath          string        `db:"Source_SSL_Crlpath"`
	AutoPosition              string        `db:"Auto_Position"`
	ReplicateRewriteDB        string        `db:"Replicate_Rewrite_DB"`
	ChannelName               string        `db:"Channel_Name"`
	SourceTLSVersion          string        `db:"Source_TLS_Version"`
	Sourcepublickeypath       string        `db:"Source_public_key_path"`
	GetSourcepublickey        string        `db:"Get_Source_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