Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

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.

...

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.

...

# pecl install zookeeper-0.2.2

Zookeeper Configuration

Installing Zookeeper

Install and configure Zookeeper according to the official documentation. The details are outside of the scope of this document, but if there are any questions about this process please contact Ubersmith Support.

Updating Ubersmith's config.ini.php

Ubersmith's default behavior is to use MySQL's internal GET_LOCK function for advisory locking, so it's necessary to reconfigure the system to make it aware of the new Zookeeper installation. 

...

Verify that the configuration is functional  by logging into Ubersmith. If login is successful, Zookeeper is handling Ubersmith's locking requests.

Migration from standalone MySQL

Installing Percona XtraDB Cluster

Percona's manual describes the process for installing and configuring XtraDB Cluster.

HAProxy

Once the cluster is online, the redundant nature of the hosts can be leveraged by placing a load balancer such as HAProxy between the Ubersmith instance and the database hosts. Percona's documentation has a suggested configuration that directs INSERT and UPDATE queries to a single host, and directs SELECT queries to all nodes using either a 'round robin' or 'least connection' metric.

...

Ensure that the Ubersmith instance host can reach HAProxy and that HAProxy can reach each node on the database cluster. For a simple beginning configuration, it may be easiest to install and configure HAProxy directly on the Ubersmith instance host.

Database Backup

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:

...

Depending on the size of the database and other factors, the mysqldump command may take several minutes to over an hour to run.

Database Restore

Select one node in your cluster to restore the Ubersmith database to, and copy the ubersmith_backup.sql to it. Create the ubersmith database by running the following command from the MySQL command prompt:

...

Depending on the size of the database, this restore may take up to an hour to complete.

Go Live

Once the database restoration is complete, update config.ini.php again to modify the dsn entry to the load balancer previously configured. In the HAProxy example provided by Percona, the configuration should be:

...

Ubersmith is now back online using Percona XtraDB Cluster.

Resources