DRBD (Distributed Replication Block Device) is one of the leading solutions for MySQL HA (High Availability). When combined with Pacemaker and Corosync, users have:
An end-to-end, integrated stack of mature and proven open source technologies, fully supported by Oracle (as part of MySQL Enterprise Edition).
Automatic failover and recovery for service continuity.
Mirroring, via synchronous replication, to ensure failover between nodes without the risk of losing committed transactions.
Building of HA clusters from commodity hardware, without the requirement for shared-storage.
The following figure illustrates the stack that can be used to deliver a level of High Availability for the MySQL service.
At the lowest level, 2 hosts are required in order to provide physical redundancy; if using a virtual environment, those 2 hosts should be on different physical machines. It is an important feature that no shared storage is required. At any point in time, the services will be active on one host and in standby mode on the other.
Pacemaker and Corosync combine to provide the clustering layer that sits between the services and the underlying hosts and operating systems. Pacemaker is responsible for starting and stopping services, ensuring that they are running on exactly one host, thus delivering high availability and avoiding data corruption. Corosync provides the underlying messaging infrastructure between the nodes that enables Pacemaker to do its job; it also handles the nodes membership within the cluster and informs Pacemaker of any changes.
The core Pacemaker process does not have built-in knowledge of the specific services to be managed; instead, it uses agents that provide a wrapper for the service-specific actions. For example, in this solution we use agents for Virtual IP Addresses, MySQL and DRBD: these are all existing agents and come packaged with Pacemaker.
The essential services managed by Pacemaker in this configuration are DRBD, MySQL and the Virtual IP Address that applications use to connect to the active MySQL service.
DRBD synchronizes data at the block device (typically a spinning or
solid state disk) – transparent to the application, database and
even the file system. DRBD requires the use of a journaling file
system such as
For this solution, it acts in an active-standby mode: at any point
in time, the directories being managed by DRBD are accessible for
reads and writes on exactly one of the two hosts and inaccessible
(even for reads) on the other. Any changes made on the active host
are synchronously replicated to the standby host by DRBD.
Download the following guide for detailed instructions on installing, configuring, provisioning and testing the complete MySQL and DRBD stack, including:
DRBD kernel module and userland utilities.
Pacemaker and Corosync cluster messaging and management processes.
Oracle Linux operating system.
The complete DRBD stack for MySQL has been certified by Oracle, and commercial support is available as part of MySQL Enterprise Edition and Oracle Linux Premier Support, providing a single point of contact for the entire stack, whether issues relate to the operating system, DRBD, clustering software or MySQL.