Skip to content

Commit

Permalink
update shell var
Browse files Browse the repository at this point in the history
  • Loading branch information
BinChenn committed Dec 21, 2020
1 parent 7c8dcf4 commit f5b3289
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions en/pause-sync-of-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ Here are some cases where you might need to pause sync of a TiDB cluster in Kube

## Pause sync

1. Execute the following command to edit configuration of TiDB cluster. `${tidb-cluster-name}` represents the name of TiDB cluster, and `${tidb-cluster-namespace}` refers to the TiDB cluster namespace.
1. Execute the following command to edit configuration of TiDB cluster. `${cluster_name}` represents the name of TiDB cluster, and `${namespace}` refers to the TiDB cluster namespace.

{{< copyable "shell-regular" >}}

```shell
kubectl apply -f ${tidb-cluster-name} -n ${tidb-cluster-namespace}
kubectl edit -f ${cluster_name} -n ${namespace}
```

2. Configure the TidbCluster CR with `spec.paused: true` as following, save changes and exit editor, sync of TiDB cluster's components (PD, TiKV, TiDB, TiFlash, TiCDC,Pump) will be paused.
Expand All @@ -57,12 +57,12 @@ Here are some cases where you might need to pause sync of a TiDB cluster in Kube
...
```
3. Execute the following command to confirm the sync status of a TiDB cluster. `${controller-pod-name}` is the name of Controller Pod, and `${tidb-operator-namespace}` is the namespace of TiDB Operator.
3. Execute the following command to confirm the sync status of a TiDB cluster. `${pod_name}` is the name of Controller Pod, and `${namespace}` is the namespace of TiDB Operator.
{{< copyable "shell-regular" >}}
```shell
kubectl logs ${controller-pod-name} -n `${tidb-operator-namespace}` | grep paused
kubectl logs ${pod_name} -n `${namespace}` | grep paused
```
The expected output is as follows. The sync of all components in the TiDB cluster is paused.
Expand All @@ -82,12 +82,12 @@ Here are some cases where you might need to pause sync of a TiDB cluster in Kube
If you want to resume the sync of the TiDB cluster, configure the TidbCluster CR with `spec.paused: false`.
1. Execute the following command to edit configuration of TiDB cluster. `${tidb-cluster-name}` represents the name of TiDB cluster, and `${tidb-cluster-namespace}` refers to the TiDB cluster namespace.
1. Execute the following command to edit configuration of TiDB cluster. `${cluster_name}` represents the name of TiDB cluster, and `${namespace}` refers to the TiDB cluster namespace.
{{< copyable "shell-regular" >}}
```shell
kubectl apply -f ${tidb-cluster-name} -n ${tidb-cluster-namespace}
kubectl edit -f ${cluster_name} -n ${namespace}
```
2. Configure the TidbCluster CR with `spec.paused: false` as following, save changes and exit editor, sync of TiDB cluster's components (PD, TiKV, TiDB, TiFlash, TiCDC,Pump) will be resumed.
Expand All @@ -110,12 +110,12 @@ If you want to resume the sync of the TiDB cluster, configure the TidbCluster CR
...
```

3. After resuming sync of the TiDB cluster, execute the following command to confirm sync status of the TiDB cluster. `${controller-pod-name}` represents the name of Controller Pod, `${tidb-operator-namespace}` represents the namespace of TiDB Operator.
3. After resuming sync of the TiDB cluster, execute the following command to confirm sync status of the TiDB cluster. `${pod_name}` represents the name of Controller Pod, `${namespace}` represents the namespace of TiDB Operator.

{{< copyable "shell-regular" >}}

```shell
kubectl logs ${controller-pod-name} -n `${tidb-operator-namespace}` | grep "Finished syncing TidbCluster"
kubectl logs ${pod_name} -n `${namespace}` | grep "Finished syncing TidbCluster"
```

The expected output is as follows. The `finished syncing` timestamp is later than the `pausing` timestamp, which indicates that sync of the TiDB cluster has been resumed.
Expand Down
18 changes: 9 additions & 9 deletions zh/pause-sync-of-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ summary: 介绍如何暂停同步 Kubernetes 上的 TiDB 集群

## 暂停同步 TiDB 集群

