Hello,
I’ve installed Percona XtraDB Cluster 5.7 on 3 nodes using docker setup, and I’ve started testing proxy using proxy-protocol to keep client IP addresses in logs.
I’ve followed guide from blog post to configure it and it seems to work fine when connecting from remote machines via proxy and from local host itself (both docker host and docker guest) but when connecting from server that is proxy itself, i get following error message:
ERROR 1042 (HY000): Can't get hostname for your address
And this is both when i try to reach proxy endpoint and node directly.
I tried to add --skip-name-resolve to mysqld startup command but i have the same issue.
This is my docker-compose.yml that configures the container
version: '3.3'
services:
pxc-node:
image: percona/percona-xtradb-cluster:5.7
volumes:
- /opt/percona/data/cert:/cert
- /opt/percona/data/config:/etc/percona-xtradb-cluster.conf.d
- /opt/percona/data/data:/var/lib/mysql
- /opt/percona/data/log:/var/log/mysql
ports:
- '3306:3306'
- '4444:4444'
- '4567:4567'
- '4568:4568'
environment:
MYSQL_ROOT_PASSWORD: secretpassword
XTRABACKUP_PASSWORD: secretpassword
CLUSTER_NAME: company-pxe-cluster1
CLUSTER_JOIN: node2
command:
--wsrep_node_address=node1 --wsrep_node_incoming_address=node1:3306 --pxc-strict-mode=PERMISSIVE --server-id=1689939751 --slow-query-log=1 --slow-query-log-file=/var/log/mysql/pxc-slow.log --long-query-time=2 --log-error=/var/log/mysql/error.log --expire-logs-days=1 --tls-version=invalid --proxy-protocol-networks=172.31.19.250 --skip-name-resolve
This is portion of my haproxy file:
listen mysql-TCP-3306
bind *:3306
mode tcp
timeout client 10800s
timeout server 10800s
balance leastconn
option tcp-check
tcp-check expect string mysql_native_password
option allbackups
server node1 node1:3306 check send-proxy