Documentation ¶
Index ¶
- func SetClusterSSH(ctx context.Context, topo spec.Topology, deployUser string, sshTimeout uint64, ...) error
- func SetSSHKeySet(ctx context.Context, privateKeyPath string, publicKeyPath string) error
- type CheckOptions
- type Cluster
- type DeployOptions
- type DeployerInstance
- type ExecOptions
- type HostCheckResult
- type InstInfo
- type Manager
- func (m *Manager) CheckCluster(clusterOrTopoName string, opt CheckOptions, gOpt operator.Options) error
- func (m *Manager) CleanCluster(name string, gOpt operator.Options, cleanOpt operator.Options, ...) error
- func (m *Manager) Deploy(name string, clusterVersion string, topoFile string, opt DeployOptions, ...) error
- func (m *Manager) DestroyCluster(name string, gOpt operator.Options, destroyOpt operator.Options, ...) error
- func (m *Manager) DestroyTombstone(name string, gOpt operator.Options, skipConfirm bool) error
- func (m *Manager) Display(name string, opt operator.Options) error
- func (m *Manager) EditConfig(name string, skipConfirm bool) error
- func (m *Manager) EnableCluster(name string, options operator.Options, isEnable bool) error
- func (m *Manager) Exec(name string, opt ExecOptions, gOpt operator.Options) error
- func (m *Manager) GetClusterList() ([]Cluster, error)
- func (m *Manager) GetClusterTopology(name string, opt operator.Options) ([]InstInfo, error)
- func (m *Manager) ListCluster() error
- func (m *Manager) Patch(name string, packagePath string, opt operator.Options, ...) error
- func (m *Manager) Reload(name string, opt operator.Options, skipRestart, skipConfirm bool) error
- func (m *Manager) Rename(name string, opt operator.Options, newName string, skipConfirm bool) error
- func (m *Manager) RestartCluster(name string, options operator.Options, skipConfirm bool) error
- func (m *Manager) ScaleIn(name string, skipConfirm bool, gOpt operator.Options, ...) error
- func (m *Manager) ScaleOut(name string, topoFile string, ...) error
- func (m *Manager) StartCluster(name string, options operator.Options, ...) error
- func (m *Manager) StopCluster(name string, options operator.Options, skipConfirm bool) error
- func (m *Manager) Transfer(name string, opt TransferOptions, gOpt operator.Options) error
- func (m *Manager) Upgrade(name string, clusterVersion string, opt operator.Options, ...) error
- type TransferOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CheckOptions ¶
type CheckOptions struct { User string // username to login to the SSH server IdentityFile string // path to the private key file UsePassword bool // use password instead of identity file for ssh connection Opr *operator.CheckOptions ApplyFix bool // try to apply fixes of failed checks ExistCluster bool // check an exist cluster }
CheckOptions contains the options for check command
type Cluster ¶
type Cluster struct { Name string `json:"name"` User string `json:"user"` Version string `json:"version"` Path string `json:"path"` PrivateKey string `json:"private_key"` }
Cluster represents a clsuter
type DeployOptions ¶
type DeployOptions struct { User string // username to login to the SSH server SkipCreateUser bool // don't create the user IdentityFile string // path to the private key file UsePassword bool // use password instead of identity file for ssh connection IgnoreConfigCheck bool // ignore config check result NoLabels bool // don't check labels for TiKV instance }
DeployOptions contains the options for scale out.
type DeployerInstance ¶
type DeployerInstance interface {
Deploy(b *task.Builder, srcPath string, deployDir string, version string, name string, clusterVersion string)
}
DeployerInstance is a instance can deploy to a target deploy directory.
type ExecOptions ¶
ExecOptions for exec shell commanm.
type HostCheckResult ¶
type HostCheckResult struct { Node string `json:"node"` Name string `json:"name"` Status string `json:"status"` Message string `json:"message"` }
HostCheckResult represents the check result of each node
type InstInfo ¶
type InstInfo struct { ID string `json:"id"` Role string `json:"role"` Host string `json:"host"` Ports string `json:"ports"` OsArch string `json:"os_arch"` Status string `json:"status"` Since string `json:"since"` DataDir string `json:"data_dir"` DeployDir string `json:"deploy_dir"` ComponentName string Port int }
InstInfo represents an instance info
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager to deploy a cluster.
func NewManager ¶
func NewManager(sysName string, specManager *spec.SpecManager, bindVersion spec.BindVersion) *Manager
NewManager create a Manager.
func (*Manager) CheckCluster ¶
func (m *Manager) CheckCluster(clusterOrTopoName string, opt CheckOptions, gOpt operator.Options) error
CheckCluster check cluster before deploying or upgrading
func (*Manager) CleanCluster ¶
func (m *Manager) CleanCluster(name string, gOpt operator.Options, cleanOpt operator.Options, skipConfirm bool) error
CleanCluster cleans the cluster without destroying it
func (*Manager) Deploy ¶
func (m *Manager) Deploy( name string, clusterVersion string, topoFile string, opt DeployOptions, afterDeploy func(b *task.Builder, newPart spec.Topology), skipConfirm bool, gOpt operator.Options, ) error
Deploy a cluster.
func (*Manager) DestroyCluster ¶
func (m *Manager) DestroyCluster(name string, gOpt operator.Options, destroyOpt operator.Options, skipConfirm bool) error
DestroyCluster destroy the cluster.
func (*Manager) DestroyTombstone ¶
DestroyTombstone destroy and remove instances that is in tombstone state
func (*Manager) EditConfig ¶
EditConfig lets the user edit the cluster's config.
func (*Manager) EnableCluster ¶
EnableCluster enable/disable the service in a cluster
func (*Manager) GetClusterList ¶
GetClusterList get the clusters list.
func (*Manager) GetClusterTopology ¶
GetClusterTopology get the topology of the cluster.
func (*Manager) Patch ¶
func (m *Manager) Patch(name string, packagePath string, opt operator.Options, overwrite, offline, skipConfirm bool) error
Patch the cluster.
func (*Manager) RestartCluster ¶
RestartCluster restart the cluster.
func (*Manager) ScaleIn ¶
func (m *Manager) ScaleIn( name string, skipConfirm bool, gOpt operator.Options, scale func(builer *task.Builder, metadata spec.Metadata, tlsCfg *tls.Config), ) error
ScaleIn the cluster.
func (*Manager) ScaleOut ¶
func (m *Manager) ScaleOut( name string, topoFile string, afterDeploy func(b *task.Builder, newPart spec.Topology), final func(b *task.Builder, name string, meta spec.Metadata), opt DeployOptions, skipConfirm bool, gOpt operator.Options, ) error
ScaleOut scale out the cluster.
func (*Manager) StartCluster ¶
func (m *Manager) StartCluster(name string, options operator.Options, fn ...func(b *task.Builder, metadata spec.Metadata)) error
StartCluster start the cluster with specified name.
func (*Manager) StopCluster ¶
StopCluster stop the cluster.
type TransferOptions ¶
TransferOptions for exec shell commanm.