Documentation ¶
Index ¶
- Constants
- type DBORepo
- func (dr *DBORepo) Execute(command string, args ...interface{}) (middleware.Result, error)
- func (dr *DBORepo) GetLock(operationID int, addrs []string) error
- func (dr *DBORepo) GetOperationDetails(operationID int) ([]*OperationDetail, error)
- func (dr *DBORepo) GetOperationHistory(id int) (*OperationInfo, error)
- func (dr *DBORepo) InitOperationDetail(operationID int, hostIP string, portNum int) (int, error)
- func (dr *DBORepo) InitOperationHistory(operationType int, addrs []string) (int, error)
- func (dr *DBORepo) ReleaseLock(operationID int) error
- func (dr *DBORepo) Transaction() (middleware.Transaction, error)
- func (dr *DBORepo) UpdateOperationDetail(operationDetailID int, status int, message string) error
- func (dr *DBORepo) UpdateOperationHistory(id int, status int, message string) error
- type Engine
- func (e *Engine) ConfigureGroupReplication() error
- func (e *Engine) ConfigureReplica(addr, sourceHostIP string, sourcePortNum int) error
- func (e *Engine) InitMySQLInstance() error
- func (e *Engine) InitOS() error
- func (e *Engine) InitOSExecutor() error
- func (e *Engine) InitPMMClient() error
- func (e *Engine) Install(operationID int) error
- func (e *Engine) InstallSingleInstance(hostIP string, portNum int, isSource bool) error
- type OSExecutor
- func (ose *OSExecutor) ConfigurePathEnv() error
- func (ose *OSExecutor) GetMySQLPIDList() ([]int, error)
- func (ose *OSExecutor) Init() error
- func (ose *OSExecutor) InitDir() error
- func (ose *OSExecutor) InitExecutor() error
- func (ose *OSExecutor) InitUserAndGroup() error
- func (ose *OSExecutor) InstallMySQLBinary() error
- func (ose *OSExecutor) InstallRPM() error
- func (ose *OSExecutor) Precheck() error
- type OperationDetail
- type OperationInfo
- type PMMExecutor
- func (pe *PMMExecutor) AddService() error
- func (pe *PMMExecutor) CheckConfiguration() (bool, error)
- func (pe *PMMExecutor) CheckPMMClient() (bool, error)
- func (pe *PMMExecutor) CheckServiceExists() (bool, error)
- func (pe *PMMExecutor) ConfigureServer() error
- func (pe *PMMExecutor) Init() error
- func (pe *PMMExecutor) Install() error
- func (pe *PMMExecutor) StartClient() error
- type Service
Constants ¶
const ( SlaveIOThreadRunningField = "Slave_IO_Running" SlaveSQLThreadRunningField = "Slave_SQL_Running" IsRunningValue = "Yes" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBORepo ¶
type DBORepo struct {
Database middleware.Pool
}
func NewDBORepoWithDefault ¶
func NewDBORepoWithDefault() *DBORepo
NewDBORepoWithDefault returns a new *DBORepo with default middleware.Pool
func (*DBORepo) Execute ¶
func (dr *DBORepo) Execute(command string, args ...interface{}) (middleware.Result, error)
Execute executes given command and placeholders on the middleware
func (*DBORepo) GetOperationDetails ¶
func (dr *DBORepo) GetOperationDetails(operationID int) ([]*OperationDetail, error)
GetOperationDetails gets the mysql operation detail from the middleware
func (*DBORepo) GetOperationHistory ¶
func (dr *DBORepo) GetOperationHistory(id int) (*OperationInfo, error)
GetOperationHistory gets the mysql operation history from the middleware
func (*DBORepo) InitOperationDetail ¶
InitOperationDetail initializes the mysql operation detail in the middleware
func (*DBORepo) InitOperationHistory ¶
InitOperationHistory initializes the mysql operation history in the middleware
func (*DBORepo) ReleaseLock ¶
ReleaseLock releases the operation lock of the given host info
func (*DBORepo) Transaction ¶
func (dr *DBORepo) Transaction() (middleware.Transaction, error)
Transaction returns a middleware.Transaction that could execute multiple commands as a transaction
func (*DBORepo) UpdateOperationDetail ¶
UpdateOperationDetail updates the mysql operation detail in the middleware
type Engine ¶
type Engine struct { Mode mode.Mode `json:"mode"` Addrs []string `json:"addrs"` MySQLServer *parameter.MySQLServer `json:"mysql_server"` PMMClient *parameter.PMMClient `json:"pmm_client"` // contains filtered or unexported fields }
func NewEngine ¶
func NewEngine(dboRepo *DBORepo, mysqlVersion *version.Version, m mode.Mode, addrs []string, mysqlServer *parameter.MySQLServer, pmmClient *parameter.PMMClient) *Engine
NewEngine returns a new *Engine
func NewEngineWithDefault ¶
func NewEngineWithDefault(mysqlVersion *version.Version, m mode.Mode, addrs []string, mysqlServer *parameter.MySQLServer, pmmClient *parameter.PMMClient) *Engine
NewEngineWithDefault returns a new *Engine with default values
func (*Engine) ConfigureGroupReplication ¶
ConfigureGroupReplication configures the group replication
func (*Engine) ConfigureReplica ¶
ConfigureReplica configures the replication
func (*Engine) InitMySQLInstance ¶
InitMySQLInstance initializes the mysql instance
func (*Engine) InitOSExecutor ¶
InitOSExecutor initializes the ssh connection
func (*Engine) InitPMMClient ¶
InitPMMClient initializes the pmm client
type OSExecutor ¶
func NewOSExecutor ¶
func NewOSExecutor(sshConn *ssh.Conn, mysqlVersion *version.Version, mysqlServer *parameter.MySQLServer) *OSExecutor
NewOSExecutor returns a new *OSExecutor
func (*OSExecutor) ConfigurePathEnv ¶
func (ose *OSExecutor) ConfigurePathEnv() error
ConfigurePathEnv configures the path environment variable
func (*OSExecutor) GetMySQLPIDList ¶
func (ose *OSExecutor) GetMySQLPIDList() ([]int, error)
GetMySQLPIDList gets the mysql pid list
func (*OSExecutor) InitDir ¶
func (ose *OSExecutor) InitDir() error
InitDir initializes the directory
func (*OSExecutor) InitExecutor ¶
func (ose *OSExecutor) InitExecutor() error
InitExecutor initializes the os executor
func (*OSExecutor) InitUserAndGroup ¶
func (ose *OSExecutor) InitUserAndGroup() error
InitUserAndGroup initializes the user and group
func (*OSExecutor) InstallMySQLBinary ¶
func (ose *OSExecutor) InstallMySQLBinary() error
InstallMySQLBinary installs the mysql binary
func (*OSExecutor) InstallRPM ¶
func (ose *OSExecutor) InstallRPM() error
InstallRPM installs the rpm
type OperationDetail ¶
type OperationDetail struct { ID int `json:"id" middleware:"id"` OperationID int `json:"operation_id" middleware:"operation_id"` HostIP string `json:"host_ip" middleware:"host_ip"` PortNum int `json:"port_num" middleware:"port_num"` Status int `json:"status" middleware:"status"` Message string `json:"message" middleware:"message"` DelFlag int `json:"del_flag" middleware:"del_flag"` CreateTime time.Time `json:"create_time" middleware:"create_time"` LastUpdateTime time.Time `json:"last_update_time" middleware:"last_update_time"` }
func NewOperationDetailWithDefault ¶
func NewOperationDetailWithDefault() *OperationDetail
NewOperationDetailWithDefault returns a new *OperationDetail with default value
type OperationInfo ¶
type OperationInfo struct { ID int `json:"id" middleware:"id"` OperationType int `json:"operation_type" middleware:"operation_type"` Addrs string `json:"addrs" middleware:"addrs"` Status int `json:"status" middleware:"status"` Message string `json:"message" middleware:"message"` DelFlag int `json:"del_flag" middleware:"del_flag"` CreateTime time.Time `json:"create_time" middleware:"create_time"` LastUpdateTime time.Time `json:"last_update_time" middleware:"last_update_time"` }
func NewOperationInfoWithDefault ¶
func NewOperationInfoWithDefault() *OperationInfo
NewOperationInfoWithDefault returns a new *OperationInfo with default value
type PMMExecutor ¶
type PMMExecutor struct {
// contains filtered or unexported fields
}
func NewPMMExecutor ¶
func NewPMMExecutor(sshConn *ssh.Conn, hostIP string, portNum int, pmmClient *parameter.PMMClient) *PMMExecutor
NewPMMExecutor returns a new *PMMExecutor
func (*PMMExecutor) AddService ¶
func (pe *PMMExecutor) AddService() error
AddService adds service to pmm server
func (*PMMExecutor) CheckConfiguration ¶
func (pe *PMMExecutor) CheckConfiguration() (bool, error)
CheckConfiguration checks if pmm is configured
func (*PMMExecutor) CheckPMMClient ¶
func (pe *PMMExecutor) CheckPMMClient() (bool, error)
CheckPMMClient checks if pmm client is installed
func (*PMMExecutor) CheckServiceExists ¶
func (pe *PMMExecutor) CheckServiceExists() (bool, error)
CheckServiceExists checks if the service exists
func (*PMMExecutor) ConfigureServer ¶
func (pe *PMMExecutor) ConfigureServer() error
ConfigureServer configures pmm server
func (*PMMExecutor) Init ¶
func (pe *PMMExecutor) Init() error
Init initializes pmm client on the host
func (*PMMExecutor) Install ¶
func (pe *PMMExecutor) Install() error
Install installs pmm client to the host
func (*PMMExecutor) StartClient ¶
func (pe *PMMExecutor) StartClient() error
StartClient starts pmm client
type Service ¶
func NewService ¶
NewService returns a new *Service
func NewServiceWithDefault ¶
NewServiceWithDefault returns a new *Service with default value