1. 使用以下命令修改集群配置,其中 `${tidb-cluster-name}` 表示 TiDB 集群名称, `${tidb-cluster-namespace}` 表示 TiDB 集群所在的 namespace。
1. 使用以下命令修改集群配置,其中 `${cluster_name}` 表示 TiDB 集群名称, `${namespace}` 表示 TiDB 集群所在的 namespace。

{{< copyable "shell-regular" >}}

```shell
kubectl edit tc/${tidb-cluster-name} -n ${tidb-cluster-namespace} --save-config
kubectl edit tc/`${cluster_name}` -n ${namespace}
```

2. 在 TidbCluster CR 中以如下方式配置 `spec.paused: true`,保存配置并退出编辑器。TiDB 集群各组件 (PD、TiKV、TiDB、TiFlash、TiCDC、Pump) 的同步过程将会被暂停。
Expand All @@ -57,15 +57,15 @@ summary: 介绍如何暂停同步 Kubernetes 上的 TiDB 集群
...
```

3. TiDB 集群同步暂停后,可以使用以下命令查看 Controller Pod 日志确认 TiDB 集群同步状态。其中 `${controller-pod-name}` 表示 Controller Pod 的名称,`${tidb-operator-namespace}` 表示 TiDB Operator 所在的 namespace。
3. TiDB 集群同步暂停后,可以使用以下命令查看 Controller Pod 日志确认 TiDB 集群同步状态。其中 `${pod_name}` 表示 Controller Pod 的名称,`${namespace}` 表示 TiDB Operator 所在的 namespace。

{{< copyable "shell-regular" >}}

```shell
kubectl logs ${controller-pod-name} -n `${tidb-operator-namespace}` | grep paused
kubectl logs ${pod_name} -n `${namespace}` | grep paused
```

输出类似下方结果则表示 TiDB 集群同步已经暂停,可见 TiDB 集群各组件的同步已经被暂停
输出类似下方结果则表示 TiDB 集群同步已经暂停。

```
I1207 11:09:59.029949 1 pd_member_manager.go:92] tidb cluster default/basic is paused, skip syncing for pd service
Expand All @@ -82,12 +82,12 @@ summary: 介绍如何暂停同步 Kubernetes 上的 TiDB 集群

如果想要恢复 TiDB 集群的同步,可以在 TidbCluster CR 中配置 `spec.paused: false`,恢复同步 TiDB 集群。

1. 使用以下命令修改集群配置,其中 `${tidb-cluster-name}` 表示 TiDB 集群名称, `${tidb-cluster-namespace}` 表示 TiDB 集群所在的 namespace。
1. 使用以下命令修改集群配置,其中 `${cluster_name}` 表示 TiDB 集群名称, `${namespace}` 表示 TiDB 集群所在的 namespace。

{{< copyable "shell-regular" >}}

```shell
kubectl edit tc/${tidb-cluster-name} -n ${tidb-cluster-namespace} --save-config
kubectl edit tc/${cluster_name} -n ${namespace}
```

2. 在 TidbCluster CR 中以如下方式配置 `spec.paused: false`,保存配置并退出编辑器。TiDB 集群各组件 (PD、TiKV、TiDB、TiFlash、TiCDC、Pump) 的同步过程将会被恢复。
Expand All @@ -110,12 +110,12 @@ summary: 介绍如何暂停同步 Kubernetes 上的 TiDB 集群
...
```

3. 恢复 TiDB 集群同步后,可以使用以下命令查看 Controller Pod 日志确认 TiDB 集群同步状态。其中 `${controller-pod-name}` 表示 Controller Pod 的名称,`${tidb-operator-namespace}` 表示 TiDB Operator 所在的 namespace。
3. 恢复 TiDB 集群同步后,可以使用以下命令查看 Controller Pod 日志确认 TiDB 集群同步状态。其中 `${pod_name}` 表示 Controller Pod 的名称,`${namespace}` 表示 TiDB Operator 所在的 namespace。

{{< copyable "shell-regular" >}}

```shell
kubectl logs ${controller-pod-name} -n `${tidb-operator-namespace}` | grep "Finished syncing TidbCluster"
kubectl logs ${pod_name} -n `${namespace}` | grep "Finished syncing TidbCluster"
```

输出类似下方结果,可以看到同步成功时间戳大于暂停同步日志中显示的时间戳,表示 TiDB 集群同步已经被恢复。
Expand Down

0 comments on commit f5b3289

Please sign in to comment.