manager

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const CheckDiskCapacityCommand = "df -h | grep '^/dev/'"
View Source
const CheckProcessCommand = "ps aux | grep -E '(ts-meta|ts-sql|ts-store)' | grep -v grep | awk '{print $11}'"

Variables

This section is empty.

Functions

func GenCheckPortCommand

func GenCheckPortCommand(port int) string

func ValidateClusterNameOrError

func ValidateClusterNameOrError(n string) error

ValidateClusterNameOrError validates a cluster name and returns error if the name is invalid.

Types

type ClusterStatusPerServer

type ClusterStatusPerServer struct {
	Ip               string
	RunningProcesses []string     // ts-meta,ts-sql,ts-store
	PortOccupancy    map[int]bool // port->occupancy or not
	DiskCapacity     []string     // disk->capacity
}

type DeployerInstance

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

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

type GeminiInstaller

type GeminiInstaller struct {
	// contains filtered or unexported fields
}

func (*GeminiInstaller) Close

func (d *GeminiInstaller) Close()

func (*GeminiInstaller) Install

func (d *GeminiInstaller) Install() error

func (*GeminiInstaller) PrepareForInstall

func (d *GeminiInstaller) PrepareForInstall() error

type GeminiStarter

type GeminiStarter struct {
	// contains filtered or unexported fields
}

func (*GeminiStarter) Close

func (d *GeminiStarter) Close()

func (*GeminiStarter) PrepareForStart

func (d *GeminiStarter) PrepareForStart() error

func (*GeminiStarter) Start

func (d *GeminiStarter) Start() error

type GeminiStatusPatroller

type GeminiStatusPatroller struct {
	// contains filtered or unexported fields
}

func (*GeminiStatusPatroller) Close

func (d *GeminiStatusPatroller) Close()

func (*GeminiStatusPatroller) Patrol

func (d *GeminiStatusPatroller) Patrol() error

func (*GeminiStatusPatroller) PrepareForPatrol

func (d *GeminiStatusPatroller) PrepareForPatrol() error

type GeminiStop

type GeminiStop struct {
	// contains filtered or unexported fields
}

func (*GeminiStop) Close

func (s *GeminiStop) Close()

func (*GeminiStop) Prepare

func (s *GeminiStop) Prepare() error

func (*GeminiStop) Run

func (s *GeminiStop) Run() error

type GeminiUninstaller

type GeminiUninstaller struct {
	// contains filtered or unexported fields
}

func (*GeminiUninstaller) Close

func (s *GeminiUninstaller) Close()

func (*GeminiUninstaller) Prepare

func (s *GeminiUninstaller) Prepare() error

func (*GeminiUninstaller) Run

func (s *GeminiUninstaller) Run() error

type InstallOptions

type InstallOptions struct {
	User           string // username of 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
}

InstallOptions contains the options for install.

type Installer

type Installer interface {
	PrepareForInstall() error
	Install() error
	Close()
}

func NewGeminiInstaller

func NewGeminiInstaller(ops utils.ClusterOptions) Installer

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager to deploy a cluster.

func NewManager

func NewManager(sysName string, specManager *spec.SpecManager, logger *logprinter.Logger) *Manager

NewManager create a Manager.

func (*Manager) Install

func (m *Manager) Install(
	clusterName string,
	clusterVersion string,
	topoFile string,
	opt InstallOptions,
	skipConfirm bool,
	gOpt operator.Options,
) error

Install a cluster.

func (*Manager) StartCluster

func (m *Manager) StartCluster(name string, gOpt operation.Options, fn ...func(b *task.Builder, metadata spec.Metadata)) error

StartCluster start the cluster with specified name.

func (*Manager) StopCluster

func (m *Manager) StopCluster(
	name string,
	gOpt operator.Options,
	skipConfirm bool,
) error

StopCluster stop the cluster.

func (*Manager) UninstallCluster

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

UninstallCluster destroy the cluster.

type Starter

type Starter interface {
	PrepareForStart() error
	Start() error
	Close()
}

func NewGeminiStarter

func NewGeminiStarter(ops utils.ClusterOptions, startOpts utils.StartOptions) Starter

type StatusPatroller

type StatusPatroller interface {
	PrepareForPatrol() error
	Patrol() error
	Close()
}

func NewGeminiStatusPatroller

func NewGeminiStatusPatroller(ops utils.ClusterOptions) StatusPatroller

type Stop

type Stop interface {
	Prepare() error
	Run() error
	Close()
}

func NewGeminiStop

func NewGeminiStop(ops utils.ClusterOptions) Stop

type Uninstall

type Uninstall interface {
	Prepare() error
	Run() error
	Close()
}

func NewGeminiUninstaller

func NewGeminiUninstaller(ops utils.ClusterOptions) Uninstall

type UploadAction

type UploadAction struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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