Skip to main content
added 491 characters in body
Source Link
pioupiou
  • 926
  • 1
  • 10
  • 23

We have one galera cluster, mariadb version 10.3 and haproxy.

We want the users to connect like this client->haproxy->galera_cluster. The user we create in the database we allow the IP to the client. For http we found that you can use send-proxy or X-Origin IP in the header.

We want to, to the same with galera cluster, TCP protocol.

We add this in mariadb config file: "proxy_protocol_networks = haproxy_server/32"

We use ubuntu 16.04 and haproxy 1.6.

haproxy config file

 backend galera
 bind 0.0.0.0:3306
 balance leastconn
 mode tcp
 option tcpka
 option forwardfor
 option log-health-checks
 retries                   3
 timeout queue             1m
 timeout connect           15s
 timeout client            50m
 timeout server            50m
 timeout check             10s
 option mysql-check user haproxy
 server node1 IP_Cluster_1:3306 check send-proxy 

Any ideas how we can to that.

Thanks :)

We have one galera cluster, mariadb version 10.3 and haproxy.

We want the users to connect like this client->haproxy->galera_cluster. The user we create in the database we allow the IP to the client. For http we found that you can use send-proxy or X-Origin IP in the header.

We want to, to the same with galera cluster, TCP protocol.

We add this in mariadb config file: "proxy_protocol_networks = haproxy_server/32"

We use ubuntu 16.04 and haproxy 1.6.

Any ideas how we can to that.

Thanks :)

We have one galera cluster, mariadb version 10.3 and haproxy.

We want the users to connect like this client->haproxy->galera_cluster. The user we create in the database we allow the IP to the client. For http we found that you can use send-proxy or X-Origin IP in the header.

We want to, to the same with galera cluster, TCP protocol.

We add this in mariadb config file: "proxy_protocol_networks = haproxy_server/32"

We use ubuntu 16.04 and haproxy 1.6.

haproxy config file

 backend galera
 bind 0.0.0.0:3306
 balance leastconn
 mode tcp
 option tcpka
 option forwardfor
 option log-health-checks
 retries                   3
 timeout queue             1m
 timeout connect           15s
 timeout client            50m
 timeout server            50m
 timeout check             10s
 option mysql-check user haproxy
 server node1 IP_Cluster_1:3306 check send-proxy 

Any ideas how we can to that.

Thanks :)

Source Link
pioupiou
  • 926
  • 1
  • 10
  • 23

haproxy pass origin IP in galera cluster db

We have one galera cluster, mariadb version 10.3 and haproxy.

We want the users to connect like this client->haproxy->galera_cluster. The user we create in the database we allow the IP to the client. For http we found that you can use send-proxy or X-Origin IP in the header.

We want to, to the same with galera cluster, TCP protocol.

We add this in mariadb config file: "proxy_protocol_networks = haproxy_server/32"

We use ubuntu 16.04 and haproxy 1.6.

Any ideas how we can to that.

Thanks :)