Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: haproxy无法获取真实ip
【TiDB Usage Environment】Production Environment
【TiDB Version】4.0.0
【Reproduction Path】Operations performed that led to the issue
【Encountered Issue: Phenomenon and Impact】
【Resource Configuration】Navigate to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
【Attachments: Screenshots/Logs/Monitoring】
haproxy: 192.168.1.62:4000
tidb: 192.168.1.62:4001, 192.168.1.135:4001
Machine where user dts is located: 192.168.1.130
conf/tidb.toml
haproxy configuration
Test results
Port 4001 can be used normally, but 4000 cannot be used.
Your HAProxy machine and the TiDB server on port 4000 are on the same machine. Try placing them on different machines and configure the IP of HAProxy in proxy-protocol-networks.
This IP can only be the IP of HAProxy, not the IP of TiDB, otherwise it won’t work.
Hello,
It should be written like this:
[proxy-protocol]
networks = "192.168.1.62"
fallbackable = true
I can connect to port 4001, but it gets interrupted.
Hello,
Can you reconnect successfully after completely disconnecting?
The issue has been resolved. The reason was that the timeout setting for HAProxy was too short. However, some database connections are still reporting errors: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (invalid sequence 88 != 1).
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.