Welcome to Centmin Mod Community
Become a Member

High Availability using centminmod

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Venucci, Oct 30, 2019.

  1. Venucci

    Venucci Member

    63
    8
    8
    Sep 25, 2018
    Ratings:
    +8
    Local Time:
    7:27 PM
    currentyl
    10
    Would you mind to give us some advices about creating a high availability using centminmod . I have read that this page is based on a high availability using centminmod so i guess that you actually are using centminmod . In internet there are many guides but always appears start with nginx and i would to know if after selecting the nodes and heartbeats etc. instead of nginx if i could directly install centminmod and what i must bear in mind . thank you for your time @eva2000 . thank you in advance !

    step 2
    How to Set up Nginx High Availability with Pacemaker and Corosync on CentOS 7
     
  2. pamamolf

    pamamolf Premium Member Premium Member

    3,530
    342
    83
    May 31, 2014
    Ratings:
    +656
    Local Time:
    8:27 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    What i did for testing was HAproxy in front as load balancer and a few servers after that using Mariadb cluster and GlusterFS for files....

    It was working great with no issues...
     
    • Like Like x 1
  3. Venucci

    Venucci Member

    63
    8
    8
    Sep 25, 2018
    Ratings:
    +8
    Local Time:
    7:27 PM
    currentyl
    10
    Would you mind to tell me what step by step guide have used in order to do it ? I was thinking about 2 servers with centminmod on different datacenters in order to avoid downtime for example
     
  4. pamamolf

    pamamolf Premium Member Premium Member

    3,530
    342
    83
    May 31, 2014
    Ratings:
    +656
    Local Time:
    8:27 PM
    Nginx-1.17.x
    MariaDB 10.3.x
    If i remember correctly you must use 3 servers for MariaDB cluster to avoid a problem named Brain split.....

    Sorry but it is hard to remember how i did it ....

    But you can try searching on Google....
     
  5. eva2000

    eva2000 Administrator Staff Member

    42,078
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    4:27 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Post at Load Balancing | Centmin Mod Community asked same question and is pretty much still the same answer.

    Google has alot of guides for haproxy and glusterfs/nfs and nginx as a load balancer !
    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    Centmin Mod's Nginx has all the nginx modules it requires for you to configure nginx reverse proxy, nginx based load balancing and proxy caching (with exception of the shared file system you'd need i.e. NFS, GlusterFS and any mysql database cluster/replication). You just have to configure it yourself :)

    For nginx reverse proxy & load balancing read the documentation, tutorial and guides below
     
  6. eva2000

    eva2000 Administrator Staff Member

    42,078
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    4:27 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    For real high availability you need more than 2 servers, a typical setup minimum setup would be load balanced web servers with load balancer failover and mysql load balanced backends either using mysql master/slave replication or mysql/mariadb galera cluster and then distributed storage via something like GlusterFS with/without NFS or lsyncd/csync and finally a dedicated memcached/redis server(s) for any caching used.

    web end
    • 3x web server backends
    • 2x web load balancers with failover (keepalived/pacemaker etc) talking to those 3x web server backends
    distributed storage
    • GlusterFS with/without NFS or lsyncd/csync or even a mix for specific types of files/directories with 3-5 servers
    mysql end using mysql master/slave replication
    • 2x mysql load balancers talking to the mysql master/slave replication with failover (keepalived/pacemaker etc)
    • 1x mysql master
    • 2x mysql slave
    or mysql end using mysql/mariadb galera cluster
    • 2x mysql load balancers talking to the mysql master/slave replication with failover
    • 3x mariadb/mysql galera cluster
    Then for memcached/redis need memcache/redis server
    • 1x redis/memcached server
    • or best to choose redis in redis master/slave/sentinel based high availability setup which consists of 1x redis master + 1 redis slave + 3x redis sentinel with quorum of 2. Sentinels handle redis master failure/failover to redis slave
    Then
    • For web load balancers either nginx or haproxy
    • For mysql load balancers either haproxy, proxysql or mariadb maxscale
    So that is a total of between 14 to 20 servers you'd need. If you want real high availability, you'd also want a 2nd set of same servers in standby configuration too or as a staging set, so you can test HA config changes on the 2nd test set before live production deployment.

    You'd need to use dedicated servers for this not VPS unless you have VPS which are not on same VPS host node and have private secure LAN network communication between all VPS servers with at least 1Gbps network connectivity.
     
    • Like Like x 1
    • Informative Informative x 1
  7. Itworx4me

    Itworx4me Premium Member Premium Member

    196
    21
    18
    Mar 14, 2017
    Ratings:
    +34
    Local Time:
    10:27 AM
    Nginx 1.17.X
    MariaDB 10.3.X
    What would something like this cost? Just curious.
     
  8. eva2000

    eva2000 Administrator Staff Member

    42,078
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    4:27 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    at say US$60-150 per dedicated server, would be between US$1,000 to US$3,000 per month per set (with 2nd staging/test set 2x costs) but can be 2x to 10x times that depending on disk space as you'd want at least 2x disk raid 1 or 4x disk raid 10 for each server.

    all of that though excludes costs of respective server backups done locally + remotely

    also you'd need the know-how knowledge of how to install, configure, manage and troubleshoot all the moving pieces of software and setups otherwise any downtime or issues due to your lack of knowledge would effectively negate/cancel out any benefits of such a high availability configuration.
     
    • Like Like x 1
  9. wmtech

    wmtech Active Member

    116
    33
    28
    Jul 22, 2017
    Ratings:
    +88
    Local Time:
    7:27 PM
    Yes. Once you go into HA it is striking how things multiply and get expensive. We run 11 servers for a small XenForo forum HA setup including Elasticsearch cluster. Crafted with budget in mind.

    Enjoy the times when you just need one server to run all your stuff... ;-)
     
    • Like Like x 1
  10. eva2000

    eva2000 Administrator Staff Member

    42,078
    9,497
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,613
    Local Time:
    4:27 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Yeah that's part of why Centmin Mod tries to squeeze as much out of each software component performance wise so cumulatively it allows you to run a single server or simplistic server setup (web + db server) much longer before you need to look into HA or multi-server setup when it comes to performance (high availability aside though) or use less servers in a multi-server setup.

    So
    • if Centmin Mod Nginx server can handle and perform 50% faster than standard distro Nginx versions, that means instead of 15x web servers, you'd only need 10x web servers in a load balanced web server setup. Thus saving you the cost of 5x web servers :)
    • if Centmin Mod PHP-FPM server with PHP 7+ with Profile Guided Optimizations can perform 25% faster than standard PHP-FPM distro binaries, that means instead of 15x PHP-FPM servers, you'd only need 12x PHP-FPM servers. Thus saving you the cost of 3x PHP-FPM servers :)
    Yeah HA only makes sense when the benefits outweigh the additional man hour and financial costs involved. Basically, if you make more $$$$ than the cost of implementing such a HA setup :)

    And yes if you run additional servers like Elasticsearch or Sphinx, then those are extra servers to add to the mix.
     
    • Like Like x 1