Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiproxy: add description on graceful-wait and signing-cert #2503

Merged
merged 13 commits into from
Jan 25, 2024
2 changes: 2 additions & 0 deletions zh/configure-a-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ spec:
config:
```

如果未开启集群 TLS,还需要配置额外参数。详细的配置步骤见 [为已有 TiDB 集群部署负载均衡 TiProxy](https://docs.pingcap.com/tidb-in-kubernetes/stable/deploy-tiproxy)。
xhebox marked this conversation as resolved.
Show resolved Hide resolved

#### 部署 TiFlash

如果要在集群中开启 TiFlash,需要在 `${cluster_name}/tidb-cluster.yaml` 文件中配置 `spec.pd.config.replication.enable-placement-rules: true`,并配置 `spec.tiflash`:
Expand Down
26 changes: 22 additions & 4 deletions zh/deploy-tiproxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,32 @@ summary: 了解如何在 Kubernetes 上为已有 TiDB 集群部署负载均衡 T
```yaml
spec:
tiproxy:
config:
config: |
[log]
level = "info"
config: |
[log]
level = "info"
```

要获取更多可配置的 TiProxy 配置参数,请参考 [TiProxy 配置文档](https://docs.pingcap.com/zh/tidb/v7.6/tiproxy-configuration)。

4. 如果开启了[集群 TLS](enable-tls-between-components.md),则跳过这一步;如果没有开启集群 TLS,还需要生成自签名证书,并手动配置 TiDB 的 [`session-token-signing-cert`](https://docs.pingcap.com/zh/tidb/stable/tidb-configuration-file#session-token-signing-cert-%E4%BB%8E-v640-%E7%89%88%E6%9C%AC%E5%BC%80%E5%A7%8B%E5%BC%95%E5%85%A5) 和 [`session-token-signing-key`](https://docs.pingcap.com/zh/tidb/stable/tidb-configuration-file#session-token-signing-key-%E4%BB%8E-v640-%E7%89%88%E6%9C%AC%E5%BC%80%E5%A7%8B%E5%BC%95%E5%85%A5):

```yaml
spec:
tidb:
additionalVolumes:
- name: sessioncert
secret:
secretName: sessioncert
additionalVolumeMounts:
- name: sessioncert
mountPath: /var/session
config: |
session-token-signing-cert = "/var/session/tls.crt"
session-token-signing-key = "/var/session/tls.key"
```

详见 TiDB 配置文档 [`session-token-signing-key`](https://docs.pingcap.com/zh/tidb/v7.6/tidb-configuration-file#session-token-signing-cert-从-v640-版本开始引入)。

TiProxy 启动后,可通过以下命令找到对应的 `tiproxy-sql` 负载均衡服务。

``` shell
Expand Down
Loading