AUTOM8N Cluster Installation

Running a high available cluster is complex than running a standalone server , there are more components involved, so having more than 30 virtual hosts (shared hosting accounts) on a cluster can complicate things and even make it feel like it is less stable than a standalone server

We highly recommend NOT adding more than 30 accounts on a single cluster and if you wish to have more accounts, provisioning a new cluster is the way to go

With the cPanel’s tiered account based pricing , this translates to:

Only use a cPanel Solo, Admin or Pro License on a Cloud Service for a cluster . While Autom8n Does not itself limit its usage, the cluster will start showing signs of stress and maintenance requirements unless the guideline is followed

Only use cPanel solo,admin or pro license

AUTOM8N Cluster Requirements: cPanel v72 or higher server with CentOS7/CloudLinux7 64 bit OS

AUTOM8N Cluster is compatible with CloudLinux LVE, CageFS, cPanel MultiPHP, AutoSSL, FleetSSL ,LSPHP(Apache Only)

AUTOM8N Cluster is NOT compatible with CloudLinux PHP Selector and Alt-PHP Use MultiPHP instead

Note

setup lsphp(mod_lsapi) on Apache to be used in AUTOM8N Cluster https://autom8n.com/howtos/autom8n_cluster_on_cloudlinux.html

AUTOM8N Cluster Prerequisites

  1. cPanel full version installed on the master server and cPanel DNS only installed on all slaves
  2. MariaDB 10.x ( Upgrade to MariaDB,preferably the latest version fom WHM )
  3. CSF firewall installed and enabled on all servers in cluster . The setup will fail if CSF firewall is not installed prior to setup
  4. The master server should be able to login as root to all slaves without a password. Setup ssh key of the master on all slaves

Note

There should not be any external firewalls blocking TCP/UDP port between the master server and slaves as this cause setup to fail

Note

The hostname should not change after setup as this breaks cluster synchronization

Setting up the cluster

Setup Autom8n standalone on the master server https://autom8n.com/docs/installation_standalone.html

Add cluster slave details

You can fill in the details of the first slave server and save the settings.

Note that the Slave Main IP and Slave DB IP will be same on most setup, unless you have a LAN interface to have the mysql replication setup. If in doubt fill in the slaves main IP on both fields

Add additional slave details

You can add additional slave servers and additional home directories like home2, home3 etc to be synced by the Unison filesync . Additional slaves can be setup anytime in the life cycle of a cluster for horizontal scalability

Run the Cluster setup Ansible playbook

cd /opt/nDeploy/conf/nDeploy-cluster
ansible-playbook -i ./hosts cluster.yml

cPanel Horizontal scaling . Adding more web servers

You can add more servers to the cluster anytime from the WHM Autom8n plugin user interface

Remove MySQL dump lock so that MySQL replication can be setup on the new slaves

rm -f /opt/nDeploy/conf/XTENDWEB_MYSQL_DUMP_LOCK_DO_NOT_REMOVE

Run the Cluster setup Ansible playbook

cd /opt/nDeploy/conf/nDeploy-cluster
ansible-playbook -i ./hosts cluster.yml

The one extra thing you need to do if you are adding additional servers or if you are setting up AUTOM8N cluster on an existing cPanel server with accounts and database’s already present is apply the necessary grants for the slave servers

mysqlaccess

Grants can be setup from Home »SQL Services »Additional MySQL Access Hosts section in WHM. Click on the “click here” link to setup additional grants required for the slaves

Testing domain on cluster setup

Since the web application runs on multiple servers that are independent of each other there is a chance that one of the server is not serving page correctly and this goes unnoticed because of round robin DNS

To test individual servers do

curl -v -I https://domain.com --resolve "domain.com:443:xxx.xxx.xxx.xxx"
# Where xxx.xxx.xxx.xxx is the master or slave servers IP that you need to test

Cluster Administration scripts

/opt/nDeploy/scripts/cluster_home_ensure_all.py
# Ensures the users and shell is in sync

/opt/nDeploy/scripts/cluster_dns_ensure_all.sh
#Ensure DNS changes are uptodate

/opt/nDeploy/scripts/cluster_sync_rpms.sh
#Ensure the entire LEMP stack is in sync
# Note that this does not include manually installed pecl modules etc

/opt/nDeploy/scripts/fix_unison_filesync.py restart|reset
# Reset starts unison cluster from scratch,so use it rarely if
# unison is not starting up
# restart as the name implies restarts Unison