##############

 

 一、tiup  list:

语法:tiup list [component] [flags]

[component] 是可选的组件名称。

若指定组件,则列出该组件的所有可安装版本;

若不指定组件,则列出所有可安装的组件列表。

 

0)举例说明:

# 显示所有可安装的组件
shell>> tiup list

# 显示所有可安装的组件
shell>> tiup list --all

# 显示当前已经安装的组件
shell>> tiup list --installed

# 显示dumpling组件所有的可安装组件:
shell>> tiup list dumpling

# 显示dumpling组件已经安装的版本有哪些:
shell>> tiup list dumpling --installed

 

1)查看有哪些组件可安装:tiup  list 和 tiup  list --all

 

[root@xxx ~]# tiup list 
Available components:
Name Owner Description
---- ----- -----------
PCC community A tool used to capture plan changes among different versions of TiDB
bench pingcap Benchmark database with different workloads
br pingcap TiDB/TiKV cluster backup restore tool
cdc pingcap CDC is a change data capture tool for TiDB
client pingcap Client to connect playground
cluster pingcap Deploy a TiDB cluster for production
ctl pingcap TiDB controller suite
dm pingcap Data Migration Platform manager
dmctl pingcap dmctl component of Data Migration Platform
errdoc pingcap Document about TiDB errors
pd-recover pingcap PD Recover is a disaster recovery tool of PD, used to recover the PD cluster which cannot start or provide services normally
playground pingcap Bootstrap a local TiDB cluster for fun
tidb pingcap TiDB is an open source distributed HTAP database compatible with the MySQL protocol
tidb-lightning pingcap TiDB Lightning is a tool used for fast full import of large amounts of data into a TiDB cluster
tiup pingcap TiUP is a command-line component management tool that can help to download and install TiDB platform components to the local system

 

[root@xxx ~]# tiup list --all
Available components:
Name Owner Description
---- ----- -----------
PCC community A tool used to capture plan changes among different versions of TiDB
alertmanager pingcap Prometheus alertmanager
bench pingcap Benchmark database with different workloads
blackbox_exporter pingcap Blackbox prober exporter
br pingcap TiDB/TiKV cluster backup restore tool
cdc pingcap CDC is a change data capture tool for TiDB
client pingcap Client to connect playground
cluster pingcap Deploy a TiDB cluster for production
ctl pingcap TiDB controller suite
dba community dbatoolset
diag community Diagnostic Collector
dm pingcap Data Migration Platform manager
dm-master pingcap dm-master component of Data Migration Platform
dm-worker pingcap dm-worker component of Data Migration Platform
dmctl pingcap dmctl component of Data Migration Platform
drainer pingcap The drainer componet of TiDB binlog service
dumpling pingcap Dumpling is a CLI tool that helps you dump MySQL/TiDB data
errdoc pingcap Document about TiDB errors
grafana pingcap Grafana is the open source analytics & monitoring solution for every database
influxdb community InfluxDB
insight pingcap TiDB-Insight collector
node_exporter pingcap Exporter for machine metrics
package pingcap A toolbox to package tiup component
pd pingcap PD is the abbreviation for Placement Driver. It is used to manage and schedule the TiKV cluster
pd-recover pingcap PD Recover is a disaster recovery tool of PD, used to recover the PD cluster which cannot start or provide services normally
playground pingcap Bootstrap a local TiDB cluster for fun
prometheus pingcap The Prometheus monitoring system and time series database
pump pingcap The pump componet of TiDB binlog service
pushgateway pingcap Push acceptor for ephemeral and batch jobs
server pingcap TiUP publish/cache server
spark pingcap Spark is a fast and general cluster computing system for Big Data
tidb pingcap TiDB is an open source distributed HTAP database compatible with the MySQL protocol
tidb-lightning pingcap TiDB Lightning is a tool used for fast full import of large amounts of data into a TiDB cluster
tiflash pingcap The TiFlash Columnar Storage Engine
tikv pingcap Distributed transactional key-value database, originally created to complement TiDB
tikv-importer pingcap
tispark pingcap tispark
tiup pingcap TiUP is a command-line component management tool that can help to download and install

 

 

2)查看当前已经安装的组件:tiup  list  --installed

