cluster

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDownloadCompTasks added in v1.1.0

func BuildDownloadCompTasks(clusterVersion string, instanceIter InstanceIter, bindVersion spec.BindVersion) []*task.StepDisplay

BuildDownloadCompTasks build download component tasks

Types

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. TODO: merge ScaleOutOptions, should check config too when scale out.

type DeployerInstance added in v1.1.0

type DeployerInstance interface {
	Deploy(b *task.Builder, srcPath string, deployDir string, version string, clusterName string, clusterVersion string)
}

DeployerInstance is a instance can deploy to a target deploy directory.

type ExecOptions

type ExecOptions struct {
	Command string
	Sudo    bool
}

ExecOptions for exec shell commanm.

type InstanceIter added in v1.1.0

type InstanceIter interface {
	IterInstance(func(inst spec.Instance))
}

InstanceIter to iterate instance.

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) CleanCluster added in v1.1.0

func (m *Manager) CleanCluster(clusterName string, gOpt operator.Options, cleanOpt operator.Options, skipConfirm bool) error

CleanCluster clean the cluster without destroying it

func (*Manager) Deploy

func (m *Manager) Deploy(
	clusterName string,
	clusterVersion string,
	topoFile string,
	opt DeployOptions,
	afterDeploy func(b *task.Builder, newPart spec.Topology),
	skipConfirm bool,
	optTimeout uint64,
	sshTimeout uint64,
	sshType executor.SSHType,
) error

Deploy a cluster.

func (*Manager) DestroyCluster

func (m *Manager) DestroyCluster(clusterName string, gOpt operator.Options, destroyOpt operator.Options, skipConfirm bool) error

DestroyCluster destroy the cluster.

func (*Manager) Display

func (m *Manager) Display(clusterName string, opt operator.Options) error

Display cluster meta and topology.

func (*Manager) EditConfig

func (m *Manager) EditConfig(clusterName string, skipConfirm bool) error

EditConfig let the user edit the config.

func (*Manager) EnableCluster added in v1.2.0

func (m *Manager) EnableCluster(name string, options operator.Options, isEnable bool) error

EnableCluster enable/disable the service in a cluster

func (*Manager) Exec

func (m *Manager) Exec(clusterName string, opt ExecOptions, gOpt operator.Options) error

Exec shell command on host in the tidb cluster.

func (*Manager) ListCluster

func (m *Manager) ListCluster() error

ListCluster list the clusters.

func (*Manager) Patch

func (m *Manager) Patch(clusterName string, packagePath string, opt operator.Options, overwrite bool) error

Patch the cluster.

func (*Manager) Reload

func (m *Manager) Reload(clusterName string, opt operator.Options, skipRestart bool) error

Reload the cluster.

func (*Manager) Rename added in v1.1.0

func (m *Manager) Rename(clusterName string, opt operator.Options, newName string) error

Rename the cluster

func (*Manager) RestartCluster

func (m *Manager) RestartCluster(clusterName string, options operator.Options) error

RestartCluster restart the cluster.

func (*Manager) ScaleIn

func (m *Manager) ScaleIn(
	clusterName string,
	skipConfirm bool,
	optTimeout uint64,
	sshTimeout uint64,
	sshType executor.SSHType,
	force bool,
	nodes []string,
	scale func(builer *task.Builder, metadata spec.Metadata, tlsCfg *tls.Config),
) error

ScaleIn the cluster.

func (*Manager) ScaleOut

func (m *Manager) ScaleOut(
	clusterName string,
	topoFile string,
	afterDeploy func(b *task.Builder, newPart spec.Topology),
	final func(b *task.Builder, name string, meta spec.Metadata),
	opt ScaleOutOptions,
	skipConfirm bool,
	optTimeout uint64,
	sshTimeout uint64,
	sshType executor.SSHType,
) 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

func (m *Manager) StopCluster(clusterName string, options operator.Options) error

StopCluster stop the cluster.

func (*Manager) Upgrade

func (m *Manager) Upgrade(clusterName string, clusterVersion string, opt operator.Options) error

Upgrade the cluster.

type ScaleOutOptions

type ScaleOutOptions struct {
	User           string // username to login to the SSH server
	SkipCreateUser bool   // don't create user
	IdentityFile   string // path to the private key file
	UsePassword    bool   // use password instead of identity file for ssh connection
	NoLabels       bool   // don't check labels for TiKV instance
}

ScaleOutOptions contains the options for scale out.

Jump to

Keyboard shortcuts

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