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

dev, v3.0/tidb-in-kubernetes: tidb keep alive troubleshooting #1864

Merged
merged 6 commits into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions dev/tidb-in-kubernetes/troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,22 @@ kubectl logs -f <tidb-pod-name> -n <namespace> -c tidb
```

Pod 重建后,会以在集群中注册一个新的 Store,恢复完成。

## TiDB 长连接被异常中断

许多负载均衡器 (Load Balancer) 会设置连接空闲超时时间。当连接上没有数据传输的时间超过设定值,负载均衡器会主动将连接中断。若发现 TiDB 使用过程中,长查询会被异常中断,可检查客户端与 TiDB 服务端之间的中间件程序。若其连接空闲超时时间较短,可尝试增大该超时时间。若不可修改,可打开 TiDB `tcp-keep-alive` 选项,启用 TCP keepalive 特性。

默认情况下,Linux 发送 keepalive 探测包的等待时间为 7200 秒。若需减少该时间,可通过 `podSecurityContext` 字段配置 `sysctls`,例子如下:

```
tidb:
...
podSecurityContext:
sysctls:
- name: net.ipv4.tcp_keepalive_time
value: "300"
```

> **注意:**
>
> 以上配置的环境要求:TiDB Operator 1.1 版本或以上。
19 changes: 19 additions & 0 deletions v3.0/tidb-in-kubernetes/troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,22 @@ kubectl logs -f <tidb-pod-name> -n <namespace> -c tidb
```

Pod 重建后,会以在集群中注册一个新的 Store,恢复完成。

## TiDB 长连接被异常中断

许多负载均衡器 (Load Balancer) 会设置连接空闲超时时间。当连接上没有数据传输的时间超过设定值,负载均衡器会主动将连接中断。若发现 TiDB 使用过程中,长查询会被异常中断,可检查客户端与 TiDB 服务端之间的中间件程序。若其连接空闲超时时间较短,可尝试增大该超时时间。若不可修改,可打开 TiDB `tcp-keep-alive` 选项,启用 TCP keepalive 特性。

默认情况下,Linux 发送 keepalive 探测包的等待时间为 7200 秒。若需减少该时间,可通过 `podSecurityContext` 字段配置 `sysctls`,例子如下:

```
tidb:
...
podSecurityContext:
sysctls:
- name: net.ipv4.tcp_keepalive_time
value: "300"
```

> **注意:**
>
> 以上配置的环境要求:TiDB Operator 1.1 版本或以上。