[work@xxx scripts]$ tiup list --installed
Available components:
Name Owner Description
---- ----- -----------
br pingcap TiDB/TiKV cluster backup restore tool
cdc pingcap CDC is a change data capture tool for TiDB
cluster pingcap Deploy a TiDB cluster for production
ctl pingcap TiDB controller suite
dm pingcap Data Migration Platform manager
dmctl pingcap dmctl component of Data Migration Platform
dumpling pingcap Dumpling is a CLI tool that helps you dump MySQL/TiDB data
pd pingcap PD is the abbreviation for Placement Driver. It is used to manage and schedule the TiKV cluster
tidb pingcap TiDB is an open source distributed HTAP database compatible with the MySQL protocol
tidb-lightning pingcap TiDB Lightning is a tool used for

 

 

 3)查看指定组件有哪些版本可安装:tiup  list  dumpling

[work@xxx scripts]$ tiup list dumpling
Available versions for dumpling:
Version Installed Release Platforms
------- --------- ------- ---------
nightly -> v5.0.0-nightly-20210823 2021-08-23T21:44:08+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v4.0.2 2020-07-24T11:08:26+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.3 2020-07-25T00:15:02+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.4 2020-07-31T17:04:38+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.5 2020-09-01T00:03:42+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.6 2020-09-15T22:24:19+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.7 2020-09-29T20:26:09+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.8 2020-10-30T19:42:30+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.9 2020-12-21T17:32:34+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.10 2021-01-15T13:25:29+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.11 2021-02-26T17:45:08+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.12-20210427 2021-05-08T11:15:29+08:00 linux/amd64
v4.0.12 2021-04-02T17:01:42+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.13 2021-05-27T22:25:42+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.14 2021-07-27T18:16:09+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.0-20210329 2021-03-29T19:59:59+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.0-20210403 2021-04-03T09:21:27+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.0-nightly-20210823 2021-08-23T21:44:08+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v5.0.0-rc YES 2021-01-13T00:08:42+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.0 YES 2021-04-07T17:40:30+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.1 2021-04-24T21:38:11+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.2 2021-06-09T22:57:12+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.3 2021-07-02T16:20:59+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.1.0 2021-06-24T16:31:56+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.1.1 YES 2021-07-30T16:12:18+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64

 

 4)查看指定组件当前已经安装了哪些版本:tiup  list  dumpling  --installed

[work@xxx scripts]$ tiup list dumpling  --installed
Available versions for dumpling:
Version Installed Release Platforms
------- --------- ------- ---------
v5.0.0-rc YES 2021-01-13T00:08:55+08:00 linux/amd64,linux/arm64,darwin/amd64
v5.0.0 YES 2021-04-07T17:40:41+08:00 linux/amd64,linux/arm64,darwin/amd64
v5.1.1 YES 2021-08-02T13:31:19+08:00

 

 

 二、tiup  install

语法:tiup install <component1>[:version] [component2...N] [flags]

1)<component1> 和 <component2> 代表组件名字,[version] 代表一个可选的版本号。

2)若不加 version,则安装指定组件的最新稳定版本。

3)[component2...N] 表示可同时指定多个组件或同一个组件的多个版本。

 

​tiup install​

当tiup需要运行一个镜像仓库中不存在的组件时,会尝试先下载该组件,再自动运行,若仓库中不存在会报错。

 

  • 正常情况下输出组件的下载信息
  • 若组件不存在则报错

​The component "%s" not found​

  • 若版本不存在则报错

​version %s not supported by component %s​

 

1)查看当前系统是否已安装需要的组件:tiup list --installed

[root@tj1-using-glc-db01 ~]# tiup list --installed
Available components:
Name Owner Description
---- ----- -----------
cluster pingcap Deploy a TiDB cluster for production
dumpling pingcap Dumpling is a CLI tool that helps you dump MySQL/TiDB data
pd-recover pingcap PD Recover is a disaster recovery tool of PD, used to recover the PD cluster which cannot start or provide services normally
You have new mail in

 

2)查看指定组件可安装的版本有哪些:tiup list tidb-lightning

