Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support deploy and manage dm 2.0 (#587)
This PR refactor some code and make tiup-dm support all commands like tiup-cluster(except for `check` and `import`) - code ` components/cluster/command/*` are move into `pkg/cluster/deploy/` and change it to deploy a general cluster instead of tidb cluster, both tiup-cluster and tiup-dm use it to avoid many duplicate codes, and maybe later for some tiup-** to use it too. - move `pkg/dm/` into `components/dm` - many code in pkg/cluster/* are change to support work with a general cluster, I prefer to move code `tiup-cluser` specified code into component/cluster later. - note tiup-dm does not support monitor yet in this pr. all the existing command are supported: ``` Deploy a DM cluster for production Usage: tiup-dm [flags] tiup-dm [command] Available Commands: deploy Deploy a DM cluster for production start Start a DM cluster stop Stop a DM cluster restart Restart a DM cluster list List all clusters destroy Destroy a specified DM cluster audit Show audit log of cluster operation exec Run shell command on host in the dm cluster edit-config Edit DM cluster config display Display information of a DM cluster reload Reload a DM cluster's config and restart if needed upgrade Upgrade a specified DM cluster patch Replace the remote package with a specified package and restart the service scale-out Scale out a DM cluster scale-in Scale in a DM cluster help Help about any command Flags: -h, --help help for tiup-dm --ssh-timeout int Timeout in seconds to connect host via SSH, ignored for operations that don't need an SSH connection. (default 5) -v, --version version for tiup-dm --wait-timeout int Timeout in seconds to wait for an operation to complete, ignored for operations that don't fit. (default 60) -y, --yes Skip all confirmations and assumes 'yes' Use "tiup-dm help [command]" for more information about a command. ``` a cluster may look like: ``` root@control:/tiup-cluster# tdm display test dm Cluster: test dm Version: nightly ID Role Host Ports OS/Arch Status Data Dir Deploy Dir -- ---- ---- ----- ------- ------ -------- ---------- 172.19.0.101:8261 dm-master 172.19.0.101 8261/8291 linux/x86_64 Healthy data deploy/dm-master-8261 172.19.0.101:8361 dm-master 172.19.0.101 8361/8292 linux/x86_64 Unhealthy data deploy/dm-master-8361 172.19.0.102:8261 dm-master 172.19.0.102 8261/8291 linux/x86_64 Healthy data deploy/dm-master-8261 172.19.0.103:8261 dm-master 172.19.0.103 8261/8291 linux/x86_64 Healthy /home/tidb/my_master_data deploy/dm-master-8261 172.19.0.104:8261 dm-master 172.19.0.104 8261/8291 linux/x86_64 Healthy|L data deploy/dm-master-8261 172.19.0.105:8261 dm-master 172.19.0.105 8261/8291 linux/x86_64 Healthy data deploy/dm-master-8261 172.19.0.101:8280 dm-portal 172.19.0.101 8280 linux/x86_64 Up data deploy/dm-portal-8280 172.19.0.102:8280 dm-portal 172.19.0.102 8280 linux/x86_64 Up data deploy/dm-portal-8280 172.19.0.101:8262 dm-worker 172.19.0.101 8262 linux/x86_64 Free data deploy/dm-worker-8262 172.19.0.101:8263 dm-worker 172.19.0.101 8263 linux/x86_64 Free data deploy/dm-worker-8263 172.19.0.102:8262 dm-worker 172.19.0.102 8262 linux/x86_64 Free data deploy/dm-worker-8262 172.19.0.103:8262 dm-worker 172.19.0.103 8262 linux/x86_64 Free data deploy/dm-worker-8262 172.19.0.104:8262 dm-worker 172.19.0.104 8262 linux/x86_64 Free data deploy/dm-worker-8262 ```
- Loading branch information