meta

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentDMMaster     = "dm-master"
	ComponentDMWorker     = "dm-worker"
	ComponentDMPortal     = "dm-portal"
	ComponentDumpling     = "dumpling"
	ComponentLightning    = "lightning"
	ComponentImporter     = "importer"
	ComponentPrometheus   = meta.ComponentPrometheus
	ComponentGrafana      = meta.ComponentGrafana
	ComponentAlertManager = meta.ComponentAlertManager
)

Components names supported by TiOps

Variables

This section is empty.

Functions

func AllDMSComponentNames

func AllDMSComponentNames() (roles []string)

AllDMSComponentNames contains the names of all dm components. should include all components in ComponentsByStartOrder

func PortStarted

func PortStarted(e executor.TiOpsExecutor, port int, timeout int64) error

PortStarted wait until a port is being listened

func PortStopped

func PortStopped(e executor.TiOpsExecutor, port int, timeout int64) error

PortStopped wait until a port is being released

func SaveDMMeta

func SaveDMMeta(clusterName string, meta *DMMeta) error

SaveDMMeta saves the cluster meta information to profile directory

Types

type AlertManagerSpec

type AlertManagerSpec struct {
	Host            string          `yaml:"host"`
	SSHPort         int             `yaml:"ssh_port,omitempty"`
	Imported        bool            `yaml:"imported,omitempty"`
	WebPort         int             `yaml:"web_port" default:"9093"`
	ClusterPort     int             `yaml:"cluster_port" default:"9094"`
	DeployDir       string          `yaml:"deploy_dir,omitempty"`
	DataDir         string          `yaml:"data_dir,omitempty"`
	LogDir          string          `yaml:"log_dir,omitempty"`
	NumaNode        string          `yaml:"numa_node,omitempty"`
	ResourceControl ResourceControl `yaml:"resource_control,omitempty"`
	Arch            string          `yaml:"arch,omitempty"`
	OS              string          `yaml:"os,omitempty"`
}

AlertManagerSpec represents the AlertManager topology specification in topology.yaml

func (AlertManagerSpec) GetMainPort

