Wsl上tidb的单机部署

待补充

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
[root@thinkpadx1-jy ~]# tiup cluster deploy tidbtest v7.1.1 ./topo.yaml --user root -p
tiup is checking updates for component cluster ...
Starting component `cluster`: /root/.tiup/components/cluster/v1.13.1/tiup-cluster deploy tidbtest v7.1.1 ./topo.yaml --user root -p
Input SSH password:

+ Detect CPU Arch Name
  - Detecting node 172.22.74.84 Arch info ... Done

+ Detect CPU OS Name
  - Detecting node 172.22.74.84 OS info ... Done
Please confirm your topology:
Cluster type:    tidb
Cluster name:    tidbtest
Cluster version: v7.1.1
Role        Host          Ports                            OS/Arch       Directories
----        ----          -----                            -------       -----------
pd          172.22.74.84  2379/2380                        linux/x86_64  /tidb-deploy/pd-2379,/tidb-data/pd-2379
tikv        172.22.74.84  20160/20180                      linux/x86_64  /tidb-deploy/tikv-20160,/tidb-data/tikv-20160
tikv        172.22.74.84  20161/20181                      linux/x86_64  /tidb-deploy/tikv-20161,/tidb-data/tikv-20161
tikv        172.22.74.84  20162/20182                      linux/x86_64  /tidb-deploy/tikv-20162,/tidb-data/tikv-20162
tidb        172.22.74.84  4000/10080                       linux/x86_64  /tidb-deploy/tidb-4000
tiflash     172.22.74.84  9000/8123/3930/20170/20292/8234  linux/x86_64  /tidb-deploy/tiflash-9000,/tidb-data/tiflash-9000
prometheus  172.22.74.84  9090/12020                       linux/x86_64  /tidb-deploy/prometheus-9090,/tidb-data/prometheus-9090
grafana     172.22.74.84  3000                             linux/x86_64  /tidb-deploy/grafana-3000
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]: (default=N) y
+ Generate SSH keys ... Done
+ Download TiDB components
  - Download pd:v7.1.1 (linux/amd64) ... Done
  - Download tikv:v7.1.1 (linux/amd64) ... Done
  - Download tidb:v7.1.1 (linux/amd64) ... Done
  - Download tiflash:v7.1.1 (linux/amd64) ... Done
  - Download prometheus:v7.1.1 (linux/amd64) ... Done
  - Download grafana:v7.1.1 (linux/amd64) ... Done
  - Download node_exporter: (linux/amd64) ... Done
  - Download blackbox_exporter: (linux/amd64) ... Done
+ Initialize target host environments
  - Prepare 172.22.74.84:22 ... Done
+ Deploy TiDB instance
  - Copy pd -> 172.22.74.84 ... Done                                                                                      - Copy tikv -> 172.22.74.84 ... Done                                                                                    - Copy tikv -> 172.22.74.84 ... Done                                                                                    - Copy tikv -> 172.22.74.84 ... Done                                                                                    - Copy tidb -> 172.22.74.84 ... Done                                                                                    - Copy tiflash -> 172.22.74.84 ... Done                                                                                 - Copy prometheus -> 172.22.74.84 ... Done                                                                              - Copy grafana -> 172.22.74.84 ... Done                                                                                 - Deploy node_exporter -> 172.22.74.84 ... Done                                                                         - Deploy blackbox_exporter -> 172.22.74.84 ... Done
+ Copy certificate to remote host
+ Init instance configs
  - Generate config pd -> 172.22.74.84:2379 ... Done                                                                      - Generate config tikv -> 172.22.74.84:20160 ... Done                                                                   - Generate config tikv -> 172.22.74.84:20161 ... Done                                                                   - Generate config tikv -> 172.22.74.84:20162 ... Done                                                                   - Generate config tidb -> 172.22.74.84:4000 ... Done                                                                    - Generate config tiflash -> 172.22.74.84:9000 ... Done                                                                 - Generate config prometheus -> 172.22.74.84:9090 ... Done                                                              - Generate config grafana -> 172.22.74.84:3000 ... Done
