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 MonitoredOptions
- type PrometheusSpec
- type ResourceControl
- type Specification
- func (s *Specification) BaseTopo() *spec.BaseTopo
- func (topo *Specification) ComponentsByStartOrder() (comps []Component)
- func (topo *Specification) ComponentsByStopOrder() (comps []Component)
- func (topo *Specification) ComponentsByUpdateOrder() (comps []Component)
- func (s *Specification) CountDir(targetHost, dirPrefix string) int
- func (topo *Specification) Endpoints(user string) []*scripts.DMMasterScript
- func (s *Specification) FillHostArch(hostArch map[string]string) error
- func (topo *Specification) GetGlobalOptions() spec.GlobalOptions
- func (s *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 (s *Specification) Merge(that spec.Topology) spec.Topology
- func (s *Specification) MergeTopo(rhs spec.Topology) spec.Topology
- func (s *Specification) NewPart() spec.Topology
- func (s *Specification) TLSConfig(dir string) (*tls.Config, error)
- func (s *Specification) Type() string
- func (s *Specification) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (s *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 ¶
DMComponentVersion maps the dm version to the third components binding version Empty version means the latest stable one
func GetSpecManager ¶
func GetSpecManager() *cspec.SpecManager
GetSpecManager return the spec manager of dm cluster.
Types ¶
type AlertmanagerSpec ¶
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 ¶
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 ¶
func (c *DMWorkerComponent) Role() string
Role implements Component interface.
type InstanceSpec ¶
type InstanceSpec interface { Role() string SSH() (string, int) GetMainPort() int IsImported() bool IgnoreMonitorAgent() bool }
InstanceSpec represent a instance specification
type MasterInstance ¶
type MasterInstance struct { Name string spec.BaseInstance // contains filtered or unexported fields }
MasterInstance represent the TiDB instance
type MasterSpec ¶
type MasterSpec struct { Host string `yaml:"host"` SSHPort int `yaml:"ssh_port,omitempty" validate:"ssh_port:editable"` Imported bool `yaml:"imported,omitempty"` Patched bool `yaml:"patched,omitempty"` IgnoreExporter bool `yaml:"ignore_exporter,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) IgnoreMonitorAgent ¶
func (s *MasterSpec) IgnoreMonitorAgent() bool
IgnoreMonitorAgent returns if the node does not have monitor agents available
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 MonitoredOptions ¶
type MonitoredOptions = spec.MonitoredOptions
MonitoredOptions is the spec of Monitored
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 ¶
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 ¶
func (s *Specification) BaseTopo() *spec.BaseTopo
BaseTopo implements Topology interface.
func (*Specification) ComponentsByStartOrder ¶
func (topo *Specification) ComponentsByStartOrder() (comps []Component)
ComponentsByStartOrder return component in the order need to start.
func (*Specification) ComponentsByStopOrder ¶
func (topo *Specification) ComponentsByStopOrder() (comps []Component)
ComponentsByStopOrder return component in the order need to stop.
func (*Specification) ComponentsByUpdateOrder ¶
func (topo *Specification) ComponentsByUpdateOrder() (comps []Component)
ComponentsByUpdateOrder return component in the order need to be updated.
func (*Specification) CountDir ¶
func (s *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 ¶
func (topo *Specification) Endpoints(user string) []*scripts.DMMasterScript
Endpoints returns the PD endpoints configurations
func (*Specification) FillHostArch ¶
func (s *Specification) FillHostArch(hostArch map[string]string) error
FillHostArch fills the topology with the given host->arch
func (*Specification) GetGlobalOptions ¶
func (topo *Specification) GetGlobalOptions() spec.GlobalOptions
GetGlobalOptions returns cluster topology
func (*Specification) GetMasterList ¶
func (s *Specification) GetMasterList() []string
GetMasterList returns a list of Master API hosts of the current cluster
func (*Specification) GetMonitoredOptions ¶
func (topo *Specification) GetMonitoredOptions() *spec.MonitoredOptions
GetMonitoredOptions returns MonitoredOptions
func (*Specification) IterComponent ¶
func (topo *Specification) IterComponent(fn func(comp Component))
IterComponent iterates all components in component starting order
func (*Specification) IterHost ¶
func (topo *Specification) IterHost(fn func(instance Instance))
IterHost iterates one instance for each host
func (*Specification) IterInstance ¶
func (topo *Specification) IterInstance(fn func(instance Instance))
IterInstance iterates all instances in component starting order
func (*Specification) Merge ¶
func (s *Specification) Merge(that spec.Topology) spec.Topology
Merge returns a new Topology which sum old ones
func (*Specification) MergeTopo ¶
func (s *Specification) MergeTopo(rhs spec.Topology) spec.Topology
MergeTopo implements ScaleOutTopology interface.
func (*Specification) NewPart ¶
func (s *Specification) NewPart() spec.Topology
NewPart implements ScaleOutTopology interface.
func (*Specification) TLSConfig ¶
func (s *Specification) TLSConfig(dir string) (*tls.Config, error)
TLSConfig generates a tls.Config for the specification as needed
func (*Specification) Type ¶
func (s *Specification) Type() string
Type implements Topology interface.
func (*Specification) UnmarshalYAML ¶
func (s *Specification) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML sets default values when unmarshaling the topology file
func (*Specification) Validate ¶
func (s *Specification) Validate() error
Validate validates the topology specification and produce error if the specification invalid (e.g: port conflicts or directory conflicts)
type WorkerInstance ¶
type WorkerInstance struct { Name string spec.BaseInstance // contains filtered or unexported fields }
WorkerInstance represent the DM worker instance
type WorkerSpec ¶
type WorkerSpec struct { Host string `yaml:"host"` SSHPort int `yaml:"ssh_port,omitempty" validate:"ssh_port:editable"` Imported bool `yaml:"imported,omitempty"` Patched bool `yaml:"patched,omitempty"` IgnoreExporter bool `yaml:"ignore_exporter,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) IgnoreMonitorAgent ¶
func (s *WorkerSpec) IgnoreMonitorAgent() bool
IgnoreMonitorAgent returns if the node does not have monitor agents available
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