暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

0100.T 使用TiUP更改TiDB集群名称

rundba 2021-11-20
1100


在这个练习里,我们将集群名由tidb-test 改为tidb-prod,之后改回tidb-test。


1. 使用tiup进行集群名修改,如下所示:


[root@tidb1 ~]# tiup cluster rename tidb-test tidb-prodStarting component `cluster`: /root/.tiup/components/cluster/v1.6.0/tiup-cluster rename tidb-test tidb-prodWill rename the cluster name from tidb-test to tidb-prod.Do you confirm this action? [y/N]:(default=N) y        #输入y继续更改集群名称tidb-test为tidb-prodRename cluster `tidb-test` -> `tidb-prod` successfullyWill reload the cluster tidb-prod with restart policy is true, nodes: , roles: grafana,prometheus.Do you want to continue? [y/N]:(default=N) y          #输入y继续,roles重新加载+ [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/tidb-prod/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/tidb-prod/ssh/id_rsa.pub+ [Parallel] - UserSSH: user=tidb, host=192.168.80.139+ [Parallel] - UserSSH: user=tidb, host=192.168.80.140+ [Parallel] - UserSSH: user=tidb, host=192.168.80.136+ [Parallel] - UserSSH: user=tidb, host=192.168.80.137+ [Parallel] - UserSSH: user=tidb, host=192.168.80.135+ [Parallel] - UserSSH: user=tidb, host=192.168.80.135+ [Parallel] - UserSSH: user=tidb, host=192.168.80.135+ [Parallel] - UserSSH: user=tidb, host=192.168.80.141+ [Parallel] - UserSSH: user=tidb, host=192.168.80.138+ [Parallel] - UserSSH: user=tidb, host=192.168.80.135+ [ Serial ] - UpdateTopology: cluster=tidb-prod+ Refresh instance configs  - Regenerate config pd -> 192.168.80.135:2379 ... Done  - Regenerate config pd -> 192.168.80.136:2379 ... Done  - Regenerate config pd -> 192.168.80.137:2379 ... Done  - Regenerate config tikv -> 192.168.80.138:20160 ... Done  - Regenerate config tikv -> 192.168.80.139:20160 ... Done  - Regenerate config tikv -> 192.168.80.140:20160 ... Done  - Regenerate config tidb -> 192.168.80.141:4000 ... Done  - Regenerate config prometheus -> 192.168.80.135:9090 ... Done  - Regenerate config grafana -> 192.168.80.135:3000 ... Done  - Regenerate config alertmanager -> 192.168.80.135:9093 ... Done+ Refresh monitor configs  - Refresh config node_exporter -> 192.168.80.141 ... Done  - Refresh config node_exporter -> 192.168.80.135 ... Done  - Refresh config node_exporter -> 192.168.80.136 ... Done  - Refresh config node_exporter -> 192.168.80.137 ... Done  - Refresh config node_exporter -> 192.168.80.138 ... Done  - Refresh config node_exporter -> 192.168.80.139 ... Done  - Refresh config node_exporter -> 192.168.80.140 ... Done  - Refresh config blackbox_exporter -> 192.168.80.136 ... Done  - Refresh config blackbox_exporter -> 192.168.80.137 ... Done  - Refresh config blackbox_exporter -> 192.168.80.138 ... Done  - Refresh config blackbox_exporter -> 192.168.80.139 ... Done  - Refresh config blackbox_exporter -> 192.168.80.140 ... Done  - Refresh config blackbox_exporter -> 192.168.80.141 ... Done  - Refresh config blackbox_exporter -> 192.168.80.135 ... Done+ [ Serial ] - UpgradeCluster
Upgrading component prometheus Restarting instance 192.168.80.135:9090 Restart instance 192.168.80.135:9090 successUpgrading component grafana Restarting instance 192.168.80.135:3000 Restart instance 192.168.80.135:3000 successReloaded cluster `tidb-prod` successfully
Found cluster newer version: The latest version: v1.6.1 Local installed version: v1.6.0 Update current component: tiup update cluster Update all components: tiup update --all


2. 查看集群状态,发现集群名已经改为tidb-prod, 如下:


