Get the most out of your Centmin Mod LEMP stack
Become a Member

Wordpress Testing maxcale with glusterfs, Haproxy and wordpress as Single Point of failure on Centminmod

Discussion in 'Centmin Mod User Tutorials & Guides' started by brijendrasial, Jun 25, 2020.

  1. brijendrasial

    brijendrasial Active Member

    207
    154
    43
    Mar 21, 2018
    Ratings:
    +236
    Local Time:
    3:55 PM
    1.13.9
    10.0.22-MariaDB
    I created a small MariaDB cluster using 3 vps and choose another one for haproxy and maxscale and created glusterfs replica between three servers. Finally installed WordPress. The thing is its single point of failure if main haproxy node fails all fall.

    Followed tutorials

    Hands on Maxscale and Galera Cluster Centos7 - LinuxGlobe
    GlusterFS Replication on CentOS 7 - LinuxGlobe


    Finally installed WordPress on one of the server and its data got replicated on other 2.

    Will keep posting as I go ahead.

    http://web.bullten.work:9000/haproxy_stats
    user: haproxy
    pass: haproxy

    Site: https://web.bullten.work

    Haproxy configuration

    Code:
    #---------------------------------------------------------------------
    # FrontEnd Configuration
    #---------------------------------------------------------------------
    frontend main
        bind *:80
        mode http
        option http-server-close
        option forwardfor
        redirect scheme https code 301 if !{ ssl_fc }
    
    #    acl letsencrypt-acl path_beg /.well-known/acme-challenge/
     #   use_backend letsencrypt-backend if letsencrypt-acl
    
    frontend main-https
        mode http
        bind *:443 ssl crt /etc/letsencrypt/live/web.bullten.work/web.bullten.work.pem alpn h2,http/1.1
    
        default_backend app-main
    
    # LE Backend
    #backend letsencrypt-backend
      #  server letsencrypt 127.0.0.1:8888
    
    #---------------------------------------------------------------------
    # BackEnd roundrobin as balance algorithm
    #---------------------------------------------------------------------
    backend app-main
        mode http
        balance roundrobin                                     #Balance algorithm
        option httpchk HEAD / HTTP/1.1\r\nHost:\ localhost    #Check the server application is up and healty - 200 status code
        server nginx1 176.31.20.253:443 check ssl verify none        #Nginx1
        server nginx2 51.254.238.227:443 check ssl verify none               #Nginx2
        server nginx3 51.255.133.121:443 check ssl verify none              #Nginx3
    
    listen stats
    ## HAProxy stats web gui.
            bind      :9000
            mode http
            stats enable
            stats uri /haproxy_stats
            stats realm HAProxy Statistics
            stats auth haproxy:haproxy
            stats admin if TRUE
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,535
    12,219
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,788
    Local Time:
    8:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Nice thanks for sharing. Maybe better in User Tutorial forum so you get longer timelimits to edit the first post.