ansible

package
v1.3.1-0...-83f5247 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel  string `toml:"log-level" json:"log-level"`
	LogFile   string `toml:"log-file" json:"log-file"`
	LogFormat string `toml:"log-format" json:"log-format"`
	LogRotate string `toml:"log-rotate" json:"log-rotate"`

	WorkerAddr string `toml:"worker-addr" json:"worker-addr"`

	EnableGTID  bool   `toml:"enable-gtid" json:"enable-gtid"`
	AutoFixGTID bool   `toml:"auto-fix-gtid" json:"auto-fix-gtid"`
	RelayDir    string `toml:"relay-dir" json:"relay-dir"`
	MetaDir     string `toml:"meta-dir" json:"meta-dir"`
	ServerID    uint32 `toml:"server-id" json:"server-id"`
	Flavor      string `toml:"flavor" json:"flavor"`
	Charset     string `toml:"charset" json:"charset"`

	// relay synchronous starting point (if specified)
	RelayBinLogName string `toml:"relay-binlog-name" json:"relay-binlog-name"`
	RelayBinlogGTID string `toml:"relay-binlog-gtid" json:"relay-binlog-gtid"`

	SourceID string   `toml:"source-id" json:"source-id"`
	From     DBConfig `toml:"from" json:"from"`
}

Config Copy from https://github.com/pingcap/dm/blob/21a6e6e580f2e911edbe2400241bd95de2f7ef43/dm/worker/config.go#L93 remove some unconcern parts.

func (*Config) ToSource

func (c *Config) ToSource() (source *SourceConfig)

ToSource generate the SourceConfig for DM 2.0

type DBConfig

type DBConfig struct {
	Host             string `toml:"host" json:"host" yaml:"host"`
	Port             int    `toml:"port" json:"port" yaml:"port"`
	User             string `toml:"user" json:"user" yaml:"user"`
	Password         string `toml:"password" json:"-" yaml:"password"` // omit it for privacy
	MaxAllowedPacket *int   `toml:"max-allowed-packet" json:"max-allowed-packet" yaml:"max-allowed-packet"`
}

DBConfig of db.

type ExecutorGetter

type ExecutorGetter interface {
	Get(host string) (e ctxt.Executor)
}

ExecutorGetter get the executor by host.

type Importer

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

Importer used for import from ansible. ref DM docs: https://docs.pingcap.com/zh/tidb-data-migration/dev/deploy-a-dm-cluster-using-ansible

func NewImporter

func NewImporter(ansibleDir, inventoryFileName string, sshType executor.SSHType, sshTimeout uint64) (*Importer, error)

NewImporter create an Importer. @sshTimeout: set 0 to use a default value

func (*Importer) ImportFromAnsibleDir

func (im *Importer) ImportFromAnsibleDir(ctx context.Context) (clusterName string, meta *spec.Metadata, err error)

ImportFromAnsibleDir generate the metadata from ansible deployed cluster.

func (*Importer) ScpSourceToMaster

func (im *Importer) ScpSourceToMaster(ctx context.Context, topo *spec.Specification) (err error)

ScpSourceToMaster scp the source files to master, and set V1SourcePath of the master spec.

type SourceConfig

type SourceConfig struct {
	EnableGTID  bool   `yaml:"enable-gtid" toml:"enable-gtid" json:"enable-gtid"`
	AutoFixGTID bool   `yaml:"auto-fix-gtid" toml:"auto-fix-gtid" json:"auto-fix-gtid"`
	RelayDir    string `yaml:"relay-dir" toml:"relay-dir" json:"relay-dir"`
	MetaDir     string `yaml:"meta-dir" toml:"meta-dir" json:"meta-dir"`
	Flavor      string `yaml:"flavor" toml:"flavor" json:"flavor"`
	Charset     string `yaml:"charset" toml:"charset" json:"charset"`

	EnableRelay bool `yaml:"enable-relay" toml:"enable-relay" json:"enable-relay"`
	// relay synchronous starting point (if specified)
	RelayBinLogName string `yaml:"relay-binlog-name" toml:"relay-binlog-name" json:"relay-binlog-name"`
	RelayBinlogGTID string `yaml:"relay-binlog-gtid" toml:"relay-binlog-gtid" json:"relay-binlog-gtid"`

	SourceID string   `yaml:"source-id" toml:"source-id" json:"source-id"`
	From     DBConfig `yaml:"from" toml:"from" json:"from"`
}

SourceConfig is the configuration for Worker ref: https://github.com/pingcap/dm/blob/3730a4e231091c5d65130d15a6c09a3b9fa3255e/dm/config/source_config.go#L51

Jump to

Keyboard shortcuts

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