Documentation ¶
Index ¶
- Variables
- func AdvertiseHost(listen string) string
- func CompVersion(comp string, version utils.Version) string
- func GenTiProxySessionCerts(dir string) error
- func PrepareCommand(ctx context.Context, binPath string, args, envs []string, workDir string) *exec.Cmd
- type CSEOptions
- type Config
- type Drainer
- type Instance
- type MetricAddr
- type PDInstance
- func (inst *PDInstance) Addr() string
- func (inst *PDInstance) Component() string
- func (inst *PDInstance) InitCluster(pds []*PDInstance) *PDInstance
- func (inst *PDInstance) Join(pds []*PDInstance) *PDInstance
- func (inst *PDInstance) LogFile() string
- func (inst *PDInstance) MetricAddr() (r MetricAddr)
- func (inst *PDInstance) Name() string
- func (inst *PDInstance) Start(ctx context.Context, version utils.Version) error
- type PDRole
- type Process
- type Pump
- type TiCDC
- type TiDBInstance
- type TiFlashInstance
- func (inst *TiFlashInstance) Addr() string
- func (inst *TiFlashInstance) Cmd() *exec.Cmd
- func (inst *TiFlashInstance) Component() string
- func (inst *TiFlashInstance) LogFile() string
- func (inst *TiFlashInstance) MetricAddr() (r MetricAddr)
- func (inst *TiFlashInstance) Start(ctx context.Context, version utils.Version) error
- func (inst *TiFlashInstance) StatusAddrs() (addrs []string)
- func (inst *TiFlashInstance) StoreAddr() string
- type TiFlashRole
- type TiKVCDC
- type TiKVInstance
- func (inst *TiKVInstance) Addr() string
- func (inst *TiKVInstance) Component() string
- func (inst *TiKVInstance) LogFile() string
- func (inst *TiKVInstance) MetricAddr() (r MetricAddr)
- func (inst *TiKVInstance) Start(ctx context.Context, version utils.Version) error
- func (inst *TiKVInstance) StoreAddr() string
- type TiProxy
Constants ¶
This section is empty.
Variables ¶
var SysProcAttr = &syscall.SysProcAttr{ Pdeathsig: syscall.SIGKILL, Setpgid: true, }
SysProcAttr to be use for every Process we start.
Functions ¶
func AdvertiseHost ¶ added in v1.3.3
AdvertiseHost returns the interface's ip addr if listen host is 0.0.0.0
func CompVersion ¶ added in v1.0.5
CompVersion return the format to run specified version of a component.
func GenTiProxySessionCerts ¶ added in v1.15.0
GenTiProxySessionCerts will create a self-signed certs for TiProxy session migration. NOTE that this cert is directly used by TiDB.
Types ¶
type CSEOptions ¶ added in v1.15.0
type CSEOptions struct { S3Endpoint string `yaml:"s3_endpoint"` Bucket string `yaml:"bucket"` AccessKey string `yaml:"access_key"` SecretKey string `yaml:"secret_key"` }
CSEOptions contains configs to run TiDB cluster in CSE mode.
type Config ¶
type Config struct { ConfigPath string `yaml:"config_path"` BinPath string `yaml:"bin_path"` Num int `yaml:"num"` Host string `yaml:"host"` Port int `yaml:"port"` UpTimeout int `yaml:"up_timeout"` Version string `yaml:"version"` }
Config of the instance.
type Drainer ¶ added in v1.0.5
type Drainer struct { Process // contains filtered or unexported fields }
Drainer represent a drainer instance.
func NewDrainer ¶ added in v1.0.5
func NewDrainer(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *Drainer
NewDrainer create a Drainer instance.
func (*Drainer) MetricAddr ¶ added in v1.14.0
func (inst *Drainer) MetricAddr() (r MetricAddr)
type Instance ¶
type Instance interface { Pid() int // Start the instance process. // Will kill the process once the context is done. Start(ctx context.Context, version utils.Version) error // Component Return the component name. Component() string // LogFile return the log file name LogFile() string // Uptime show uptime. Uptime() string // MetricAddr return the address to pull metrics. MetricAddr() MetricAddr // Wait Should only call this if the instance is started successfully. // The implementation should be safe to call Wait multi times. Wait() error }
Instance represent running component
type MetricAddr ¶ added in v1.14.0
type MetricAddr struct { Targets []string `json:"targets"` Labels map[string]string `json:"labels"` }
MetricAddr will be used by prometheus scrape_configs.
type PDInstance ¶
PDInstance represent a running pd-server
func NewPDInstance ¶
func NewPDInstance(role PDRole, binPath, dir, host, configPath string, id int, pds []*PDInstance, port int, isCSEMode bool) *PDInstance
NewPDInstance return a PDInstance
func (*PDInstance) Addr ¶
func (inst *PDInstance) Addr() string
Addr return the listen address of PD
func (*PDInstance) Component ¶ added in v1.0.7
func (inst *PDInstance) Component() string
Component return the component name.
func (*PDInstance) InitCluster ¶ added in v1.0.3
func (inst *PDInstance) InitCluster(pds []*PDInstance) *PDInstance
InitCluster set the init cluster instance.
func (*PDInstance) Join ¶
func (inst *PDInstance) Join(pds []*PDInstance) *PDInstance
Join set endpoints field of PDInstance
func (*PDInstance) LogFile ¶ added in v1.0.7
func (inst *PDInstance) LogFile() string
LogFile return the log file.
func (*PDInstance) MetricAddr ¶ added in v1.14.0
func (inst *PDInstance) MetricAddr() (r MetricAddr)
func (*PDInstance) Name ¶ added in v1.0.5
func (inst *PDInstance) Name() string
Name return the name of pd.
type Process ¶ added in v1.0.7
type Process interface { Start() error Wait() error Pid() int Uptime() string SetOutputFile(fname string) error Cmd() *exec.Cmd }
Process represent process to be run by playground
type Pump ¶ added in v1.0.5
type Pump struct { Process // contains filtered or unexported fields }
Pump represent a pump instance.
func NewPump ¶ added in v1.0.5
func NewPump(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *Pump
NewPump create a Pump instance.
func (*Pump) MetricAddr ¶ added in v1.14.0
func (inst *Pump) MetricAddr() (r MetricAddr)
type TiCDC ¶ added in v1.2.0
type TiCDC struct { Process // contains filtered or unexported fields }
TiCDC represent a ticdc instance.
func NewTiCDC ¶ added in v1.2.0
func NewTiCDC(binPath string, dir, host, configPath string, id int, port int, pds []*PDInstance) *TiCDC
NewTiCDC create a TiCDC instance.
func (*TiCDC) MetricAddr ¶ added in v1.14.0
func (inst *TiCDC) MetricAddr() (r MetricAddr)
type TiDBInstance ¶
type TiDBInstance struct { Process // contains filtered or unexported fields }
TiDBInstance represent a running tidb-server
func NewTiDBInstance ¶
func NewTiDBInstance(binPath string, dir, host, configPath string, id, port int, pds []*PDInstance, tiproxyCertDir string, enableBinlog bool, isCSEMode bool) *TiDBInstance
NewTiDBInstance return a TiDBInstance
func (*TiDBInstance) Addr ¶
func (inst *TiDBInstance) Addr() string
Addr return the listen address of TiDB
func (*TiDBInstance) Component ¶ added in v1.0.7
func (inst *TiDBInstance) Component() string
Component return the component name.
func (*TiDBInstance) LogFile ¶ added in v1.0.7
func (inst *TiDBInstance) LogFile() string
LogFile return the log file name.
func (*TiDBInstance) MetricAddr ¶ added in v1.14.0
func (inst *TiDBInstance) MetricAddr() (r MetricAddr)
type TiFlashInstance ¶
type TiFlashInstance struct { Role TiFlashRole TCPPort int ServicePort int ProxyPort int ProxyStatusPort int Process // contains filtered or unexported fields }
TiFlashInstance represent a running TiFlash
func NewTiFlashInstance ¶
func NewTiFlashInstance(role TiFlashRole, cseOptions CSEOptions, binPath, dir, host, configPath string, id int, pds []*PDInstance, dbs []*TiDBInstance, version string) *TiFlashInstance
NewTiFlashInstance return a TiFlashInstance
func (*TiFlashInstance) Addr ¶ added in v1.0.5
func (inst *TiFlashInstance) Addr() string
Addr return the address of tiflash
func (*TiFlashInstance) Cmd ¶ added in v1.0.4
func (inst *TiFlashInstance) Cmd() *exec.Cmd
Cmd returns the internal Cmd instance
func (*TiFlashInstance) Component ¶ added in v1.0.7
func (inst *TiFlashInstance) Component() string
Component return the component name.
func (*TiFlashInstance) LogFile ¶ added in v1.0.7
func (inst *TiFlashInstance) LogFile() string
LogFile return the log file name.
func (*TiFlashInstance) MetricAddr ¶ added in v1.14.0
func (inst *TiFlashInstance) MetricAddr() (r MetricAddr)
func (*TiFlashInstance) StatusAddrs ¶ added in v1.0.4
func (inst *TiFlashInstance) StatusAddrs() (addrs []string)
StatusAddrs implements Instance interface.
func (*TiFlashInstance) StoreAddr ¶
func (inst *TiFlashInstance) StoreAddr() string
StoreAddr return the store address of TiFlash
type TiFlashRole ¶ added in v1.12.2
type TiFlashRole string
TiFlashRole is the role of TiFlash.
const ( // TiFlashRoleNormal is used when TiFlash is not in disaggregated mode. TiFlashRoleNormal TiFlashRole = "normal" // TiFlashRoleDisaggWrite is used when TiFlash is in disaggregated mode and is the write node. TiFlashRoleDisaggWrite TiFlashRole = "write" // TiFlashRoleDisaggCompute is used when TiFlash is in disaggregated mode and is the compute node. TiFlashRoleDisaggCompute TiFlashRole = "compute" )
type TiKVCDC ¶ added in v1.11.0
type TiKVCDC struct { Process // contains filtered or unexported fields }
TiKVCDC represent a TiKV-CDC instance.
func NewTiKVCDC ¶ added in v1.11.0
func NewTiKVCDC(binPath string, dir, host, configPath string, id int, pds []*PDInstance) *TiKVCDC
NewTiKVCDC create a TiKVCDC instance.
func (*TiKVCDC) MetricAddr ¶ added in v1.14.0
func (inst *TiKVCDC) MetricAddr() (r MetricAddr)
type TiKVInstance ¶
type TiKVInstance struct { Process // contains filtered or unexported fields }
TiKVInstance represent a running tikv-server
func NewTiKVInstance ¶
func NewTiKVInstance(binPath string, dir, host, configPath string, id int, port int, pds []*PDInstance, tsos []*PDInstance, isCSEMode bool, cseOptions CSEOptions, isPDMSMode bool) *TiKVInstance
NewTiKVInstance return a TiKVInstance
func (*TiKVInstance) Addr ¶ added in v1.0.5
func (inst *TiKVInstance) Addr() string
Addr return the address of tikv.
func (*TiKVInstance) Component ¶ added in v1.0.7
func (inst *TiKVInstance) Component() string
Component return the component name.
func (*TiKVInstance) LogFile ¶ added in v1.0.7
func (inst *TiKVInstance) LogFile() string
LogFile return the log file name.
func (*TiKVInstance) MetricAddr ¶ added in v1.14.0
func (inst *TiKVInstance) MetricAddr() (r MetricAddr)
func (*TiKVInstance) StoreAddr ¶
func (inst *TiKVInstance) StoreAddr() string
StoreAddr return the store address of TiKV
type TiProxy ¶ added in v1.13.0
type TiProxy struct { Process // contains filtered or unexported fields }
TiProxy represent a ticdc instance.
func NewTiProxy ¶ added in v1.13.0
func NewTiProxy(binPath string, dir, host, configPath string, id int, port int, pds []*PDInstance) *TiProxy
NewTiProxy create a TiProxy instance.
func (*TiProxy) Addr ¶ added in v1.13.0
Addr return addresses that can be connected by MySQL clients.
func (*TiProxy) MetricAddr ¶ added in v1.14.0
func (c *TiProxy) MetricAddr() (r MetricAddr)
MetricAddr implements Instance interface.