TiDB 6.1.0 Cluster Configuration with HAProxy Forwarding

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB6.1.0 集群配置haproxy转发

| username: TiDBer_5M9L07sN

【TiDB Environment】Test environment
【TiDB Version】6.1.0 Cluster
【Problem Encountered】Installation and configuration combined with column j
192.168.0.153 tidb, tikv …
192.168.0.154 tidb, haproxy
192.168.0.155 tidb, tikv…


image

【Reproduction Path】How to solve this?
【Problem Phenomenon and Impact】
Currently, telnet 192.168.0.154 14001 is reachable, but the client connection remains in a pending state.

| username: tracy0984 | Original post link

Refer to the official documentation, your HAProxy configuration seems to be missing send-proxy.
HAProxy Best Practices in TiDB | PingCAP Docs


TiDB Configuration File Description | PingCAP Docs

| username: TiDBer_5M9L07sN | Original post link

It still doesn’t work after adding it before.

| username: TiDBer_5M9L07sN | Original post link

Not sure what’s going on with this.

| username: tracy0984 | Original post link

Can you connect to TiDB directly using the client?

| username: TiDBer_5M9L07sN | Original post link

There is no problem directly connecting to the TiDB port.

| username: tracy0984 | Original post link

How about trying to set the tidb’s proxy-protocol.networks parameter to empty and see if haproxy can connect?

| username: TiDBer_5M9L07sN | Original post link

After reloading, the HAProxy method still cannot connect. Direct connection to others works fine.

| username: TiDBer_5M9L07sN | Original post link

From the phenomenon, it seems to have been forwarded, but it appears to be pending in terms of database connection…

| username: weixiaobing | Original post link

Please share the HAProxy configuration. My local tests are working fine. You can configure it according to HAProxy 在 TiDB 中的最佳实践 | PingCAP 文档中心.

| username: TiDBer_5M9L07sN | Original post link

This is the full configuration of haproxy, with only a new port modified as mentioned above. The configuration of tidb remains the same as before. Please help take a look.

| username: weixiaobing | Original post link

Try changing backend tidb-cluster to listen tidb-cluster and see if it works.

| username: TiDBer_5M9L07sN | Original post link

It seems to be able to listen, but this error occurred :grinning:

| username: TiDBer_5M9L07sN | Original post link

After encountering this issue, you can directly fill in the relevant IP in TiDB.

| username: TiDBer_5M9L07sN | Original post link

Thank you, it seems that the issue is still with the version compatibility in haproxy.

| username: tidb狂热爱好者 | Original post link

Can you specify what the problem is? Can you explain in detail?

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.