Adding Slave Database to existing cluster
Posted:
Sun Mar 03, 2019 2:01 pm
by samadsaeed
Hello, can we add a slave database to an existing vicidial cluster? setup is like 1 web and DB server and 4 dialers. i have done scratch installation on centos 6.9. its mysql database not mariadb. please let me know how its done thanks.
Re: Adding Slave Database to existing cluster
Posted:
Wed Mar 06, 2019 3:55 pm
by williamconley
while you call it a "slave" database, and some of the documentation even refers to it as such in certain ways, what you are looking for is a "replication server" or a "replication slave". This is a mysql process that just allows a duplicate of a database to be "pulled" constantly to another mysql database server.
replicating a database server is a mysql process and once created (and properly replicated) there is a setting in admin->system settings to allow use of this server as the reporting server to remove reporting load from the primary (master) mysql server.
you must also ensure that the cron user from all servers has the same access to that database as the master so they can shunt automatically to the replication slave if the report in question is set to use the slave data source.
while it is not in any way necessary to install anything else "vicidial" on the replication server, the easiest way to accomplish replication is with the Vicibox.com iso installer, but failing that you would initially install it as any other server in the cluster and then activate the mysql service and follow standard replication procedures. you may want to have a look at the vicibox-install script and my.cnf settings that would ordinarily be used, but do note that these settings can be related to the version of mysql and OS being used. As an added benefit of using the Vicibox installer ... you'd have another server in the cluster.
Vicidial only works with Master/Slave, not Master/Master. When the DB server reboots, memory tables will be deleted, causing errors during replication. Errors to skip in my.cnf on the slave server:
slave-skip-errors = 1032,1690,1062
An important thing to remember: The Slave can be of a newer MySQL release than the Master. BUT the Master can NOT be a newer release than the slave. The master issues commands, a newer slave will understand them. But an older slave may not know them all, thus it would fail at that moment.
PS: Please include a link to the instruction set you use to build your servers. It helps bring those with the same set together to get any issues resolved.