[root@tidb1 ~]# tiup cluster display tidb-prodStarting component `cluster`: /root/.tiup/components/cluster/v1.6.0/tiup-cluster display tidb-prodCluster type:       tidbCluster name:       tidb-prodCluster version:    v5.0.0Deploy user:        tidbSSH type:           builtinDashboard URL:      http://192.168.80.135:2379/dashboardID                   Role          Host           Ports        OS/Arch       Status  Data Dir                      Deploy Dir--                   ----          ----           -----        -------       ------  --------                      ----------192.168.80.135:9093   alertmanager  192.168.80.135  9093/9094    linux/x86_64  Up      /tidb-data/alertmanager-9093  /tidb-deploy/alertmanager-9093192.168.80.135:3000   grafana       192.168.80.135  3000         linux/x86_64  Up      -                             /tidb-deploy/grafana-3000192.168.80.135:2379   pd            192.168.80.135  2379/2380    linux/x86_64  Up|UI   /tidb-data/pd-2379            /tidb-deploy/pd-2379192.168.80.136:2379   pd            192.168.80.136  2379/2380    linux/x86_64  Up      /tidb-data/pd-2379            /tidb-deploy/pd-2379192.168.80.137:2379   pd            192.168.80.137  2379/2380    linux/x86_64  Up|L    /tidb-data/pd-2379            /tidb-deploy/pd-2379192.168.80.135:9090   prometheus    192.168.80.135  9090         linux/x86_64  Up      /tidb-data/prometheus-9090    /tidb-deploy/prometheus-9090192.168.80.141:4000   tidb          192.168.80.141  4000/10080   linux/x86_64  Up      -                             /tidb-deploy/tidb-4000192.168.80.138:20160  tikv          192.168.80.138  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160192.168.80.139:20160  tikv          192.168.80.139  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160192.168.80.140:20160  tikv          192.168.80.140  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160Total nodes: 10
Found cluster newer version: The latest version: v1.6.1 Local installed version: v1.6.0 Update current component: tiup update cluster Update all components: tiup update --all


3. 使用tiup 进行集群名修改,改回tidb-test,如下所示:


[root@tidb1 ~]# tiup cluster rename tidb-prod tidb-testStarting component `cluster`: /root/.tiup/components/cluster/v1.6.0/tiup-cluster rename tidb-prod tidb-testWill rename the cluster name from tidb-prod to tidb-test.Do you confirm this action? [y/N]:(default=N) y        #输入y继续更改集群名称为tidb-testRename cluster `tidb-prod` -> `tidb-test` successfullyWill reload the cluster tidb-test with restart policy is true, nodes: , roles: grafana,prometheus.Do you want to continue? [y/N]:(default=N) y          #输入y继续,roles重新加载+ [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa.pub+ [Parallel] - UserSSH: user=tidb, host=192.168.80.139+ [Parallel] - UserSSH: user=tidb, host=192.168.80.136+ [Parallel] - UserSSH: user=tidb, host=192.168.80.140+ [Parallel] - UserSSH: user=tidb, host=192.168.80.141+ [Parallel] - UserSSH: user=tidb, host=192.168.80.135+ [Parallel] - UserSSH: user=tidb, host=192.168.80.135+ [Parallel] - UserSSH: user=tidb, host=192.168.80.135+ [Parallel] - UserSSH: user=tidb, host=192.168.80.135+ [Parallel] - UserSSH: user=tidb, host=192.168.80.137+ [Parallel] - UserSSH: user=tidb, host=192.168.80.138+ [ Serial ] - UpdateTopology: cluster=tidb-test+ Refresh instance configs  - Regenerate config pd -> 192.168.80.135:2379 ... Done  - Regenerate config pd -> 192.168.80.136:2379 ... Done  - Regenerate config pd -> 192.168.80.137:2379 ... Done  - Regenerate config tikv -> 192.168.80.138:20160 ... Done  - Regenerate config tikv -> 192.168.80.139:20160 ... Done  - Regenerate config tikv -> 192.168.80.140:20160 ... Done  - Regenerate config tidb -> 192.168.80.141:4000 ... Done  - Regenerate config prometheus -> 192.168.80.135:9090 ... Done  - Regenerate config grafana -> 192.168.80.135:3000 ... Done  - Regenerate config alertmanager -> 192.168.80.135:9093 ... Done+ Refresh monitor configs  - Refresh config node_exporter -> 192.168.80.140 ... Done  - Refresh config node_exporter -> 192.168.80.141 ... Done  - Refresh config node_exporter -> 192.168.80.135 ... Done  - Refresh config node_exporter -> 192.168.80.136 ... Done  - Refresh config node_exporter -> 192.168.80.137 ... Done  - Refresh config node_exporter -> 192.168.80.138 ... Done  - Refresh config node_exporter -> 192.168.80.139 ... Done  - Refresh config blackbox_exporter -> 192.168.80.139 ... Done  - Refresh config blackbox_exporter -> 192.168.80.140 ... Done  - Refresh config blackbox_exporter -> 192.168.80.141 ... Done  - Refresh config blackbox_exporter -> 192.168.80.135 ... Done  - Refresh config blackbox_exporter -> 192.168.80.136 ... Done  - Refresh config blackbox_exporter -> 192.168.80.137 ... Done  - Refresh config blackbox_exporter -> 192.168.80.138 ... Done+ [ Serial ] - UpgradeClusterUpgrading component prometheus  Restarting instance 192.168.80.135:9090  Restart instance 192.168.80.135:9090 successUpgrading component grafana  Restarting instance 192.168.80.135:3000  Restart instance 192.168.80.135:3000 successReloaded cluster `tidb-test` successfully
Found cluster newer version: The latest version: v1.6.1 Local installed version: v1.6.0 Update current component: tiup update cluster Update all components: tiup update --all

