HA - Active Backup
Active backup server side solution for easyredmine. Based on: - Percona master - slave replication - rsync script for syncing files from master to slave
Auto-takeover is not included and should be provided by 3rd party proxy, or by HA-proxy for example
Pre-installation requirements
- both servers must be deployed by easy_cloud_deploy.yml playbook
- TCP ports 22 and 3306 must be open between master and slave nodes
- application on master node must works
’‘’
EXAMPLE
# add this to host_vars/$MASTER_SERVER_NAME.yml
db_server_id: 1
firewall_v4_host_rules:
400 allow mysql replication traffic:
- -A INPUT -p tcp --dport 3306 -j ACCEPT -s 85.18.13.28/32 -m comment --comment "allow MySQL access from slave"
- -A INPUT -p tcp --dport 22 -j ACCEPT -s 85.18.13.28/32 -m comment --comment "allow SSH access from slave"
# add this to host_vars/$SLAVE_server_name.yml
mysql_replication_user: repliuser
mysql_replication_password: secretpassword
server_id: 2
application: velmidulezitymegaklient.easyproject.com
git: git@git.easy.cz:easyproject_com/stable.git
master: hot-master.cz.easy2.cloud
# is not required, but in future it could be master so we can prepare it
firewall_v4_host_rules:
400 allow mysql replication traffic:
- -A INPUT -p tcp --dport 3306 -j ACCEPT -s 85.18.13.21/32 -m comment --comment "allow MySQL access from master"
- -A INPUT -p tcp --dport 22 -j ACCEPT -s 85.18.13.21/32 -m comment --comment "allow SSH access from master"
’‘’
installation
Don’t start before pre-installation requirements are met!!!!
- Check master and slave nodes met requirements and host_vars yaml contain required variables
- Redeploy master database and firewall role just to be sure ansible and server state match
- Redeploy whole slave node
- Run playbook hot-standby.yml ansible-playbook -i easy_cloud hot-standby.yml –limit “slave_node*” –diff
- copy app_name/config/database.yml from master to slave
- reload app on slave