当前位置:网站首页>Upgrade tidb operator
Upgrade tidb operator
2022-07-06 08:02:00 【Tianxiang shop】
This article describes how to upgrade TiDB Operator To the specified version . You can choose Online upgrade or Offline upgrade .
Upgrade considerations
If you use v1.3.0-beta.1 And earlier versions of TiDB Operator Span Kubernetes Cluster deployment TiDB colony , Upgrade directly TiDB Operator It will cause the cluster to roll update and enter an abnormal state . If upgrading from an earlier version TiDB Operator To v1.3, You need to do the following :
- to update CRD.
- modify TidbCluster The definition will
spec.acrossK8sField set totrue. - upgrade TiDB Operator.
Abandoning Pod
ValidatingWebhookandMutatingWebhook. If you use v1.2 And earlier versions of TiDB Operator Deployed in the cluster Webhook, And enabled PodValidatingWebhookandMutatingWebhook, upgrade TiDB Operator To v1.3.0-beta.1 And later ,PodValidatingWebhookandMutatingWebhookBe deleted , But it won't be right TiDB Cluster management has an impact , It will not affect the running TiDB colony .
Online upgrade
If the server can access the Internet , You can follow these steps to upgrade online TiDB Operator:
upgrade TiDB Operator front , Make sure Helm repo Include what you need to upgrade TiDB Operator edition . Check... With the following command Helm repo Contains TiDB Operator edition :
helm search repo -l tidb-operatorIf the output does not contain the new version you need , have access to
helm repo updateThe command to update repo. Please refer to To configure Helm repo.to update Kubernetes Of CustomResourceDefinition (CRD). About CRD For more information , see also CustomResourceDefinition.
If Kubernetes Version greater than or equal to 1.16:
If TiDB Operator from v1.2.x And earlier versions to v1.3.x And later versions , You need to execute the following command to create the newly added TidbNGMonitoring CRD. If it is v1.3.x And later versions TiDB Operator upgrade , But skip this step .
kubectl create -f https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd/v1/pingcap.com_tidbngmonitorings.yamlto update CRD.
kubectl replace -f https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd.yaml && \ kubectl get crd tidbclusters.pingcap.com
If Kubernetes Version less than 1.16:
If TiDB Operator from v1.2.x And earlier versions to v1.3.x And later versions , You need to execute the following command to create the newly added TidbNGMonitoring CRD. If it is v1.3.x And later versions TiDB Operator upgrade , But skip this step .
kubectl create -f https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd/v1beta1/pingcap.com_tidbngmonitorings.yamlto update CRD.
kubectl replace -f https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd_v1beta1.yaml && \ kubectl get crd tidbclusters.pingcap.com
This article takes TiDB Operator v1.3.5 For example , You need to replace
${operator_version}For the one you want to upgrade to TiDB Operator edition .Get what you want to upgrade
tidb-operatorchart Mediumvalues.yamlfile :mkdir -p ${HOME}/tidb-operator/v1.3.5 && \ helm inspect values pingcap/tidb-operator --version=v1.3.5 > ${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yamlmodify
${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yamlinoperatorImageThe image version is the version to be upgraded .If you are in the old version
values.yamlCustom configuration is set in , Merge custom configurations into${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yamlin .Perform upgrade :
helm upgrade tidb-operator pingcap/tidb-operator --version=v1.3.5 -f ${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yamlPod After all normal starts , Run the following command to confirm TiDB Operator Mirror version :
kubectl get po -n tidb-admin -l app.kubernetes.io/instance=tidb-operator -o yaml | grep 'image:.*operator:'If the output is similar to the result below , It means that the upgrade is successful . among ,
v1.3.5Indicates the version number upgraded to .image: pingcap/tidb-operator:v1.3.5 image: docker.io/pingcap/tidb-operator:v1.3.5 image: pingcap/tidb-operator:v1.3.5 image: docker.io/pingcap/tidb-operator:v1.3.5Be careful
TiDB Operator After the upgrade , all TiDB In the cluster
discoveryDeployment Will be automatically upgraded to the corresponding TiDB Operator edition .
Offline upgrade
If the server is not connected to the Internet , You can follow the following steps to upgrade offline TiDB Operator:
Use a machine with an Internet , Download the files and images required for the upgrade .
download TiDB Operator Needed
crd.yamlfile . About CRD For more information , see also CustomResourceDefinition.If Kubernetes Version greater than or equal to 1.16:
wget -O crd.yaml https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd.yamlIf Kubernetes Version less than 1.16:
wget -O crd.yaml https://raw.githubusercontent.com/pingcap/tidb-operator/${operator_version}/manifests/crd_v1beta1.yaml
This article takes TiDB Operator v1.3.5 For example , You need to replace
${operator_version}For the one you want to upgrade to TiDB Operator edition .download
tidb-operatorchart Package file :wget http://charts.pingcap.org/tidb-operator-v1.3.5.tgzdownload TiDB Operator Upgrade required Docker Mirror image :
docker pull pingcap/tidb-operator:v1.3.5 docker pull pingcap/tidb-backup-manager:v1.3.5 docker save -o tidb-operator-v1.3.5.tar pingcap/tidb-operator:v1.3.5 docker save -o tidb-backup-manager-v1.3.5.tar pingcap/tidb-backup-manager:v1.3.5
Upload the downloaded files and images to the server that needs to be upgraded , Follow the steps below to install on the server :
If TiDB Operator from v1.2.x And earlier versions to v1.3.x And later versions , You need to execute the following command to create the newly added TidbNGMonitoring CRD. If it is v1.3.x And later versions TiDB Operator upgrade , But skip this step .
kubectl create -f ./crd.yamlFor others CRD, When executing this command, it will report "AlreadyExists" Error of , You can ignore this error .
upgrade TiDB Operator Needed
crd.yamlfile :kubectl replace -f ./crd.yamldecompression
tidb-operatorchart Package file , And copyvalues.yamlFile to upgrade directory :tar zxvf tidb-operator-v1.3.5.tgz && \ mkdir -p ${HOME}/tidb-operator/v1.3.5 && \ cp tidb-operator/values.yaml ${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yamlinstall Docker Mirror to server :
docker load -i tidb-operator-v1.3.5.tar && \ docker load -i tidb-backup-manager-v1.3.5.tar
modify
${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yamlinoperatorImageThe image version is the version to be upgraded .If you are in the old version
values.yamlCustom configuration is set in , Merge custom configurations into${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yamlin .Perform upgrade :
helm upgrade tidb-operator ./tidb-operator --version=v1.3.5 -f ${HOME}/tidb-operator/v1.3.5/values-tidb-operator.yamlPod After all normal starts , Run the following command to confirm TiDB Operator Mirror version :
kubectl get po -n tidb-admin -l app.kubernetes.io/instance=tidb-operator -o yaml | grep 'image:.*operator:'If the output is similar to the result below , It means that the upgrade is successful . among ,
v1.3.5Indicates the version number upgraded to .image: pingcap/tidb-operator:v1.3.5 image: docker.io/pingcap/tidb-operator:v1.3.5 image: pingcap/tidb-operator:v1.3.5 image: docker.io/pingcap/tidb-operator:v1.3.5Be careful
TiDB Operator After the upgrade , all TiDB In the cluster
discoveryDeployment Will be automatically upgraded to the corresponding TiDB Operator edition .
边栏推荐
- MFC sends left click, double click, and right click messages to list controls
- Introduction to number theory (greatest common divisor, prime sieve, inverse element)
- 面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读
- 软件开发的一点随记
- 链表面试题(图文详解)
- Linked list interview questions (Graphic explanation)
- Transformer principle and code elaboration
- 22. Empty the table
- 让学指针变得更简单(三)
- 从 SQL 文件迁移数据到 TiDB
猜你喜欢

Parameter self-tuning of relay feedback PID controller

861. Score after flipping the matrix

面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读

Hcip day 16
![[research materials] 2021 live broadcast annual data report of e-commerce - Download attached](/img/a6/74da2f44c7b6b22fed2f8e41a55988.jpg)
[research materials] 2021 live broadcast annual data report of e-commerce - Download attached

在 uniapp 中使用阿里图标

23. Update data
![[t31zl intelligent video application processor data]](/img/67/b77c1de990d9b8868f8df5e55b0227.png)
[t31zl intelligent video application processor data]

Make learning pointer easier (3)

A Closer Look at How Fine-tuning Changes BERT
随机推荐
"Friendship and righteousness" of the center for national economy and information technology: China's friendship wine - the "unparalleled loyalty and righteousness" of the solidarity group released th
1204 character deletion operation (2)
CAD ARX gets the current viewport settings
Parameter self-tuning of relay feedback PID controller
The State Economic Information Center "APEC industry +" Western Silicon Valley will invest 2trillion yuan in Chengdu Chongqing economic circle, which will surpass the observation of Shanghai | stable
Data governance: misunderstanding sorting
Vit (vision transformer) principle and code elaboration
shu mei pai
What are the ways to download network pictures with PHP
"Designer universe": "benefit dimension" APEC public welfare + 2022 the latest slogan and the new platform will be launched soon | Asia Pacific Financial Media
[research materials] 2021 live broadcast annual data report of e-commerce - Download attached
On why we should program for all
"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa
Learn Arduino with examples
让学指针变得更简单(三)
Type of data in energy dashboard
升级 TiDB Operator
图像融合--挑战、机遇与对策
灰度升级 TiDB Operator
软件开发的一点随记