[root@tj1-using-glc-db01 ~]# tiup list tidb-lightning
Available versions for tidb-lightning:
Version Installed Release Platforms
------- --------- ------- ---------
nightly -> v5.0.0-nightly-20211013 2021-10-13T21:37:04+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v3.0.0 2020-07-24T14:43:51+08:00 linux/amd64
v3.0.1 2020-07-24T14:45:40+08:00 linux/amd64
v3.0.2 2020-07-24T14:47:51+08:00 linux/amd64
v3.0.3 2020-07-24T14:52:22+08:00 linux/amd64
v3.0.4 2020-07-24T14:53:28+08:00 linux/amd64
v3.0.5 2020-07-24T14:54:34+08:00 linux/amd64
v3.0.6 2020-07-24T14:55:44+08:00 linux/amd64
v3.0.7 2020-07-24T14:57:13+08:00 linux/amd64
v3.0.8 2020-07-24T14:58:41+08:00 linux/amd64
v3.0.9 2020-07-24T14:59:36+08:00 darwin/amd64,linux/amd64
v3.0.10 2020-07-24T14:59:52+08:00 darwin/amd64,linux/amd64
v3.0.11 2020-07-24T15:00:08+08:00 darwin/amd64,linux/amd64
v3.0.12 2020-07-24T15:00:25+08:00 darwin/amd64,linux/amd64
v3.0.13 2020-07-24T15:00:58+08:00 darwin/amd64,linux/amd64
v3.0.14 2020-07-24T15:02:13+08:00 darwin/amd64,linux/amd64
v3.0.15 2020-07-24T15:03:19+08:00 darwin/amd64,linux/amd64
v3.0.16 2020-07-24T15:04:25+08:00 darwin/amd64,linux/amd64
v3.0.17 2020-08-03T15:58:19+08:00 darwin/amd64,linux/amd64,linux/arm64
v3.0.18 2020-08-21T20:14:29+08:00 darwin/amd64,linux/amd64,linux/arm64
v3.0.19 2020-09-25T18:30:49+08:00 darwin/amd64,linux/amd64,linux/arm64
v3.0.20 2020-12-25T15:25:11+08:00 darwin/amd64,linux/amd64,linux/arm64
v3.1.0-beta 2020-07-24T15:05:41+08:00 linux/amd64
v3.1.0-beta.1 2020-07-24T15:07:03+08:00 darwin/amd64,linux/amd64
v3.1.0-beta.2 2020-07-24T15:08:08+08:00 darwin/amd64,linux/amd64
v3.1.0-rc 2020-07-24T15:09:25+08:00 darwin/amd64,linux/amd64
v3.1.0 2020-07-24T15:10:37+08:00 darwin/amd64,linux/amd64
v3.1.1 2020-07-24T15:11:49+08:00 darwin/amd64,linux/amd64
v3.1.2 2020-07-24T15:13:10+08:00 darwin/amd64,linux/amd64
v4.0.0-beta 2020-07-24T15:42:16+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.0-beta.1 2020-07-24T15:45:28+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.0-beta.2 2020-07-24T15:46:30+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.0-rc 2020-07-24T15:47:37+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.0-rc.1 2020-07-24T15:49:04+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.0-rc.2 2020-07-24T15:50:03+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.0 2020-07-24T15:51:03+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.1 2020-07-24T15:52:03+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.2 2020-07-24T15:53:20+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.3 2020-07-25T00:16:39+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.4 2020-07-31T17:06:25+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.5 2020-09-01T00:04:55+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.6 2020-09-15T22:25:23+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.7 2020-09-29T20:27:22+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.8 2020-10-30T19:43:39+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.9 2020-12-21T17:33:29+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.10 2021-01-15T13:29:14+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.11 2021-02-26T17:45:56+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.12-20210427 2021-05-08T11:16:16+08:00 linux/amd64
v4.0.12 2021-04-02T19:27:46+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.13 2021-05-27T22:26:55+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.14 2021-07-27T18:17:23+08:00 darwin/amd64,linux/amd64,linux/arm64
v4.0.15 2021-09-23T18:46:56+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.0-20210329 2021-03-29T20:03:43+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.0-20210403 2021-04-03T09:22:38+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.0-nightly-20211013 2021-10-13T21:37:04+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v5.0.0-rc 2021-01-13T00:09:29+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.0 2021-04-07T17:41:44+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.1 2021-04-24T21:39:13+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.2 2021-06-09T22:58:47+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.3 2021-07-02T16:22:21+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.0.4 2021-09-14T18:17:19+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v5.1.0 2021-06-24T16:33:22+08:00 darwin/amd64,linux/amd64,linux/arm64
v5.1.1 2021-07-30T16:14:05+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v5.1.2 2021-09-27T13:13:52+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v5.2.0 2021-08-27T18:53:12+08:00 darwin/amd64,darwin/arm64,linux/amd64,linux/arm64
v5.2.1 2021-09-09T19:14:15+08:00

 

