Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 使用haproxy登陆tidb,怎么能获取真正的应用服务器ip,而不是haproxy服务器的ip
[TiDB Usage Environment] Production\Test Environment\POC
[TiDB Version] V5.4
[Encountered Problem]
Three TiDB components: 192.168.10.2, 192.168.10.3, 192.168.10.4
HAProxy: 192.168.10.5
Application Server: 192.168.10.6
A HAProxy is set up on top of the three TiDB components. When logging into TiDB through HAProxy and executing select instance, id, user, host, db from INFORMATION_SCHEMA.cluster_processlist WHERE command != 'Sleep';
, it is found that the host value corresponding to all SQL executed by the application server is the IP of the HAProxy machine (192.168.10.5) instead of the IP of the application server (192.168.10.6).
[Reproduction Path] None
[Problem Phenomenon and Impact] None