func (s AlertManagerSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (AlertManagerSpec) IsImported

func (s AlertManagerSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (AlertManagerSpec) Role

func (s AlertManagerSpec) Role() string

Role returns the component role of the instance

func (AlertManagerSpec) SSH

func (s AlertManagerSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

type Component

type Component interface {
	Name() string
	Instances() []Instance
}

Component represents a component of the cluster.

type DMMasterComponent

type DMMasterComponent struct{ *DMSSpecification }

DMMasterComponent represents TiDB component.

func (*DMMasterComponent) Instances

func (c *DMMasterComponent) Instances() []Instance

Instances implements Component interface.

func (*DMMasterComponent) Name

func (c *DMMasterComponent) Name() string

Name implements Component interface.

type DMMasterInstance

type DMMasterInstance struct {
	Name string
	// contains filtered or unexported fields
}

DMMasterInstance represent the TiDB instance

func (*DMMasterInstance) Arch

func (i *DMMasterInstance) Arch() string

func (*DMMasterInstance) ComponentName

func (i *DMMasterInstance) ComponentName() string

ComponentName implements Instance interface

func (*DMMasterInstance) DataDir

func (i *DMMasterInstance) DataDir() string

func (*DMMasterInstance) DeployDir

func (i *DMMasterInstance) DeployDir() string

func (*DMMasterInstance) GetHost

func (i *DMMasterInstance) GetHost() string

GetHost implements Instance interface

func (*DMMasterInstance) GetPort

func (i *DMMasterInstance) GetPort() int

func (*DMMasterInstance) GetSSHPort

func (i *DMMasterInstance) GetSSHPort() int

GetSSHPort implements Instance interface

func (*DMMasterInstance) ID

func (i *DMMasterInstance) ID() string

ID returns the identifier of this instance, the ID is constructed by host:port

func (*DMMasterInstance) InitConfig

func (i *DMMasterInstance) InitConfig(e executor.TiOpsExecutor, clusterName, clusterVersion, deployUser string, paths DirPaths) error

InitConfig implement Instance interface

func (*DMMasterInstance) InstanceName

func (i *DMMasterInstance) InstanceName() string

InstanceName implements Instance interface

func (*DMMasterInstance) LogDir

func (i *DMMasterInstance) LogDir() string

func (*DMMasterInstance) OS

func (i *DMMasterInstance) OS() string

func (*DMMasterInstance) PrepareStart

func (i *DMMasterInstance) PrepareStart() error

func (*DMMasterInstance) Ready

func (i *DMMasterInstance) Ready(e executor.TiOpsExecutor, timeout int64) error

Ready implements Instance interface

func (*DMMasterInstance) ScaleConfig

func (i *DMMasterInstance) ScaleConfig(e executor.TiOpsExecutor, b *DMSSpecification, clusterName, clusterVersion, deployUser string, paths DirPaths) error

ScaleConfig deploy temporary config on scaling

func (*DMMasterInstance) ServiceName

func (i *DMMasterInstance) ServiceName() string

ServiceName implements Instance interface

func (*DMMasterInstance) Status

func (i *DMMasterInstance) Status(masterList ...string) string

func (*DMMasterInstance) UsedDirs

func (i *DMMasterInstance) UsedDirs() []string

func (*DMMasterInstance) UsedPorts

func (i *DMMasterInstance) UsedPorts() []int

func (*DMMasterInstance) WaitForDown

func (i *DMMasterInstance) WaitForDown(e executor.TiOpsExecutor, timeout int64) error

WaitForDown implements Instance interface

type DMMasterSpec

type DMMasterSpec struct {
	Host     string `yaml:"host"`
	SSHPort  int    `yaml:"ssh_port,omitempty"`
	Imported bool   `yaml:"imported,omitempty"`
	// Use Name to get the name with a default value if it's empty.
	Name            string                 `yaml:"name"`
	Port            int                    `yaml:"port" default:"8261"`
	PeerPort        int                    `yaml:"peer_port" default:"8291"`
	DeployDir       string                 `yaml:"deploy_dir,omitempty"`
	DataDir         string                 `yaml:"data_dir,omitempty"`
	LogDir          string                 `yaml:"log_dir,omitempty"`
	NumaNode        string                 `yaml:"numa_node,omitempty"`
	Config          map[string]interface{} `yaml:"config,omitempty"`
	ResourceControl ResourceControl        `yaml:"resource_control,omitempty"`
	Arch            string                 `yaml:"arch,omitempty"`
	OS              string                 `yaml:"os,omitempty"`
}

DMMasterSpec represents the DMMaster topology specification in topology.yaml

func (DMMasterSpec) GetMainPort

func (s DMMasterSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (DMMasterSpec) IsImported

func (s DMMasterSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (DMMasterSpec) Role

func (s DMMasterSpec) Role() string

Role returns the component role of the instance

func (DMMasterSpec) SSH

func (s DMMasterSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

func (DMMasterSpec) Status

func (s DMMasterSpec) Status(masterList ...string) string

Status queries current status of the instance

type DMMeta

type DMMeta struct {
	User    string `yaml:"user"`       // the user to run and manage cluster on remote
	Version string `yaml:"dm_version"` // the version of TiDB cluster

	Topology *DMSTopologySpecification `yaml:"topology"`
}

DMMeta is the specification of generic cluster metadata

func DMMetadata

func DMMetadata(clusterName string) (*DMMeta, error)

DMMetadata tries to read the metadata of a cluster from file

type DMPortalComponent

type DMPortalComponent struct {
	*DMSSpecification
}

DMPortalComponent represents DM portal component.

func (*DMPortalComponent) Instances

func (c *DMPortalComponent) Instances() []Instance

Instances implements Component interface.

func (*DMPortalComponent) Name

func (c *DMPortalComponent) Name() string

Name implements Component interface.

type DMPortalInstance

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

DMPortalInstance represent the DM portal instance

func (*DMPortalInstance) Arch

func (i *DMPortalInstance) Arch() string

func (*DMPortalInstance) ComponentName

func (i *DMPortalInstance) ComponentName() string

ComponentName implements Instance interface

func (*DMPortalInstance) DataDir

func (i *DMPortalInstance) DataDir() string

func (*DMPortalInstance) DeployDir

func (i *DMPortalInstance) DeployDir() string

func (*DMPortalInstance) GetHost

func (i *DMPortalInstance) GetHost() string

GetHost implements Instance interface

func (*DMPortalInstance) GetPort

func (i *DMPortalInstance) GetPort() int

func (*DMPortalInstance) GetSSHPort

func (i *DMPortalInstance) GetSSHPort() int

GetSSHPort implements Instance interface

func (*DMPortalInstance) ID

func (i *DMPortalInstance) ID() string

ID returns the identifier of this instance, the ID is constructed by host:port

func (*DMPortalInstance) InitConfig

func (i *DMPortalInstance) InitConfig(e executor.TiOpsExecutor, clusterName, clusterVersion, deployUser string, paths DirPaths) error

InitConfig implement Instance interface

func (*DMPortalInstance) InstanceName

func (i *DMPortalInstance) InstanceName() string

InstanceName implements Instance interface

func (*DMPortalInstance) LogDir

func (i *DMPortalInstance) LogDir() string

func (*DMPortalInstance) OS

func (i *DMPortalInstance) OS() string

func (*DMPortalInstance) PrepareStart

func (i *DMPortalInstance) PrepareStart() error

func (*DMPortalInstance) Ready

func (i *DMPortalInstance) Ready(e executor.TiOpsExecutor, timeout int64) error

Ready implements Instance interface

func (*DMPortalInstance) ScaleConfig

func (i *DMPortalInstance) ScaleConfig(e executor.TiOpsExecutor, b *DMSSpecification, clusterName, clusterVersion, deployUser string, paths DirPaths) error

ScaleConfig deploy temporary config on scaling

func (*DMPortalInstance) ServiceName

func (i *DMPortalInstance) ServiceName() string

ServiceName implements Instance interface

func (*DMPortalInstance) Status

func (i *DMPortalInstance) Status(masterList ...string) string

func (*DMPortalInstance) UsedDirs

func (i *DMPortalInstance) UsedDirs() []string

func (*DMPortalInstance) UsedPorts

func (i *DMPortalInstance) UsedPorts() []int

func (*DMPortalInstance) WaitForDown

func (i *DMPortalInstance) WaitForDown(e executor.TiOpsExecutor, timeout int64) error

WaitForDown implements Instance interface

type DMSSpecification

type DMSSpecification = DMSTopologySpecification

DMSSpecification of cluster

func (*DMSSpecification) ComponentsByStartOrder

func (topo *DMSSpecification) ComponentsByStartOrder() (comps []Component)

ComponentsByStartOrder return component in the order need to start.

func (*DMSSpecification) ComponentsByStopOrder

func (topo *DMSSpecification) ComponentsByStopOrder() (comps []Component)

ComponentsByStopOrder return component in the order need to stop.

func (*DMSSpecification) ComponentsByUpdateOrder

func (topo *DMSSpecification) ComponentsByUpdateOrder() (comps []Component)

ComponentsByUpdateOrder return component in the order need to be updated.

func (*DMSSpecification) Endpoints

func (topo *DMSSpecification) Endpoints(user string) []*scripts.DMMasterScript

Endpoints returns the PD endpoints configurations

func (*DMSSpecification) GetGlobalOptions

func (topo *DMSSpecification) GetGlobalOptions() meta.GlobalOptions

GetGlobalOptions returns cluster topology

func (*DMSSpecification) GetMonitoredOptions

func (topo *DMSSpecification) GetMonitoredOptions() meta.MonitoredOptions

GetMonitoredOptions returns MonitoredOptions

func (*DMSSpecification) IterComponent

func (topo *DMSSpecification) IterComponent(fn func(comp Component))

IterComponent iterates all components in component starting order

func (*DMSSpecification) IterHost

func (topo *DMSSpecification) IterHost(fn func(instance Instance))

IterHost iterates one instance for each host

func (*DMSSpecification) IterInstance

func (topo *DMSSpecification) IterInstance(fn func(instance Instance))

IterInstance iterates all instances in component starting order

type DMSTopologySpecification

type DMSTopologySpecification struct {
	GlobalOptions    GlobalOptions      `yaml:"global,omitempty"`
	MonitoredOptions MonitoredOptions   `yaml:"monitored,omitempty"`
	Job              JobSpec            `yaml:"job"`
	Monitors         []PrometheusSpec   `yaml:"monitoring_servers"`
	Grafana          []GrafanaSpec      `yaml:"grafana_servers,omitempty"`
	Alertmanager     []AlertManagerSpec `yaml:"alertmanager_servers,omitempty"`
}

DMSTopologySpecification represents the specification of topology.yaml

func (*DMSTopologySpecification) GetMasterList

func (topo *DMSTopologySpecification) GetMasterList() []string

GetMasterList returns a list of DMMaster API hosts of the current cluster

func (*DMSTopologySpecification) Merge

Merge returns a new TopologySpecification which sum old ones

func (*DMSTopologySpecification) UnmarshalYAML

func (topo *DMSTopologySpecification) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML sets default values when unmarshaling the topology file

func (*DMSTopologySpecification) Validate

func (topo *DMSTopologySpecification) Validate() error

Validate validates the topology specification and produce error if the specification invalid (e.g: port conflicts or directory conflicts)

type DMWorkerComponent

type DMWorkerComponent struct {
	*DMSSpecification
}

DMWorkerComponent represents DM worker component.

func (*DMWorkerComponent) Instances

func (c *DMWorkerComponent) Instances() []Instance

Instances implements Component interface.

func (*DMWorkerComponent) Name

func (c *DMWorkerComponent) Name() string

Name implements Component interface.

type DMWorkerInstance

type DMWorkerInstance struct {
	Name string
	// contains filtered or unexported fields
}

DMWorkerInstance represent the DM worker instance

func (*DMWorkerInstance) Arch

func (i *DMWorkerInstance) Arch() string

func (*DMWorkerInstance) ComponentName

func (i *DMWorkerInstance) ComponentName() string

ComponentName implements Instance interface

func (*DMWorkerInstance) DataDir

func (i *DMWorkerInstance) DataDir() string

func (*DMWorkerInstance) DeployDir

func (i *DMWorkerInstance) DeployDir() string

func (*DMWorkerInstance) GetHost

func (i *DMWorkerInstance) GetHost() string

GetHost implements Instance interface

func (*DMWorkerInstance) GetPort

func (i *DMWorkerInstance) GetPort() int

func (*DMWorkerInstance) GetSSHPort

func (i *DMWorkerInstance) GetSSHPort() int

GetSSHPort implements Instance interface

func (*DMWorkerInstance) ID

func (i *DMWorkerInstance) ID() string

ID returns the identifier of this instance, the ID is constructed by host:port

func (*DMWorkerInstance) InitConfig

func (i *DMWorkerInstance) InitConfig(e executor.TiOpsExecutor, clusterName, clusterVersion, deployUser string, paths DirPaths) error

InitConfig implement Instance interface

func (*DMWorkerInstance) InstanceName

func (i *DMWorkerInstance) InstanceName() string

InstanceName implements Instance interface

func (*DMWorkerInstance) LogDir

func (i *DMWorkerInstance) LogDir() string

func (*DMWorkerInstance) OS

func (i *DMWorkerInstance) OS() string

func (*DMWorkerInstance) PrepareStart

func (i *DMWorkerInstance) PrepareStart() error

func (*DMWorkerInstance) Ready

func (i *DMWorkerInstance) Ready(e executor.TiOpsExecutor, timeout int64) error

Ready implements Instance interface

func (*DMWorkerInstance) ScaleConfig

func (i *DMWorkerInstance) ScaleConfig(e executor.TiOpsExecutor, b *DMSSpecification, clusterName, clusterVersion, deployUser string, paths DirPaths) error

ScaleConfig deploy temporary config on scaling

func (*DMWorkerInstance) ServiceName

func (i *DMWorkerInstance) ServiceName() string

ServiceName implements Instance interface

func (*DMWorkerInstance) Status

func (i *DMWorkerInstance) Status(masterList ...string) string

func (*DMWorkerInstance) UsedDirs

func (i *DMWorkerInstance) UsedDirs() []string

func (*DMWorkerInstance) UsedPorts

func (i *DMWorkerInstance) UsedPorts() []int

func (*DMWorkerInstance) WaitForDown

func (i *DMWorkerInstance) WaitForDown(e executor.TiOpsExecutor, timeout int64) error

WaitForDown implements Instance interface

type DMWorkerSpec

type DMWorkerSpec struct {
	Host     string `yaml:"host"`
	SSHPort  int    `yaml:"ssh_port,omitempty"`
	Imported bool   `yaml:"imported,omitempty"`
	// Use Name to get the name with a default value if it's empty.
	Name            string                 `yaml:"name"`
	Port            int                    `yaml:"port" default:"8262"`
	DeployDir       string                 `yaml:"deploy_dir,omitempty"`
	DataDir         string                 `yaml:"data_dir,omitempty"`
	LogDir          string                 `yaml:"log_dir,omitempty"`
	NumaNode        string                 `yaml:"numa_node,omitempty"`
	Config          map[string]interface{} `yaml:"config,omitempty"`
	ResourceControl ResourceControl        `yaml:"resource_control,omitempty"`
	Arch            string                 `yaml:"arch,omitempty"`
	OS              string                 `yaml:"os,omitempty"`
}

DMWorkerSpec represents the DMMaster topology specification in topology.yaml

func (DMWorkerSpec) GetMainPort

func (s DMWorkerSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (DMWorkerSpec) IsImported

func (s DMWorkerSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (DMWorkerSpec) Role

func (s DMWorkerSpec) Role() string

Role returns the component role of the instance

func (DMWorkerSpec) SSH

func (s DMWorkerSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

func (DMWorkerSpec) Status

func (s DMWorkerSpec) Status(masterList ...string) string

Status queries current status of the instance

type DatabaseServerSpec

type DatabaseServerSpec struct {
	SourceSpec `yaml:"-"`
	SinkSpec   `yaml:"-"`

	Host     string                 `yaml:"host"`
	Port     int                    `yaml:"port,omitempty"`
	User     string                 `yaml:"user,omitempty"`
	Password string                 `yaml:"password,omitempty"`
	Config   map[string]interface{} `yaml:"config,omitempty"`
}

DatabaseServerSpec represents a data source (address to a database)

type DirPaths

type DirPaths struct {
	Deploy string
	Data   []string
	Log    string
	Cache  string
}

DirPaths stores the paths needed for component to put files

func (DirPaths) String

func (p DirPaths) String() string

String implements the fmt.Stringer interface

type DumplingSpec

type DumplingSpec struct {
	Host            string                 `yaml:"host"`
	SSHPort         int                    `yaml:"ssh_port,omitempty"`
	Imported        bool                   `yaml:"imported,omitempty"`
	Port            int                    `yaml:"port" default:"8280"`
	DeployDir       string                 `yaml:"deploy_dir,omitempty"`
	DataDir         string                 `yaml:"data_dir,omitempty"`
	LogDir          string                 `yaml:"log_dir,omitempty"`
	NumaNode        string                 `yaml:"numa_node,omitempty"`
	Config          map[string]interface{} `yaml:"config,omitempty"`
	ResourceControl ResourceControl        `yaml:"resource_control,omitempty"`
	Arch            string                 `yaml:"arch,omitempty"`
	OS              string                 `yaml:"os,omitempty"`
}

DumplingSpec represents the DumplingSpec topology specification in topology.yaml

func (DumplingSpec) GetMainPort

func (s DumplingSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (DumplingSpec) IsImported

func (s DumplingSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (DumplingSpec) Role

func (s DumplingSpec) Role() string

Role returns the component role of the instance

func (DumplingSpec) SSH

func (s DumplingSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

type FileServerSpec

type FileServerSpec struct {
	SourceSpec `yaml:"-"`
	SinkSpec   `yaml:"-"`

	Host    string                 `yaml:"host"`
	SSHPort int                    `yaml:"ssh_port,omitempty"`
	Path    string                 `yaml:"path,omitempty"`
	Config  map[string]interface{} `yaml:"config,omitempty"`
}

FileServerSpec represents a data source (file path)

type GlobalOptions

type GlobalOptions = meta.GlobalOptions

GlobalOptions represents the global options for all groups in topology specification in topology.yaml

type GrafanaSpec

type GrafanaSpec struct {
	Host            string          `yaml:"host"`
	SSHPort         int             `yaml:"ssh_port,omitempty"`
	Imported        bool            `yaml:"imported,omitempty"`
	Port            int             `yaml:"port" default:"3000"`
	DeployDir       string          `yaml:"deploy_dir,omitempty"`
	ResourceControl ResourceControl `yaml:"resource_control,omitempty"`
	Arch            string          `yaml:"arch,omitempty"`
	OS              string          `yaml:"os,omitempty"`
}

GrafanaSpec represents the Grafana topology specification in topology.yaml

func (GrafanaSpec) GetMainPort

func (s GrafanaSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (GrafanaSpec) IsImported

func (s GrafanaSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (GrafanaSpec) Role

func (s GrafanaSpec) Role() string

Role returns the component role of the instance

func (GrafanaSpec) SSH

func (s GrafanaSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

type ImporterSpec

type ImporterSpec struct {
	Host            string                 `yaml:"host"`
	SSHPort         int                    `yaml:"ssh_port,omitempty"`
	Imported        bool                   `yaml:"imported,omitempty"`
	Port            int                    `yaml:"port" default:"8280"`
	DeployDir       string                 `yaml:"deploy_dir,omitempty"`
	DataDir         string                 `yaml:"data_dir,omitempty"`
	LogDir          string                 `yaml:"log_dir,omitempty"`
	NumaNode        string                 `yaml:"numa_node,omitempty"`
	Config          map[string]interface{} `yaml:"config,omitempty"`
	ResourceControl ResourceControl        `yaml:"resource_control,omitempty"`
	Arch            string                 `yaml:"arch,omitempty"`
	OS              string                 `yaml:"os,omitempty"`
}

ImporterSpec represents the ImporterSpec topology specification in topology.yaml

func (ImporterSpec) GetMainPort

func (s ImporterSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (ImporterSpec) IsImported

func (s ImporterSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (ImporterSpec) Role

func (s ImporterSpec) Role() string

Role returns the component role of the instance

func (ImporterSpec) SSH

func (s ImporterSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

type Instance

type Instance interface {
	InstanceSpec
	ID() string
	Ready(executor.TiOpsExecutor, int64) error
	WaitForDown(executor.TiOpsExecutor, int64) error
	InitConfig(e executor.TiOpsExecutor, clusterName string, clusterVersion string, deployUser string, paths DirPaths) error
	ScaleConfig(e executor.TiOpsExecutor, topo *DMSSpecification, clusterName string, clusterVersion string, deployUser string, paths DirPaths) error
	PrepareStart() error
	ComponentName() string
	InstanceName() string
	ServiceName() string
	GetHost() string
	GetPort() int
	GetSSHPort() int
	DeployDir() string
	UsedPorts() []int
	UsedDirs() []string
	Status(pdList ...string) string
	DataDir() string
	LogDir() string
	OS() string // only linux supported now
	Arch() string
}

Instance represents the instance.

type InstanceSpec

type InstanceSpec interface {
	Role() string
	SSH() (string, int)
	GetMainPort() int
	IsImported() bool
}

InstanceSpec represent a instance specification

type JobSpec

type JobSpec struct {
	JobSpecHeader `yaml:"-,inline"`
	JobSpecBody   `yaml:"-,inline"`
}

JobSpec represents the data migration job that users want to do

func (*JobSpec) UnmarshalYAML

func (s *JobSpec) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML sets values for different type jobs when unmarshaling the topology file

type JobSpecBody

type JobSpecBody struct {
	Sources []SourceSpec `yaml:"sources,omitempty"`
	Sink    SinkSpec     `yaml:"sink,omitempty"`
}

JobSpecBody is the upstream & downstream info for job specification

type JobSpecHeader

type JobSpecHeader struct {
	Action  string                 `yaml:"action"`
	Type    string                 `yaml:"type"`
	Config  map[string]interface{} `yaml:"config,omitempty"`
	Workers []WorkerSpec           `yaml:"workers"`
}

JobSpecHeader is the common part for job specification

type LightningSpec

type LightningSpec struct {
	Host            string                 `yaml:"host"`
	SSHPort         int                    `yaml:"ssh_port,omitempty"`
	Imported        bool                   `yaml:"imported,omitempty"`
	Port            int                    `yaml:"port" default:"8280"`
	DeployDir       string                 `yaml:"deploy_dir,omitempty"`
	DataDir         string                 `yaml:"data_dir,omitempty"`
	LogDir          string                 `yaml:"log_dir,omitempty"`
	NumaNode        string                 `yaml:"numa_node,omitempty"`
	Config          map[string]interface{} `yaml:"config,omitempty"`
	ResourceControl ResourceControl        `yaml:"resource_control,omitempty"`
	Arch            string                 `yaml:"arch,omitempty"`
	OS              string                 `yaml:"os,omitempty"`
}

LightningSpec represents the LightningSpec topology specification in topology.yaml

func (LightningSpec) GetMainPort

func (s LightningSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (LightningSpec) IsImported

func (s LightningSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (LightningSpec) Role

func (s LightningSpec) Role() string

Role returns the component role of the instance

func (LightningSpec) SSH

func (s LightningSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

type MonitoredOptions

type MonitoredOptions = meta.MonitoredOptions

MonitoredOptions represents the monitored node configuration

type PortalSpec

type PortalSpec struct {
	Host            string                 `yaml:"host"`
	SSHPort         int                    `yaml:"ssh_port,omitempty"`
	Imported        bool                   `yaml:"imported,omitempty"`
	Port            int                    `yaml:"port" default:"8280"`
	DeployDir       string                 `yaml:"deploy_dir,omitempty"`
	DataDir         string                 `yaml:"data_dir,omitempty"`
	LogDir          string                 `yaml:"log_dir,omitempty"`
	Timeout         int                    `yaml:"timeout" default:"5"`
	NumaNode        string                 `yaml:"numa_node,omitempty"`
	Config          map[string]interface{} `yaml:"config,omitempty"`
	ResourceControl ResourceControl        `yaml:"resource_control,omitempty"`
	Arch            string                 `yaml:"arch,omitempty"`
	OS              string                 `yaml:"os,omitempty"`
}

PortalSpec represents the DMPortal topology specification in topology.yaml

func (PortalSpec) GetMainPort

func (s PortalSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (PortalSpec) IsImported

func (s PortalSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (PortalSpec) Role

func (s PortalSpec) Role() string

Role returns the component role of the instance

func (PortalSpec) SSH

func (s PortalSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

type PrometheusSpec

type PrometheusSpec struct {
	Host            string          `yaml:"host"`
	SSHPort         int             `yaml:"ssh_port,omitempty"`
	Imported        bool            `yaml:"imported,omitempty"`
	Port            int             `yaml:"port" default:"9090"`
	DeployDir       string          `yaml:"deploy_dir,omitempty"`
	DataDir         string          `yaml:"data_dir,omitempty"`
	LogDir          string          `yaml:"log_dir,omitempty"`
	NumaNode        string          `yaml:"numa_node,omitempty"`
	Retention       string          `yaml:"storage_retention,omitempty"`
	ResourceControl ResourceControl `yaml:"resource_control,omitempty"`
	Arch            string          `yaml:"arch,omitempty"`
	OS              string          `yaml:"os,omitempty"`
}

PrometheusSpec represents the Prometheus Server topology specification in topology.yaml

func (PrometheusSpec) GetMainPort

func (s PrometheusSpec) GetMainPort() int

GetMainPort returns the main port of the instance

func (PrometheusSpec) IsImported

func (s PrometheusSpec) IsImported() bool

IsImported returns if the node is imported from TiDB-Ansible

func (PrometheusSpec) Role

func (s PrometheusSpec) Role() string

Role returns the component role of the instance

func (PrometheusSpec) SSH

func (s PrometheusSpec) SSH() (string, int)

SSH returns the host and SSH port of the instance

type ResourceControl

type ResourceControl = meta.ResourceControl

ResourceControl is used to control the system resource See: https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html

type SinkSpec

type SinkSpec interface {
	// contains filtered or unexported methods
}

SinkSpec represents the downstream sink specification

type SourceSpec

type SourceSpec interface {
	// contains filtered or unexported methods
}

SourceSpec represents the upstream source specification

type WorkerSpec

type WorkerSpec struct {
	Host            string          `yaml:"host"`
	SSHPort         int             `yaml:"ssh_port,omitempty"`
	DeployDir       string          `yaml:"deploy_dir,omitempty"`
	DataDir         string          `yaml:"data_dir,omitempty"`
	LogDir          string          `yaml:"log_dir,omitempty"`
	NumaNode        string          `yaml:"numa_node,omitempty"`
	ResourceControl ResourceControl `yaml:"resource_control,omitempty"`
	Arch            string          `yaml:"arch,omitempty"`
	OS              string          `yaml:"os,omitempty"`
}

WorkerSpec represents a server instance to do the dms job

Jump to

Keyboard shortcuts

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