5. ● Prerequisite
● Install the Elastix 4.0
● Preconfigure
● Install the Cluster Software
● Configure the Cluster Software
● Start the Cluster
● Add the Floating IP
● Database Setup
● Scripting
● Reference
Content
6. ● Physical Server or VM
● Elastix 4.0 image
● Internet Connection
● Basic Linux Knowledge
● Basic MariaDB/MySQL Knowledge
● Basic Programming
Prerequisite
7. ● Prepare both of servers (power, cabling, etc.)
● Boot the Elastix 4.0 image
● Do installation progress like usual (CentOS 7)
● Verify the Elastix 4.0 installation was installed properly
Install the Elastix 4.0
9. ● Type command below
# yum install y pacemaker pcs psmisc policycoreutilspython
Install the Cluster Software
10. ● Start & enable pcs daemon
# systemctl start pcsd.service
# systemctl enable pcsd.service
● Change password for ‘hacluster’ user use same password on either servers
# passwd hacluster
or
# echo admin | passwd stdin hacluster
Configure the Cluster
Daemon Setup
11. ● Setup each server to authentivate as the hacluster user
# pcs cluster auth <elastix1> <elastix2>
● Generate and sync the corosync config
# pcs cluster setup name <clustername> <elastix1> <elastix2>
Configure the Cluster
Corosync Setup
12. ● Start the cluster
# pcs cluster start all
or
# systemctl start corosync.service
# systemctl start pacemaker.service
● Verify the cluster member
# pcs status corosync
Start the Cluster
Corosync Setup
13. ● Add Floating IP
# pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=192.168.6.163
cidr_netmask=32 op monitor interval=30s
● Verify
# pcs status
Add the Floating IP
Corosync Setup
14. ● Edit & add db file conf /etc/my.cnf with code below
● at elastix1
[mysqld]
serverid = 1
logbin = mysqlbin
binlog_do_db = asterisk
● at elastix2
[mysqld]
serverid = 2
logbin = mysqlbin
binlog_do_db = asterisk
● Restart the db
# systemctl restart mariadb
● Create user & grant access
MariaDB [(none)]> grant replication slave on *.* to replica@'%' identified
by 'password';
MariaDB [(none)]> flush privileges;
Database Setup
Config Setting
15. ● Master status
● at elastix1
MariaDB [(none)]> show master status;
+++++
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+++++
| mysqlbin.000001 | 456 | asterisk | |
+++++
1 row in set (0.00 sec)
● at elastix2
MariaDB [(none)]> show master status;
+++++
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+++++
| mysqlbin.000002 | 465 | asterisk | |
+++++
1 row in set (0.00 sec)
● Restart the db
# systemctl restart mariadb
Database Setup
Set master
16. ● Set db Master
● at elastix1
MariaDB [(none)]> change master to master_host='192.168.6.162',
master_user='replica', master_password='password',
master_log_file='mysqlbin.000002', master_log_pos=465;
● at elastix2
MariaDB [(none)]> change master to master_host='192.168.6.161',
master_user='replica', master_password='password',
master_log_file='mysqlbin.000001', master_log_pos=456;
● Start replication
MariaDB [(none)]> start slave;
● Slave status
MariaDB [(none)]> show slave statusG
Database Setup
Set master
Please note the host IP,
master log file and master log pos