如题,如果使用ansible就需要再做准备。
tiup 只支持4.X 以上的版本啊
只能 ansible 了
实测 使用tiup 可以部署tidb v3.0.20集群 具体执行过程如下:
tiup cluster deploy tidb01 v3.0.20 ./topology.yaml --user root
Found cluster newer version:
The latest version: v1.4.4
Local installed version: v1.3.1
Update current component: tiup update cluster
Update all components: tiup update --all
Starting component cluster
: /home/dell/.tiup/components/cluster/v1.3.1/tiup-cluster deploy tidb01 v3.0.20 ./topology.yaml --user root
Please confirm your topology:
Cluster type: tidb
Cluster name: tidb01
Cluster version: v3.0.20
Type Host Ports OS/Arch Directories
pd 10.2.1.41 2379/2380 linux/x86_64 /opt/tidb/pd-2379,/data/pd-2379
pd 10.2.1.42 2379/2380 linux/x86_64 /opt/tidb/pd-2379,/data/pd-2379
pd 10.2.1.43 2379/2380 linux/x86_64 /opt/tidb/pd-2379,/data/pd-2379
tikv 10.2.1.44 20160/20180 linux/x86_64 /opt/tidb/tikv-20160,/data/tikv-20160
tikv 10.2.1.45 20160/20180 linux/x86_64 /opt/tidb/tikv-20160,/data/tikv-20160
tikv 10.2.1.46 20160/20180 linux/x86_64 /opt/tidb/tikv-20160,/data/tikv-20160
tidb 10.2.1.41 4000/10080 linux/x86_64 /opt/tidb/tidb-4000
tidb 10.2.1.42 4000/10080 linux/x86_64 /opt/tidb/tidb-4000
tidb 10.2.1.43 4000/10080 linux/x86_64 /opt/tidb/tidb-4000
prometheus 10.2.1.47 9090 linux/x86_64 /opt/tidb/prometheus-9090,/data/prometheus-9090
grafana 10.2.1.47 3000 linux/x86_64 /opt/tidb/grafana-3000
alertmanager 10.2.1.47 9093/9094 linux/x86_64 /opt/tidb/alertmanager-9093,/data/alertmanager-9093
Attention:
1. If the topology is not what you expected, check your yaml file.
2. Please confirm there is no port/directory conflicts in same host.
Do you want to continue? [y/N]: y
-
Generate SSH keys … Done
-
Download TiDB components
- Download pd:v3.0.20 (linux/amd64) … Done
- Download tikv:v3.0.20 (linux/amd64) … Done
- Download tidb:v3.0.20 (linux/amd64) … Done
- Download prometheus:v3.0.20 (linux/amd64) … Done
- Download grafana:v3.0.20 (linux/amd64) … Done
- Download alertmanager:v0.17.0 (linux/amd64) … Done
- Download node_exporter:v0.17.0 (linux/amd64) … Done
- Download blackbox_exporter:v0.12.0 (linux/amd64) … Done
-
Initialize target host environments
-
Prepare 10.2.1.41:22 … Done
-
Prepare 10.2.1.42:22 … Done
-
Prepare 10.2.1.43:22 … Done
-
Prepare 10.2.1.44:22 … Done
-
Prepare 10.2.1.45:22 … Done
-
Prepare 10.2.1.46:22 … Done
-
Prepare 10.2.1.47:22 … Done
-
Copy tikv -> 10.2.1.44 … Done
-
Copy tikv -> 10.2.1.45 … Done
-
Copy tikv -> 10.2.1.46 … Done
-
Copy tidb -> 10.2.1.41 … Done
-
Copy tidb -> 10.2.1.42 … Done
-
Copy tidb -> 10.2.1.43 … Done
-
Copy prometheus -> 10.2.1.47 … Done
-
Copy grafana -> 10.2.1.47 … Done
-
Copy alertmanager -> 10.2.1.47 … Done
-
Copy node_exporter -> 10.2.1.44 … Done
-
Copy node_exporter -> 10.2.1.45 … Done
-
Copy node_exporter -> 10.2.1.46 … Done
-
Copy node_exporter -> 10.2.1.47 … Done
-
Copy node_exporter -> 10.2.1.41 … Done
-
Copy node_exporter -> 10.2.1.42 … Done
-
Copy node_exporter -> 10.2.1.43 … Done
-
Copy blackbox_exporter -> 10.2.1.44 … Done
-
Copy blackbox_exporter -> 10.2.1.45 … Done
-
Copy blackbox_exporter -> 10.2.1.46 … Done
-
Copy blackbox_exporter -> 10.2.1.47 … Done
-
Copy blackbox_exporter -> 10.2.1.41 … Done
-
Copy blackbox_exporter -> 10.2.1.42 … Done
-
Copy blackbox_exporter -> 10.2.1.43 … Done
-
-
Check status
Enabling component pd
Enabling instance pd 10.2.1.43:2379
Enabling instance pd 10.2.1.41:2379
Enabling instance pd 10.2.1.42:2379
Enable pd 10.2.1.41:2379 success
Enable pd 10.2.1.42:2379 success
Enable pd 10.2.1.43:2379 success
Enabling component node_exporter
Enabling component blackbox_exporter
Enabling component node_exporter
Enabling component blackbox_exporter
Enabling component node_exporter
Enabling component blackbox_exporter
Enabling component tikv
Enabling instance tikv 10.2.1.46:20160
Enabling instance tikv 10.2.1.44:20160
Enabling instance tikv 10.2.1.45:20160
Enable tikv 10.2.1.46:20160 success
Enable tikv 10.2.1.44:20160 success
Enable tikv 10.2.1.45:20160 success
Enabling component node_exporter
Enabling component blackbox_exporter
Enabling component node_exporter
Enabling component blackbox_exporter
Enabling component node_exporter
Enabling component blackbox_exporter
Enabling component tidb
Enabling instance tidb 10.2.1.43:4000
Enabling instance tidb 10.2.1.41:4000
Enabling instance tidb 10.2.1.42:4000
Enable tidb 10.2.1.42:4000 success
Enable tidb 10.2.1.43:4000 success
Enable tidb 10.2.1.41:4000 success
Enabling component prometheus
Enabling instance prometheus 10.2.1.47:9090
Enable prometheus 10.2.1.47:9090 success
Enabling component node_exporter
Enabling component blackbox_exporter
Enabling component grafana
Enabling instance grafana 10.2.1.47:3000
Enable grafana 10.2.1.47:3000 success
Enabling component alertmanager
Enabling instance alertmanager 10.2.1.47:9093
Enable alertmanager 10.2.1.47:9093 success
Clustertidb01
deployed successfully, you can start it with command:tiup cluster start tidb01
dell@dell-pc:tidb$ tiup cluster start tidb01
Found cluster newer version:The latest version: v1.4.4
Local installed version: v1.3.1
Update current component: tiup update cluster
Update all components: tiup update --all
Starting component cluster
: /home/dell/.tiup/components/cluster/v1.3.1/tiup-cluster start tidb01
Starting cluster tidb01…
- [ Serial ] - SSHKeySet: privateKey=/home/dell/.tiup/storage/cluster/clusters/tidb01/ssh/id_rsa, publicKey=/home/dell/.tiup/storage/cluster/clusters/tidb01/ssh/id_rsa.pub
- [Parallel] - UserSSH: user=tidb, host=10.2.1.47
- [Parallel] - UserSSH: user=tidb, host=10.2.1.46
- [Parallel] - UserSSH: user=tidb, host=10.2.1.41
- [Parallel] - UserSSH: user=tidb, host=10.2.1.42
- [Parallel] - UserSSH: user=tidb, host=10.2.1.44
- [Parallel] - UserSSH: user=tidb, host=10.2.1.43
- [Parallel] - UserSSH: user=tidb, host=10.2.1.45
- [Parallel] - UserSSH: user=tidb, host=10.2.1.43
- [Parallel] - UserSSH: user=tidb, host=10.2.1.41
- [Parallel] - UserSSH: user=tidb, host=10.2.1.47
- [Parallel] - UserSSH: user=tidb, host=10.2.1.47
- [Parallel] - UserSSH: user=tidb, host=10.2.1.42
- [ Serial ] - StartCluster
Starting component pd
Starting instance pd 10.2.1.43:2379
Starting instance pd 10.2.1.41:2379
Starting instance pd 10.2.1.42:2379
Start pd 10.2.1.43:2379 success
Start pd 10.2.1.42:2379 success
Start pd 10.2.1.41:2379 success
Starting component node_exporter
Starting instance 10.2.1.41
Start 10.2.1.41 success
Starting component blackbox_exporter
Starting instance 10.2.1.41
Start 10.2.1.41 success
Starting component node_exporter
Starting instance 10.2.1.42
Start 10.2.1.42 success
Starting component blackbox_exporter
Starting instance 10.2.1.42
Start 10.2.1.42 success
Starting component node_exporter
Starting instance 10.2.1.43
Start 10.2.1.43 success
Starting component blackbox_exporter
Starting instance 10.2.1.43
Start 10.2.1.43 success
Starting component tikv
Starting instance tikv 10.2.1.46:20160
Starting instance tikv 10.2.1.44:20160
Starting instance tikv 10.2.1.45:20160
Start tikv 10.2.1.45:20160 success
Start tikv 10.2.1.46:20160 success
Start tikv 10.2.1.44:20160 success
Starting component node_exporter
Starting instance 10.2.1.44
Start 10.2.1.44 success
Starting component blackbox_exporter
Starting instance 10.2.1.44
Start 10.2.1.44 success
Starting component node_exporter
Starting instance 10.2.1.45
Start 10.2.1.45 success
Starting component blackbox_exporter
Starting instance 10.2.1.45
Start 10.2.1.45 success
Starting component node_exporter
Starting instance 10.2.1.46
Start 10.2.1.46 success
Starting component blackbox_exporter
Starting instance 10.2.1.46
Start 10.2.1.46 success
Starting component tidb
Starting instance tidb 10.2.1.43:4000
Starting instance tidb 10.2.1.42:4000
Starting instance tidb 10.2.1.41:4000
Start tidb 10.2.1.43:4000 success
Start tidb 10.2.1.42:4000 success
Start tidb 10.2.1.41:4000 success
Starting component prometheus
Starting instance prometheus 10.2.1.47:9090
Start prometheus 10.2.1.47:9090 success
Starting component node_exporter
Starting instance 10.2.1.47
Start 10.2.1.47 success
Starting component blackbox_exporter
Starting instance 10.2.1.47
Start 10.2.1.47 success
Starting component grafana
Starting instance grafana 10.2.1.47:3000
Start grafana 10.2.1.47:3000 success
Starting component alertmanager
Starting instance alertmanager 10.2.1.47:9093
Start alertmanager 10.2.1.47:9093 success - [ Serial ] - UpdateTopology: cluster=tidb01
Started clustertidb01
successfully
dell@dell-pc:tidb$ mysql -uroot -h 10.2.1.41 -P 4000
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.25-TiDB-v3.0.20 MySQL Community Server (Apache License 2.0)
Copyright © 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> show database;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 13 near “database”
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| INFORMATION_SCHEMA |
| PERFORMANCE_SCHEMA |
| mysql |
| test |
±-------------------+
4 rows in set (0.01 sec)
mysql> use test
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql> select @@version
-> ;
±--------------------+
| @@version |
±--------------------+
| 5.7.25-TiDB-v3.0.20 |
±--------------------+
1 row in set (0.00 sec)
实践是检验真理的唯一标准啊
就是不知道官方的规定了, 会不会即使Tiup可以部署tidb3.0, 上机时候也不让用
同样用tiup安装v3.0.20,在copy files报错,如下:
- Initialize target host environments
- Prepare 192.168.100.126:22 … Done
- Prepare 192.168.100.127:22 … Done
- Prepare 192.168.100.128:22 … Done
- Prepare 192.168.100.121:22 … Done
- Prepare 192.168.100.122:22 … Done
- Prepare 192.168.100.123:22 … Done
- Prepare 192.168.100.124:22 … Done
- Prepare 192.168.100.125:22 … Done
- Prepare 192.168.100.120:22 … Done
- Copy files
- Copy pd -> 192.168.100.126 … Error
- Copy pd -> 192.168.100.127 … Error
- Copy pd -> 192.168.100.128 … Error
- Copy tikv -> 192.168.100.121 … Error
- Copy tikv -> 192.168.100.122 … Error
- Copy tikv -> 192.168.100.123 … Error
- Copy tidb -> 192.168.100.124 … Error
- Copy tidb -> 192.168.100.125 … Error
- Copy prometheus -> 192.168.100.120 … Done
- Copy grafana -> 192.168.100.120 … Done
检查日志,有如下错误信息:
2021-06-10T15:54:20.783+0800 INFO Execute command finished {“code”: 1, “error”: “init config failed: 192.168.100.125:4000: fetch /3.root.json fr
om mirror(https://tiup-mirrors.pingcap.com) failed: download from https://tiup-mirrors.pingcap.com/3.root.json failed: Get https://tiup-mirrors.pingcap.com/3
.root.json: read tcp 192.168.100.120:37454->36.156.94.41:443: read: connection reset by peer: check config failed”, “errorVerbose”: “check config failed\
fet
ch /3.root.json from mirror(https://tiup-mirrors.pingcap.com) failed: download from https://tiup-mirrors.pingcap.com/3.root.json failed: Get https://tiup-mir
rors.pingcap.com/3.root.json: read tcp 192.168.100.120:37454->36.156.94.41:443: read: connection reset by peer\ngithub.com/pingcap/tiup/pkg/cluster/spec.chec
kConfig\
\tgithub.com/pingcap/tiup@/pkg/cluster/spec/server_config.go:250\
github.com/pingcap/tiup/pkg/cluster/spec.(*TiDBInstance).InitConfig\
\tgithub.com/
pingcap/tiup@/pkg/cluster/spec/tidb.go:199\ngithub.com/pingcap/tiup/pkg/cluster/task.(*InitConfig).Execute\
\tgithub.com/pingcap/tiup@/pkg/cluster/task/init_
config.go:49\ngithub.com/pingcap/tiup/pkg/cluster/task.(*Serial).Execute\
\tgithub.com/pingcap/tiup@/pkg/cluster/task/task.go:196\
github.com/pingcap/tiup/pk
g/cluster/task.(*StepDisplay).Execute\
\tgithub.com/pingcap/tiup@/pkg/cluster/task/step.go:85\
github.com/pingcap/tiup/pkg/cluster/task.(*Parallel).Execute.f
unc1\
\tgithub.com/pingcap/tiup@/pkg/cluster/task/task.go:241\
runtime.goexit\
\truntime/asm_amd64.s:1357\
init config failed: 192.168.100.125:4000”}
是的 , 部署不了。
此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。