DEV-380: added haproxy stuff to be ready for communication in case of M-M-replication for mariadb

feature/DEV-380
friedrich goerz 4 years ago
parent 0eac3f3d3c
commit 710b85a275

@ -217,3 +217,5 @@ selfsigned_ca_private_key_passphrase: '{{ selfsigned_ca_private_key_passphrase_v
prometheus_alert_diskspaceusage_warning: 85
prometheus_alert_pg_replication_lag: 120
wordpress_haproxy_admin_password: "{{ wordpress_haproxy_admin_password_vault | default('haproxy-admin') }}"

@ -1,6 +1,6 @@
---
connect_wordpress_maria_host: "{{ shared_service_maria_hostname }}"
connect_wordpress_maria_host: "mariaproxy"
connect_wordpress_maria_database: "{{ stage }}_{{ tenant_id }}_{{ cluster_name }}_connect_wordpress"
connect_wordpress_maria_username: "{{ connect_wordpress_maria_database }}"
connect_wordpress_maria_password: "connect-wordpress-maria-admin"

@ -58,12 +58,18 @@ shared_service_pg_slave_ip: "{{ stage_server_infos
| list
| first
| default('-') }}"
shared_service_maria_ip: "{{ stage_server_infos
shared_service_maria_1st_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-maria-01' )
| map(attribute='private_ip')
| list
| first
| default('-') }}"
shared_service_maria_2nd_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-maria-02' )
| map(attribute='private_ip')
| list
| first
| default('-') }}"
shared_service_keycloak_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-keycloak-01' )
| map(attribute='private_ip')
@ -139,7 +145,8 @@ shared_service_management_ip: "{{ stage_server_infos
shared_service_kube_ip: "{{ stage_private_ingress_loadbalancer_ip | default('-') }}"
shared_service_maria_hostname: "{{ stage }}-maria-01"
shared_service_maria_1st_hostname: "{{ stage }}-maria-01"
shared_service_maria_2nd_hostname: "{{ stage }}-maria-02"
shared_service_postgres_01_hostname: "{{ stage }}-postgres-01"
shared_service_elastic_stack_01_hostname: "{{ stage }}-elastic-stack-elastic-01"
shared_service_elastic_stack_02_hostname: "{{ stage }}-elastic-stack-elastic-02"
@ -193,8 +200,12 @@ shared_service_hosts: [
name: "{{ shared_service_elastic_stack_logstash_01_hostname }}"
},
{
ip: "{{ shared_service_maria_ip }}",
name: "{{ shared_service_maria_hostname }}"
ip: "{{ shared_service_maria_1st_ip }}",
name: "{{ shared_service_maria_1st_hostname }}"
},
{
ip: "{{ shared_service_maria_2nd_ip }}",
name: "{{ shared_service_maria_2nd_hostname }}"
},
{
ip: "{{ shared_service_pg_master_ip }}",

@ -58,12 +58,18 @@ shared_service_pg_slave_ip: "{{ stage_server_infos
| list
| first
| default('-') }}"
shared_service_maria_ip: "{{ stage_server_infos
shared_service_maria_1st_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-maria-01' )
| map(attribute='private_ip')
| list
| first
| default('-') }}"
shared_service_maria_2nd_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-maria-02' )
| map(attribute='private_ip')
| list
| first
| default('-') }}"
shared_service_keycloak_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-keycloak-01' )
| map(attribute='private_ip')
@ -139,7 +145,8 @@ shared_service_management_ip: "{{ stage_server_infos
shared_service_kube_ip: "{{ stage_private_ingress_loadbalancer_ip | default('-') }}"
shared_service_maria_hostname: "{{ stage }}-maria-01"
shared_service_maria_1st_hostname: "{{ stage }}-maria-01"
shared_service_maria_2nd_hostname: "{{ stage }}-maria-02"
shared_service_postgres_01_hostname: "{{ stage }}-postgres-01"
shared_service_elastic_stack_01_hostname: "{{ stage }}-elastic-stack-elastic-01"
shared_service_elastic_stack_02_hostname: "{{ stage }}-elastic-stack-elastic-02"
@ -193,8 +200,12 @@ shared_service_hosts: [
name: "{{ shared_service_elastic_stack_logstash_01_hostname }}"
},
{
ip: "{{ shared_service_maria_ip }}",
name: "{{ shared_service_maria_hostname }}"
ip: "{{ shared_service_maria_1st_ip }}",
name: "{{ shared_service_maria_1st_hostname }}"
},
{
ip: "{{ shared_service_maria_2nd_ip }}",
name: "{{ shared_service_maria_2nd_hostname }}"
},
{
ip: "{{ shared_service_pg_master_ip }}",

File diff suppressed because it is too large Load Diff

@ -58,12 +58,18 @@ shared_service_pg_slave_ip: "{{ stage_server_infos
| list
| first
| default('-') }}"
shared_service_maria_ip: "{{ stage_server_infos
shared_service_maria_1st_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-maria-01' )
| map(attribute='private_ip')
| list
| first
| default('-') }}"
shared_service_maria_2nd_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-maria-02' )
| map(attribute='private_ip')
| list
| first
| default('-') }}"
shared_service_keycloak_ip: "{{ stage_server_infos
| selectattr('name', 'match', stage + '-keycloak-01' )
| map(attribute='private_ip')
@ -139,7 +145,8 @@ shared_service_management_ip: "{{ stage_server_infos
shared_service_kube_ip: "{{ stage_private_ingress_loadbalancer_ip | default('-') }}"
shared_service_maria_hostname: "{{ stage }}-maria-01"
shared_service_maria_1st_hostname: "{{ stage }}-maria-01"
shared_service_maria_2nd_hostname: "{{ stage }}-maria-02"
shared_service_postgres_01_hostname: "{{ stage }}-postgres-01"
shared_service_elastic_stack_01_hostname: "{{ stage }}-elastic-stack-elastic-01"
shared_service_elastic_stack_02_hostname: "{{ stage }}-elastic-stack-elastic-02"
@ -193,8 +200,12 @@ shared_service_hosts: [
name: "{{ shared_service_elastic_stack_logstash_01_hostname }}"
},
{
ip: "{{ shared_service_maria_ip }}",
name: "{{ shared_service_maria_hostname }}"
ip: "{{ shared_service_maria_1st_ip }}",
name: "{{ shared_service_maria_1st_hostname }}"
},
{
ip: "{{ shared_service_maria_2nd_ip }}",
name: "{{ shared_service_maria_2nd_hostname }}"
},
{
ip: "{{ shared_service_pg_master_ip }}",

File diff suppressed because it is too large Load Diff

@ -27,6 +27,23 @@ wordpress_docker: {
},
],
services: [
{
name: "mariaproxy",
image_name: "haproxytech/haproxy-alpine",
image_version: "2.2.24",
ports: [
{
"external": "16666",
"internal": "6666",
},
],
volumes: [
'"./config/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro"',
],
networks: [
'"back-tier"',
],
},
{
name: "{{ wordpress_id }}",
image_name: "{{ wordpress_image_name }}",

@ -0,0 +1,31 @@
global
user haproxy
group haproxy
daemon
maxconn 4096
defaults
mode tcp
balance roundrobin
timeout client 30000ms
timeout server 30000ms
timeout connect 3000ms
retries 3
frontend stats
bind *:6666
mode http
stats enable
stats uri /haproxystats
stats show-node
stats auth {{ wordpress_haproxy_admin_username | default('haproxy-admin') }}:{{ wordpress_haproxy_admin_password }}
stats refresh 10s
frontend wordpress_backend
bind 0.0.0.0:3306
default_backend mariadb_servers
backend mariadb_servers
option tcp-check
server maria-01 {{ shared_service_maria_1st_hostname }}:3306 maxconn 2048 check
# server maria-02 {{ shared_service_maria_2nd_hostname }}:3306 maxconn 2048 check
Loading…
Cancel
Save