4. 查看集群状态,发现集群名已经改回tidb-test, 如下所示:



[root@tidb1 ~]# tiup cluster display tidb-testStarting component `cluster`: /root/.tiup/components/cluster/v1.6.0/tiup-cluster display tidb-testCluster type:       tidbCluster name:       tidb-testCluster version:    v5.0.0Deploy user:        tidbSSH type:           builtinDashboard URL:      http://192.168.80.135:2379/dashboardID                   Role          Host           Ports        OS/Arch       Status  Data Dir                      Deploy Dir--                   ----          ----           -----        -------       ------  --------                      ----------192.168.80.135:9093   alertmanager  192.168.80.135  9093/9094    linux/x86_64  Up      /tidb-data/alertmanager-9093  /tidb-deploy/alertmanager-9093192.168.80.135:3000   grafana       192.168.80.135  3000         linux/x86_64  Up      -                             /tidb-deploy/grafana-3000192.168.80.135:2379   pd            192.168.80.135  2379/2380    linux/x86_64  Up|UI   /tidb-data/pd-2379            /tidb-deploy/pd-2379192.168.80.136:2379   pd            192.168.80.136  2379/2380    linux/x86_64  Up      /tidb-data/pd-2379            /tidb-deploy/pd-2379192.168.80.137:2379   pd            192.168.80.137  2379/2380    linux/x86_64  Up|L    /tidb-data/pd-2379            /tidb-deploy/pd-2379192.168.80.135:9090   prometheus    192.168.80.135  9090         linux/x86_64  Up      /tidb-data/prometheus-9090    /tidb-deploy/prometheus-9090192.168.80.141:4000   tidb          192.168.80.141  4000/10080   linux/x86_64  Up      -                             /tidb-deploy/tidb-4000192.168.80.138:20160  tikv          192.168.80.138  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160192.168.80.139:20160  tikv          192.168.80.139  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160192.168.80.140:20160  tikv          192.168.80.140  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160Total nodes: 10
Found cluster newer version: The latest version: v1.6.1 Local installed version: v1.6.0 Update current component: tiup update cluster Update all components: tiup update --all




长按二维码                                    

     加入>>国产DB学习交流群

       

   请注明:来自rundba,申请加入国产DB学习交流群                

             

最后修改时间:2021-11-23 13:18:45
文章转载自rundba,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论