[Answered ]-Connect Django 1.11 to Mariadb Galera cluster

2👍

According to a ticket that I opened to Django project, there is no support in MariaDB Galera cluster and they probably will not add support for that soon

https://code.djangoproject.com/ticket/28270

0👍

You shall put a load balancer such as haproxy in front of your cluster, as all nodes of gelara cluster are same, this is fully acceptable for example:

apt-get install haproxy
sudo vi /etc/haproxy/haproxy.cfg
# Add the following lines to the end of file:
listen galera
    # Replace "IP" by server local IP
    bind IP:3306
    balance roundrobin
    mode tcp
    option tcpka
    option mysql-check user haproxy
    # Replace "IP" by galera-mariadb-1 local IP
    server galera-mariadb-1 IP:3306 check weight 1
    # Replace "IP" by galera-mariadb-2 local IP
    server galera-mariadb-2 IP:3306 check weight 1
    # Replace "IP" by galera-mariadb-3 local IP
    server galera-mariadb-3 IP:3306 check weight 1
# link: https://cyral.com/blog/how-to-galera-mariadb-haproxy/

Although this will result in a paradoxical situation where you find yourself not actually high available using one-node haproxy, that also is solvable using keepalived…

👤YosSaL

Leave a comment