From a84a1a20d321f8e31b615bc3e498e3d631c1a2f6 Mon Sep 17 00:00:00 2001 From: weekface Date: Mon, 12 Aug 2019 19:46:14 +0800 Subject: [PATCH 1/4] fix `extraLabels` description --- .../configuration/tidb-in-kubernetes/cluster-configuration.md | 2 +- .../configuration/tidb-in-kubernetes/cluster-configuration.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/reference/configuration/tidb-in-kubernetes/cluster-configuration.md b/dev/reference/configuration/tidb-in-kubernetes/cluster-configuration.md index 2afaea47fa90..b218ae8748ee 100644 --- a/dev/reference/configuration/tidb-in-kubernetes/cluster-configuration.md +++ b/dev/reference/configuration/tidb-in-kubernetes/cluster-configuration.md @@ -19,7 +19,7 @@ TiDB Operator 使用 Helm 部署和管理 TiDB 集群。通过 Helm 获取的配 | :----- | :---- | :----- | | `rbac.create` | 是否启用 Kubernetes 的 RBAC | `true` | | `clusterName` | TiDB 集群名,默认不设置该变量,`tidb-cluster` 会直接用执行安装时的 `ReleaseName` 代替 | `nil` | -| `extraLabels` | TiDB 集群附加的自定义标签 参考:[labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | `{}` | +| `extraLabels` | 添加额外的 labels 到 TidbCluster 对象(CRD)上, 参考:[labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | `{}` | | `schedulerName` | TiDB 集群使用的调度器 | `tidb-scheduler` | | `timezone` | TiDB 集群默认时区 | `UTC` | | `pvReclaimPolicy` | TiDB 集群使用的 PV (Persistent Volume)的 reclaim policy | `Retain` | diff --git a/v3.0/reference/configuration/tidb-in-kubernetes/cluster-configuration.md b/v3.0/reference/configuration/tidb-in-kubernetes/cluster-configuration.md index 2afaea47fa90..b218ae8748ee 100644 --- a/v3.0/reference/configuration/tidb-in-kubernetes/cluster-configuration.md +++ b/v3.0/reference/configuration/tidb-in-kubernetes/cluster-configuration.md @@ -19,7 +19,7 @@ TiDB Operator 使用 Helm 部署和管理 TiDB 集群。通过 Helm 获取的配 | :----- | :---- | :----- | | `rbac.create` | 是否启用 Kubernetes 的 RBAC | `true` | | `clusterName` | TiDB 集群名,默认不设置该变量,`tidb-cluster` 会直接用执行安装时的 `ReleaseName` 代替 | `nil` | -| `extraLabels` | TiDB 集群附加的自定义标签 参考:[labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | `{}` | +| `extraLabels` | 添加额外的 labels 到 TidbCluster 对象(CRD)上, 参考:[labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) | `{}` | | `schedulerName` | TiDB 集群使用的调度器 | `tidb-scheduler` | | `timezone` | TiDB 集群默认时区 | `UTC` | | `pvReclaimPolicy` | TiDB 集群使用的 PV (Persistent Volume)的 reclaim policy | `Retain` | From d020cf379f4670a3a9caab42ac4ff19a9c8ae4ba Mon Sep 17 00:00:00 2001 From: weekface Date: Wed, 14 Aug 2019 14:07:01 +0800 Subject: [PATCH 2/4] add pump offline document --- .../maintain/backup-and-restore.md | 34 +++++++++++++++++++ .../maintain/backup-and-restore.md | 34 +++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/dev/tidb-in-kubernetes/maintain/backup-and-restore.md b/dev/tidb-in-kubernetes/maintain/backup-and-restore.md index 4159584630bc..c835920cfe60 100644 --- a/dev/tidb-in-kubernetes/maintain/backup-and-restore.md +++ b/dev/tidb-in-kubernetes/maintain/backup-and-restore.md @@ -136,3 +136,37 @@ kubectl get pvc -n -l app.kubernetes.io/component=backup,pingcap.com * PV:默认的下游存储,这种情况下,你可以考虑为 `drainer` 配置更大的 PV 空间(通过修改 `binlog.drainer.storage` 配置); * 兼容 MySQL 协议的数据库:通过设置 `binlog.drainer.destDBType` 为 `mysql` 来开启,你必须同时在 `binlog.drainer.mysql` 中配置目标数据库的地址和认证信息; * Apache Kafka:通过设置 `binlog.drainer.destDBType` 为 `kafka` 来开启,你必须同时在 `binlog.drainer.kafka` 中配置目标集群的 Zookeeper 地址和 Kafka 地址。 + +### Pump 缩容 + +缩容 Pump 需要挨个先将 Pump 节点从集群中下线之后操作 `helm upgrade` 进行缩容。 + +1. 下线 Pump 节点: + + 假设现在有 3 个 Pump 节点,我们需要下线第 3 个 Pump 节点,将 `` 替换成 `2`,操作方式是: + + {{< copyable "shell-regular" >}} + + ```shell + kubectl run offline-pump- --image=pingcap/tidb-binlog: --namespace= --restart=OnFailure -- /binlogctl -pd-urls=http://-pd:2379 -cmd offline-pump -node-id -pump-:8250 + ``` + + `` 为当前 TiDB 的版本。 + + 然后查看 Pump 的日志输出,确认输出 `pump offline, please delete my pod` 后即可确认该节点已经成功下线。 + + {{< copyable "shell-regular" >}} + + ```shell + kubectl logs -f -n -pump- + ``` + +2. 缩容 Pump: + + 修改 `values.yaml` 文件中 `binlog.pump.replicas` 为 `2`,然后执行缩容操作: + + {{< copyable "shell-regular" >}} + + ```shell + helm upgrade pingcap/tidb-cluster -f values.yaml --version= + ``` diff --git a/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md b/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md index 5b7f68e88d69..35bde66ff63c 100644 --- a/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md +++ b/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md @@ -137,3 +137,37 @@ kubectl get pvc -n -l app.kubernetes.io/component=backup,pingcap.com * PV:默认的下游存储,这种情况下,你可以考虑为 `drainer` 配置更大的 PV 空间(通过修改 `binlog.drainer.storage` 配置); * 兼容 MySQL 协议的数据库:通过设置 `binlog.drainer.destDBType` 为 `mysql` 来开启,你必须同时在 `binlog.drainer.mysql` 中配置目标数据库的地址和认证信息; * Apache Kafka:通过设置 `binlog.drainer.destDBType` 为 `kafka` 来开启,你必须同时在 `binlog.drainer.kafka` 中配置目标集群的 Zookeeper 地址和 Kafka 地址。 + +### Pump 缩容 + +缩容 Pump 需要挨个先将 Pump 节点从集群中下线之后操作 `helm upgrade` 进行缩容。 + +1. 下线 Pump 节点: + + 假设现在有 3 个 Pump 节点,我们需要下线第 3 个 Pump 节点,将 `` 替换成 `2`,操作方式是: + + {{< copyable "shell-regular" >}} + + ```shell + kubectl run offline-pump- --image=pingcap/tidb-binlog: --namespace= --restart=OnFailure -- /binlogctl -pd-urls=http://-pd:2379 -cmd offline-pump -node-id -pump-:8250 + ``` + + `` 为当前 TiDB 的版本。 + + 然后查看 Pump 的日志输出,确认输出 `pump offline, please delete my pod` 后即可确认该节点已经成功下线。 + + {{< copyable "shell-regular" >}} + + ```shell + kubectl logs -f -n -pump- + ``` + +2. 缩容 Pump: + + 修改 `values.yaml` 文件中 `binlog.pump.replicas` 为 `2`,然后执行缩容操作: + + {{< copyable "shell-regular" >}} + + ```shell + helm upgrade pingcap/tidb-cluster -f values.yaml --version= + ``` From 1b4a3e366840949887dab0f3a2ead79bb5bb6571 Mon Sep 17 00:00:00 2001 From: yikeke Date: Tue, 20 Aug 2019 11:58:52 +0900 Subject: [PATCH 3/4] remove trailing spaces to fix CI --- .../maintain/backup-and-restore.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dev/tidb-in-kubernetes/maintain/backup-and-restore.md b/dev/tidb-in-kubernetes/maintain/backup-and-restore.md index c835920cfe60..a2e8415d54c1 100644 --- a/dev/tidb-in-kubernetes/maintain/backup-and-restore.md +++ b/dev/tidb-in-kubernetes/maintain/backup-and-restore.md @@ -144,19 +144,19 @@ kubectl get pvc -n -l app.kubernetes.io/component=backup,pingcap.com 1. 下线 Pump 节点: 假设现在有 3 个 Pump 节点,我们需要下线第 3 个 Pump 节点,将 `` 替换成 `2`,操作方式是: - + {{< copyable "shell-regular" >}} - + ```shell kubectl run offline-pump- --image=pingcap/tidb-binlog: --namespace= --restart=OnFailure -- /binlogctl -pd-urls=http://-pd:2379 -cmd offline-pump -node-id -pump-:8250 ``` - + `` 为当前 TiDB 的版本。 - + 然后查看 Pump 的日志输出,确认输出 `pump offline, please delete my pod` 后即可确认该节点已经成功下线。 - + {{< copyable "shell-regular" >}} - + ```shell kubectl logs -f -n -pump- ``` @@ -164,9 +164,9 @@ kubectl get pvc -n -l app.kubernetes.io/component=backup,pingcap.com 2. 缩容 Pump: 修改 `values.yaml` 文件中 `binlog.pump.replicas` 为 `2`,然后执行缩容操作: - + {{< copyable "shell-regular" >}} - + ```shell helm upgrade pingcap/tidb-cluster -f values.yaml --version= ``` From 31ad451217ddba005fda00988d61a6b1b1197f7f Mon Sep 17 00:00:00 2001 From: yikeke Date: Tue, 20 Aug 2019 12:05:32 +0900 Subject: [PATCH 4/4] remove trailing spaces in v3.0 --- .../maintain/backup-and-restore.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md b/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md index 35bde66ff63c..0822bfd802f2 100644 --- a/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md +++ b/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md @@ -145,19 +145,19 @@ kubectl get pvc -n -l app.kubernetes.io/component=backup,pingcap.com 1. 下线 Pump 节点: 假设现在有 3 个 Pump 节点,我们需要下线第 3 个 Pump 节点,将 `` 替换成 `2`,操作方式是: - + {{< copyable "shell-regular" >}} - + ```shell kubectl run offline-pump- --image=pingcap/tidb-binlog: --namespace= --restart=OnFailure -- /binlogctl -pd-urls=http://-pd:2379 -cmd offline-pump -node-id -pump-:8250 ``` - + `` 为当前 TiDB 的版本。 - + 然后查看 Pump 的日志输出,确认输出 `pump offline, please delete my pod` 后即可确认该节点已经成功下线。 - + {{< copyable "shell-regular" >}} - + ```shell kubectl logs -f -n -pump- ``` @@ -165,9 +165,9 @@ kubectl get pvc -n -l app.kubernetes.io/component=backup,pingcap.com 2. 缩容 Pump: 修改 `values.yaml` 文件中 `binlog.pump.replicas` 为 `2`,然后执行缩容操作: - + {{< copyable "shell-regular" >}} - + ```shell helm upgrade pingcap/tidb-cluster -f values.yaml --version= ```