Documentation
¶
Index ¶
- Constants
- func AllDMComponentNames() (roles []string)
- func DMComponentVersion(comp, version string) string
- func GetSpecManager() *cspec.SpecManager
- type AlertmanagerSpec
- type Component
- type DMMasterComponent
- type DMServerConfigs
- type DMWorkerComponent
- type GlobalOptions
- type GrafanaSpec
- type Instance
- type InstanceSpec
- type MasterInstance
- type MasterSpec
- type Metadata
- type PrometheusSpec
- type ResourceControl
- type Specification
- func (topo *Specification) BaseTopo() *spec.BaseTopo
- func (topo *Specification) ComponentsByStartOrder() (comps []Component)
- func (topo *Specification) ComponentsByStopOrder() (comps []Component)
- func (topo *Specification) ComponentsByUpdateOrder() (comps []Component)
- func (topo *Specification) CountDir(targetHost, dirPrefix string) int
- func (topo *Specification) Endpoints(user string) []*scripts.DMMasterScript
- func (topo *Specification) GetGlobalOptions() spec.GlobalOptions
- func (topo *Specification) GetMasterList() []string
- func (topo *Specification) GetMonitoredOptions() *spec.MonitoredOptions
- func (topo *Specification) IterComponent(fn func(comp Component))
- func (topo *Specification) IterHost(fn func(instance Instance))
- func (topo *Specification) IterInstance(fn func(instance Instance))
- func (topo *Specification) Merge(that spec.Topology) spec.Topology
- func (topo *Specification) MergeTopo(rhs spec.Topology) spec.Topology
- func (topo *Specification) NewPart() spec.Topology
- func (topo *Specification) TLSConfig(dir string) (*tls.Config, error)
- func (topo *Specification) Type() string
- func (topo *Specification) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (topo *Specification) Validate() error
- type WorkerInstance
- type WorkerSpec
Constants ¶
const ( ComponentDMMaster = spec.ComponentDMMaster ComponentDMWorker = spec.ComponentDMWorker ComponentPrometheus = spec.ComponentPrometheus ComponentGrafana = spec.ComponentGrafana ComponentAlertmanager = spec.ComponentAlertmanager )
Components names supported by TiUP
Variables ¶
This section is empty.
Functions ¶
func AllDMComponentNames ¶
func AllDMComponentNames() (roles []string)
AllDMComponentNames contains the names of all dm components. should include all components in ComponentsByStartOrder
func DMComponentVersion ¶ added in v1.1.0
DMComponentVersion maps the dm version to the third components binding version
func GetSpecManager ¶
func GetSpecManager() *cspec.SpecManager
GetSpecManager return the spec manager of dm cluster.
Types ¶
type AlertmanagerSpec ¶ added in v1.3.0
type AlertmanagerSpec = spec.AlertmanagerSpec
AlertmanagerSpec is the spec of Alertmanager
type DMMasterComponent ¶
type DMMasterComponent struct{ Topology *Specification }
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.
func (*DMMasterComponent) Role ¶ added in v1.1.0
func (c *DMMasterComponent) Role() string
Role implements Component interface.
type DMServerConfigs ¶
type DMServerConfigs struct { Master map[string]interface{} `yaml:"master"` Worker map[string]interface{} `yaml:"worker"` }
DMServerConfigs represents the server runtime configuration
type DMWorkerComponent ¶
type DMWorkerComponent struct{ Topology *Specification }
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.
func (*DMWorkerComponent) Role ¶ added in v1.1.0
func (c *DMWorkerComponent) Role() string
Role implements Component interface.
type InstanceSpec ¶
type InstanceSpec interface { Role() string SSH() (string, int) GetMainPort() int IsImported() bool }
InstanceSpec represent a instance specification
type MasterInstance ¶ added in v1.1.0
type MasterInstance struct { Name string spec.BaseInstance // contains filtered or unexported fields }
MasterInstance represent the TiDB instance
func (*MasterInstance) InitConfig ¶ added in v1.1.0
func (i *MasterInstance) InitConfig( e executor.Executor, clusterName, clusterVersion, deployUser string, paths meta.DirPaths, ) error
InitConfig implement Instance interface
type MasterSpec ¶
type MasterSpec struct { Host string `yaml:"host"` SSHPort int `yaml:"ssh_port,omitempty" validate:"ssh_port:editable"` Imported bool `yaml:"imported,omitempty"` // Use Name to get the name with a default value if it's empty. Name string `yaml:"name,omitempty"` Port int `yaml:"port,omitempty" default:"8261"` PeerPort int `yaml:"peer_port,omitempty" 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" validate:"numa_node:editable"` Config map[string]interface{} `yaml:"config,omitempty" validate:"config:ignore"` ResourceControl ResourceControl `yaml:"resource_control,omitempty" validate:"resource_control:editable"` Arch string `yaml:"arch,omitempty"` OS string `yaml:"os,omitempty"` V1SourcePath string `yaml:"v1_source_path,omitempty"` }
MasterSpec represents the Master topology specification in topology.yaml
func (MasterSpec) GetMainPort ¶
func (s MasterSpec) GetMainPort() int
GetMainPort returns the main port of the instance
func (MasterSpec) IsImported ¶
func (s MasterSpec) IsImported() bool
IsImported returns if the node is imported from TiDB-Ansible
func (MasterSpec) Role ¶
func (s MasterSpec) Role() string
Role returns the component role of the instance
func (MasterSpec) SSH ¶
func (s MasterSpec) SSH() (string, int)
SSH returns the host and SSH port of the instance
type Metadata ¶
type Metadata 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 *Specification `yaml:"topology"` }
Metadata is the specification of generic cluster metadata
func (*Metadata) GetBaseMeta ¶
GetBaseMeta implements Metadata interface.
func (*Metadata) GetTopology ¶
GetTopology implements Metadata interface.
func (*Metadata) SetTopology ¶
SetTopology implements Metadata interface.
func (*Metadata) SetVersion ¶
SetVersion implement UpgradableMetadata interface.
type PrometheusSpec ¶
type PrometheusSpec = spec.PrometheusSpec
PrometheusSpec is the spec of Prometheus
type ResourceControl ¶
type ResourceControl = meta.ResourceControl
ResourceControl is the spec of ResourceControl
type Specification ¶ added in v1.3.0
type Specification struct { GlobalOptions GlobalOptions `yaml:"global,omitempty" validate:"global:editable"` // MonitoredOptions MonitoredOptions `yaml:"monitored,omitempty" validate:"monitored:editable"` ServerConfigs DMServerConfigs `yaml:"server_configs,omitempty" validate:"server_configs:ignore"` Masters []MasterSpec `yaml:"master_servers"` Workers []WorkerSpec `yaml:"worker_servers"` Monitors []spec.PrometheusSpec `yaml:"monitoring_servers"` Grafanas []spec.GrafanaSpec `yaml:"grafana_servers,omitempty"` Alertmanagers []spec.AlertmanagerSpec `yaml:"alertmanager_servers,omitempty"` }
Specification represents the specification of topology.yaml
func (*Specification) BaseTopo ¶ added in v1.3.0
func (topo *Specification) BaseTopo() *spec.BaseTopo
BaseTopo implements Topology interface.
func (*Specification) ComponentsByStartOrder ¶ added in v1.3.0
func (topo *Specification) ComponentsByStartOrder() (comps []Component)
ComponentsByStartOrder return component in the order need to start.
func (*Specification) ComponentsByStopOrder ¶ added in v1.3.0
func (topo *Specification) ComponentsByStopOrder() (comps []Component)
ComponentsByStopOrder return component in the order need to stop.
func (*Specification) ComponentsByUpdateOrder ¶ added in v1.3.0
func (topo *Specification) ComponentsByUpdateOrder() (comps []Component)
ComponentsByUpdateOrder return component in the order need to be updated.
func (*Specification) CountDir ¶ added in v1.3.0
func (topo *Specification) CountDir(targetHost, dirPrefix string) int
CountDir counts for dir paths used by any instance in the cluster with the same prefix, useful to find potential path conflicts
func (*Specification) Endpoints ¶ added in v1.3.0
func (topo *Specification) Endpoints(user string) []*scripts.DMMasterScript
Endpoints returns the PD endpoints configurations
func (*Specification) GetGlobalOptions ¶ added in v1.3.0
func (topo *Specification) GetGlobalOptions() spec.GlobalOptions
GetGlobalOptions returns cluster topology
func (*Specification) GetMasterList ¶ added in v1.3.0
func (topo *Specification) GetMasterList() []string
GetMasterList returns a list of Master API hosts of the current cluster
func (*Specification) GetMonitoredOptions ¶ added in v1.3.0
func (topo *Specification) GetMonitoredOptions() *spec.MonitoredOptions
GetMonitoredOptions returns MonitoredOptions
func (*Specification) IterComponent ¶ added in v1.3.0
func (topo *Specification) IterComponent(fn func(comp Component))
IterComponent iterates all components in component starting order
func (*Specification) IterHost ¶ added in v1.3.0
func (topo *Specification) IterHost(fn func(instance Instance))
IterHost iterates one instance for each host
func (*Specification) IterInstance ¶ added in v1.3.0
func (topo *Specification) IterInstance(fn func(instance Instance))
IterInstance iterates all instances in component starting order
func (*Specification) Merge ¶ added in v1.3.0
func (topo *Specification) Merge(that spec.Topology) spec.Topology
Merge returns a new Topology which sum old ones
func (*Specification) MergeTopo ¶ added in v1.3.0
func (topo *Specification) MergeTopo(rhs spec.Topology) spec.Topology
MergeTopo implements ScaleOutTopology interface.
func (*Specification) NewPart ¶ added in v1.3.0
func (topo *Specification) NewPart() spec.Topology
NewPart implements ScaleOutTopology interface.
func (*Specification) TLSConfig ¶ added in v1.3.0
func (topo *Specification) TLSConfig(dir string) (*tls.Config, error)
TLSConfig generates a tls.Config for the specification as needed
func (*Specification) Type ¶ added in v1.3.0
func (topo *Specification) Type() string
Type implements Topology interface.
func (*Specification) UnmarshalYAML ¶ added in v1.3.0
func (topo *Specification) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML sets default values when unmarshaling the topology file
func (*Specification) Validate ¶ added in v1.3.0
func (topo *Specification) Validate() error
Validate validates the topology specification and produce error if the specification invalid (e.g: port conflicts or directory conflicts)
type WorkerInstance ¶ added in v1.1.0
type WorkerInstance struct { Name string spec.BaseInstance // contains filtered or unexported fields }
WorkerInstance represent the DM worker instance
func (*WorkerInstance) InitConfig ¶ added in v1.1.0
func (i *WorkerInstance) InitConfig( e executor.Executor, clusterName, clusterVersion, deployUser string, paths meta.DirPaths, ) error
InitConfig implement Instance interface
type WorkerSpec ¶
type WorkerSpec struct { Host string `yaml:"host"` SSHPort int `yaml:"ssh_port,omitempty" validate:"ssh_port:editable"` Imported bool `yaml:"imported,omitempty"` // Use Name to get the name with a default value if it's empty. Name string `yaml:"name,omitempty"` Port int `yaml:"port,omitempty" 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" validate:"numa_node:editable"` Config map[string]interface{} `yaml:"config,omitempty" validate:"config:ignore"` ResourceControl ResourceControl `yaml:"resource_control,omitempty" validate:"resource_control:editable"` Arch string `yaml:"arch,omitempty"` OS string `yaml:"os,omitempty"` }
WorkerSpec represents the Master topology specification in topology.yaml
func (WorkerSpec) GetMainPort ¶
func (s WorkerSpec) GetMainPort() int
GetMainPort returns the main port of the instance
func (WorkerSpec) IsImported ¶
func (s WorkerSpec) IsImported() bool
IsImported returns if the node is imported from TiDB-Ansible
func (WorkerSpec) Role ¶
func (s WorkerSpec) Role() string
Role returns the component role of the instance
func (WorkerSpec) SSH ¶
func (s WorkerSpec) SSH() (string, int)
SSH returns the host and SSH port of the instance