3)安装指定版本的组件:tiup install tidb-lightning:v5.2.1

[root@xxx ~]# tiup  install tidb-lightning:v5.2.1
download https://tiup-mirrors.pingcap.com/tidb-lightning-v5.2.1-linux-amd64.tar.gz 48.16 MiB / 48.16 MiB 100.00% 9.03 MiB/s

 

4)核对刚安装的组件:tiup list tidb-lightning --installed

[root@xxx ~]# tiup   list tidb-lightning  --installed
Available versions for tidb-lightning:
Version Installed Release Platforms
------- --------- ------- ---------
v5.2.1 YES 2021-09-09T19:14:15+08:00

 

5)查看指定组件二进制文件安装的位置:tiup -B tidb-lightning:v5.2.1

[root@xxx ~]# tiup -B tidb-lightning
/root/.tiup/components/tidb-lightning/v5.2.1/tidb-lightning
You have new mail in /var/spool/mail/root

[root@xxx ~]# tiup -B tidb-lightning:v5.2.1
/root/.tiup/components/tidb-lightning/v5.2.1/tidb-lightning

 

 

三、tiup uninstall:

语法:tiup uninstall <component1>:<version> [component2...N] [flags]

1)<component1> 表示要卸载的组件名字

2)<version> 表示要卸载的版本,如果省略,则表示卸载该组件的全部已安装版本,因为安全原因,省略 <version> 时必须加上选项 --all 明确表示需要卸载该组件的所有版本

3)[component2...N] 表示可指定卸载多个组件或版本

 

可选参数:

--all
卸载指定组件的全部已安装版本,省略 <version> 时使用。
数据类型:BOOLEAN
该选项默认关闭,默认值为 false。在命令中添加该选项,并传入 true 值或不传值,均可开启此功能。

--self
卸载 TiUP 自身:删除所有从镜像上下载过来的数据,但会保留 TiUP 及其组件产生的数据,数据存放在 TIUP_HOME 环境变量指定的目录中,若未设置过 TIUP_HOME,则默认值为 ~/.tiup/。
数据类型:BOOLEAN
该选项默认关闭,默认值为 false。在命令中添加该选项,并传入 true 值或不传值,均可开启此功能。

 

输出:

1)正常退出:Uninstalled component "%s" successfully!

2)若未指定 <version> 也未指定 --all:报错 Use "tiup uninstall tidbx --all" if

 

 

1)查看当前系统已经安装了哪些组件:tiup list --installed

[root@xxx~]# tiup list --installed
Available components:
Name Owner Description
---- ----- -----------
br pingcap TiDB/TiKV cluster backup restore tool
ctl pingcap TiDB controller suite
dm pingcap Data Migration Platform manager
tidb-lightning pingcap TiDB Lightning is a tool used for fast full import of large amounts of data into a TiDB cluster

 

2)卸载指定组件所有版本:tiup uninstall tidb-lightning  --all

[root@xxx ~]# tiup uninstall  tidb-lightning --all
Uninstalled component `tidb-lightning` successfully!

 

3)核对组件是否已经卸载:

[root@xxx ~]# tiup list --installed
Available components:
Name Owner Description
---- ----- -----------
br pingcap TiDB/TiKV cluster backup restore tool
ctl pingcap TiDB controller suite
dm pingcap Data Migration Platform manager

 

4)也可只卸载指定组件的指定的版本:tiup uninstall dm:v1.6.0

[root@tj1-using-glc-db01 ~]# tiup uninstall  dm:v1.6.0
Uninstalled component `dm:v1.6.0` successfully!

 

 

 

 

###################

tidb的tiup工具_mysql

 

###################