+ Init monitor configs
  - Generate config node_exporter -> 172.22.74.84 ... Done                                                                - Generate config blackbox_exporter -> 172.22.74.84 ... Done                                                          Enabling component pd
        Enabling instance 172.22.74.84:2379
        Enable instance 172.22.74.84:2379 success
Enabling component tikv
        Enabling instance 172.22.74.84:20162
        Enabling instance 172.22.74.84:20160
        Enabling instance 172.22.74.84:20161
        Enable instance 172.22.74.84:20162 success
        Enable instance 172.22.74.84:20161 success
        Enable instance 172.22.74.84:20160 success
Enabling component tidb
        Enabling instance 172.22.74.84:4000
        Enable instance 172.22.74.84:4000 success
Enabling component tiflash
        Enabling instance 172.22.74.84:9000
        Enable instance 172.22.74.84:9000 success
Enabling component prometheus
        Enabling instance 172.22.74.84:9090
        Enable instance 172.22.74.84:9090 success
Enabling component grafana
        Enabling instance 172.22.74.84:3000
        Enable instance 172.22.74.84:3000 success
Enabling component node_exporter
        Enabling instance 172.22.74.84
        Enable 172.22.74.84 success
Enabling component blackbox_exporter
        Enabling instance 172.22.74.84
        Enable 172.22.74.84 success
Cluster `tidbtest` deployed successfully, you can start it with command: `tiup cluster start tidbtest --init`
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[root@thinkpadx1-jy ~]# tiup cluster start tidbtest --init
tiup is checking updates for component cluster ...
Starting component `cluster`: /root/.tiup/components/cluster/v1.13.1/tiup-cluster start tidbtest --init
Starting cluster tidbtest...
+ [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/tidbtest/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/tidbtest/ssh/id_rsa.pub
+ [Parallel] - UserSSH: user=tidb, host=172.22.74.84
+ [Parallel] - UserSSH: user=tidb, host=172.22.74.84
+ [Parallel] - UserSSH: user=tidb, host=172.22.74.84
+ [Parallel] - UserSSH: user=tidb, host=172.22.74.84
+ [Parallel] - UserSSH: user=tidb, host=172.22.74.84
+ [Parallel] - UserSSH: user=tidb, host=172.22.74.84
+ [Parallel] - UserSSH: user=tidb, host=172.22.74.84
+ [Parallel] - UserSSH: user=tidb, host=172.22.74.84
+ [ Serial ] - StartCluster
Starting component pd
        Starting instance 172.22.74.84:2379
        Start instance 172.22.74.84:2379 success
Starting component tikv
        Starting instance 172.22.74.84:20162
        Starting instance 172.22.74.84:20160
        Starting instance 172.22.74.84:20161
        Start instance 172.22.74.84:20160 success
        Start instance 172.22.74.84:20162 success
        Start instance 172.22.74.84:20161 success
Starting component tidb
        Starting instance 172.22.74.84:4000
        Start instance 172.22.74.84:4000 success
Starting component tiflash
        Starting instance 172.22.74.84:9000
        Start instance 172.22.74.84:9000 success
Starting component prometheus
        Starting instance 172.22.74.84:9090
        Start instance 172.22.74.84:9090 success
Starting component grafana
        Starting instance 172.22.74.84:3000
        Start instance 172.22.74.84:3000 success
Starting component node_exporter
        Starting instance 172.22.74.84
        Start 172.22.74.84 success
Starting component blackbox_exporter
        Starting instance 172.22.74.84
        Start 172.22.74.84 success
+ [ Serial ] - UpdateTopology: cluster=tidbtest
Started cluster `tidbtest` successfully
The root password of TiDB database has been changed.
The new password is: 'H-LC*_y69D81R+rp34'.
Copy and record it to somewhere safe, it is only displayed once, and will not be stored.
The generated password can NOT be get and shown again.
1
2
mysql -h 172.22.74.84 -P 4000 -u root -p
alter user root identified by 'Root~123';
updatedupdated2023-11-052023-11-05