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 ClusterMetaInfo
- type DeployOptions
- type DeployerInstance
- type ExecOptions
- type HostCheckResult
- type InstInfo
- type JSONOutput
- 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, gOpt 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, gOpt 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, gOpt 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, gOpt operator.Options, ...) error
- func (m *Manager) StopCluster(name string, gOpt 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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
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 ClusterMetaInfo ¶ added in v1.5.0
type ClusterMetaInfo struct { ClusterType string `json:"cluster_type"` ClusterName string `json:"cluster_name"` ClusterVersion string `json:"cluster_version"` DeployUser string `json:"deploy_user"` SSHType string `json:"ssh_type"` TLSEnabled bool `json:"tls_enabled"` TLSCACert string `json:"tls_ca_cert,omitempty"` TLSClientCert string `json:"tls_client_cert,omitempty"` TLSClientKey string `json:"tls_client_key,omitempty"` DashboardURL string `json:"dashboard_url,omitempty"` }
ClusterMetaInfo hold the structure for the JSON output of the dashboard info
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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
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 JSONOutput ¶ added in v1.5.0
type JSONOutput struct { ClusterMetaInfo ClusterMetaInfo `json:"cluster_meta"` InstanceInfos []InstInfo `json:"instances"` }
JSONOutput holds the structure for the JSON output of `tiup cluster display --json`
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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
GetClusterList get the clusters list.
func (*Manager) GetClusterTopology ¶ added in v1.4.0
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, gOpt 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.