Overview
From Wikipedia:
High-availability clusters are groups of computers that support server applications that can be reliably utilized with a minimum of down-time. They operate by using high availability software to harness redundant computers in groups or clusters that provide continued service when system components fail.
While there are many MySQL-based clustering solutions available, Ubersmith presently supports and advocates the use of Percona XtraDB Cluster.
Percona XtraDB Cluster is an active/active high availability and high scalability open source solution for MySQL clustering. It integrates Percona Server and Percona XtraBackup with the Galera library of MySQL high availability solutions in a single package [...]
Prerequisites
In versions of Ubersmith prior to the 3.3.0 release, application advisory locking was provided directly by the MySQL database server, by way of the GET_LOCK built-in function. Most modern MySQL-based clustering solutions do not allow the use of this function as it is not replicated across all nodes in the database cluster.
This limitation requires the use of a software component outside of Ubersmith and its associated database to provide a locking mechanism. Ubersmith has chosen Apache Zookeeper for this purpose.
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
The PHP Zookeeper PECL module must be installed on all web frontend hosts that will be communicating with the Zookeeper server(s). This module can be installed using the command:
# pecl install zookeeper-VERSIONAs of this writing, the current version is 0.2.2:
# pecl install zookeeper-0.2.2Zookeeper Configuration
Installing Zookeeper
...
Add a Zookeeper configuration block to config.ini.php file (located above the Ubersmith web root on the Ubersmith server):
[uber_lock]
backend = zookeeperserverszookeeper
servers = 127.0.0.1:2181In this case, the servers configuration option refers to the IP address and port for the Zookeeper instance. In this example, Zookeeper is running on the same host as Ubersmith (note the use of the 127.0.0.1 loopback address) with a port of 2181 for inbound connections. If a Zookeeper Ensemble is to be implemented, the servers entry should be a comma delimited list of IPs and ports for each host in the ensemble. For example:
[uber_lock]
backend = zookeeperserverszookeeper
servers = 10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181...
Before beginning the migration to the new cluster, place Ubersmith in maintenance mode. Update or add the following entry to Ubersmith's config.ini.php file:
[maintenance]
enable = 1Placing Ubersmith in maintenance mode ensures that a consistent database snapshot will be collected. Before starting the backup process, ensure that you have enough disk space to create a full dump of the Ubersmith database. Create a dump of the Ubersmith database using the mysqldump utility:
...
The command above assume a database name of ubersmith and that you do not need to provide login credentials to MySQL. You can verify your database name by reviewing the dsn configuration in config.ini.php, which follows this format:
[database]
dsn = mysql://USERNAME:PASSWORD@HOST/DATABASE...
dsn = mysql://ubersmith:PASSWORD@HAPROXY_ADDRESS/ubersmithdsn2ubersmith
dsn2 = mysql://ubersmith:PASSWORD@HAPROXY_ADDRESS:3307/ubersmith...
Verify that the username, password, hostnames, and ports defined in your config.ini.php also work with the MySQL command line client. Finally, take Ubersmith out of maintenance mode by updating the configuration directive in config.ini.php:
[maintenance]
enable = 0Ubersmith is now back online using Percona XtraDB Cluster.
...