Skip to content

Commit

Permalink
en: add ticdc doc (pingcap#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
ran-huang authored May 28, 2020
1 parent 923133f commit 52a4d3f
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 2 deletions.
1 change: 1 addition & 0 deletions en/TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- [Initialize TiDB Cluster](initialize-a-cluster.md)
- [Access TiDB Cluster](access-tidb.md)
- [Deploy TiFlash](deploy-tiflash.md)
- [Deploy TiCDC](deploy-ticdc.md)
- [Deploy TiDB Binlog](deploy-tidb-binlog.md)
+ Deploy Monitoring
- [Monitor Kubernetes and TiDB Cluster](monitor-a-tidb-cluster.md)
Expand Down
24 changes: 23 additions & 1 deletion en/configure-cluster-using-tidbcluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ category: how-to

# Configure a TiDB Cluster Using TidbCluster

This document introduces how to configure the parameters of TiDB/TiKV/PD/TiFlash using TidbCluster.
This document introduces how to configure the parameters of TiDB/TiKV/PD/TiFlash/TiCDC using TidbCluster.

The current TiDB Operator v1.1 supports all parameters of TiDB v3.1. For parameters of different components, refer to [TiDB documentation](https://pingcap.com/docs/).

Expand Down Expand Up @@ -117,3 +117,25 @@ spec:
count: 5
level: information
```

## Configure TiCDC start parameters

You can configure TiCDC start parameters through `spec.ticdc.config` in TidbCluster Custom Resource.

For example:

```yaml
apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: basic
spec:
...
ticdc:
config:
timezone: UTC
gcTTL: 86400
logLevel: info
```

For all configurable start parameters of TiCDC, see [TiCDC start parameters](https://pingcap.com/docs/stable/ticdc/deploy-ticdc/#manually-add-ticdc-component-to-an-existing-tidb-cluster).
10 changes: 10 additions & 0 deletions en/deploy-on-general-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ TiFlash supports mounting multiple Persistent Volumes (PVs). If you want to conf
storageClassName: local-storage
```

To enable TiCDC for the cluster, configure `spec.ticdc` in the `${cluster_name}/tidb-cluster.yaml` file:

```yaml
ticdc:
baseImage: pingcap/ticdc
replicas: 3
config:
logLevel: info
```

To deploy TiDB cluster monitor, refer to the [TidbMonitor example](https://github.com/pingcap/tidb-operator/blob/master/manifests/monitor/tidb-monitor.yaml) and [API documentation](api-references.md) to complete TidbMonitor CR, and save it to the `${cluster_name}/tidb-monitor.yaml` file. Please switch the TidbMonitor example and API documentation to the currently used version of TiDB Operator.

### Storage class
Expand Down
67 changes: 67 additions & 0 deletions en/deploy-ticdc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Deploy TiCDC in Kubernetes
summary: Learn how to deploy TiCDC in Kubernetes.
category: how-to
---

# Deploy TiCDC in Kubernetes

[TiCDC](https://pingcap.com/docs/stable/ticdc/ticdc-overview/) is a tool for replicating the incremental data of TiDB. This document describes how to deploy TiCDC in Kubernetes using TiDB Operator.

You can deploy TiCDC when deploying a new TiDB cluster, or add the TiCDC component to an existing TiDB cluster.

## Prerequisites

TiDB Operator is [deployed](deploy-tidb-operator.md).

## Fresh TiCDC deployment

To deploy TiCDC when deploying the TiDB cluster, refer to [Deploy TiDB in General Kubernetes](deploy-on-general-kubernetes.md).

## Add TiCDC component to an existing TiDB cluster

1. Edit TidbCluster Custom Resource:

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

``` shell
kubectl edit tc ${cluster_name} -n ${namespace}
```

2. Add the TiCDC configuration as follows:

```yaml
spec:
ticdc:
baseImage: pingcap/ticdc
replicas: 3
```

3. After the deployment, enter a TiCDC Pod by running `kubectl exec`:

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

```shell
kubectl exec -it ${pod_name} -n ${namespace} sh
```

4. [Manage the cluster and data replication tasks](https://pingcap.com/docs/stable/ticdc/manage-ticdc/#use-cdc-cli-to-manage-cluster-status-and-data-replication-task) by using `cdc cli`.

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

```shell
/cdc cli capture list --pd=${pd_address}:2379
```

```shell
[
{
"id": "6d92386a-73fc-43f3-89de-4e337a42b766",
"is-owner": true
},
{
"id": "b293999a-4168-4988-a4f4-35d9589b226b",
"is-owner": false
}
]
```
6 changes: 6 additions & 0 deletions en/scale-a-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Modify `spec.pd.replicas`, `spec.tidb.replicas`, and `spec.tikv.replicas` in the

If TiFlash is deployed in the cluster, you can scale out TiFlash by modifying `spec.tiflash.replicas`.

#### Scale TiCDC

If TiCDC is deployed in the cluster, you can scale out TiCDC by modifying `spec.ticdc.replicas`.

#### Scale in TiFlash

1. Expose the PD service by using `port-forward`:
Expand Down Expand Up @@ -118,6 +122,8 @@ Modify `spec.pd.resources`, `spec.tikv.resources`, and `spec.tidb.resources` in
If TiFlash is deployed in the cluster, you can scale up and down TiFlash by modifying `spec.tiflash.resources`.
If TiCDC is deployed in the cluster, you can scale up and down TiCDC by modifying `spec.ticdc.resources`.
### Vertical scaling operations (Helm)
To perform a vertical scaling operation:
Expand Down
2 changes: 1 addition & 1 deletion zh/configure-cluster-using-tidbcluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ spec:

## 配置 TiCDC 启动参数

你可以通过 TidbCluster Custom Resource 的 `spec.ticdc.config` 来配置 TiCDC 启动参数,以下是一个例子。获取所有可以配置的 CDC 启动参数,请参考 [CDC 启动参数文档](https://pingcap.com/docs-cn/stable/ticdc/deploy-ticdc/#手动在原有-tidb-集群上新增-ticdc-组件)。
你可以通过 TidbCluster Custom Resource 的 `spec.ticdc.config` 来配置 TiCDC 启动参数,以下是一个例子。获取所有可以配置的 TiCDC 启动参数,请参考 [TiCDC 启动参数文档](https://pingcap.com/docs-cn/stable/ticdc/deploy-ticdc/#手动在原有-tidb-集群上新增-ticdc-组件)。

```yaml
apiVersion: pingcap.com/v1alpha1
Expand Down

0 comments on commit 52a4d3f

Please sign in to comment.