April 29, 2012

MySQL Cluster

MySQL Cluster is a version of high availability, high redundancy of MySQL adapted for the distributed computing environment.

MySQL Cluster is a technology that enables clustering of in-memory databases in ashared-nothing environment. The shared-nothing architecture allows the system manager database (DBMS) to work using no expensive hardware and software minimum requirements both as hardware.

This cluster also have no single point of failure, so each component has its own memory and disk. Because this scheme is not recommended to use shared storage mechanisms such as shared folders over a network, network filesystems, etc.


This cluster uses the NDB Cluster storage engine to enable running several MySQL servers in a cluster. 

Basic architecture

This type of cluster consists of a group of machines, each one of them running anumber of processes including MySQL servers, storage nodes for NDB Cluster,management servers, and running specialized programs access to data.

All these programs work together to form a MySQL Cluster. When data is stored in theNDB Cluster storage engine, the tables are stored in the data nodes. These tables are directly accessible from all other MySQL servers in the cluster. Therefore, if an application updates a field in a table, all other MySQL servers that query this data cansee the change immediately.

The cluster can handle failures of individual data nodes with no other impact but few transactions aborted due to the loss of transaction status.


Main components

  • NDB storage engine
    Is a memory storage engine offering high availability and data persistence features.
Also in a minimum configuration, its necessary 3 types of nodes (one of each of them):
  • Management node (MGM)
    The main function of these nodes is to manage the other nodes within the cluster, such as providing configuration data, starting and stopping nodes, running backups, etc.
  • Data node
    This kind of node stores cluster data.
  • SQL node
    This is the node that access the cluster data. In MySQL Cluster, a node is atraditional MySQL server that uses the NDB Cluster storage engine

Basic Operation

The management server (MGM node) manages the cluster configuration file and the log. Each node in the cluster configuration data received from the management server,and need a way to determine where the management server resides. When interesting events occur in the data nodes, the nodes transfer information about these events to the management server, which stores the information in the cluster log.


Main processes

  • MySQLD
    For use this process a MySQL Cluster, you need to be specially constructed to withstand the NDB storage engine.

    Also known as MySQL Server, is the main program that does most of the work in a MySQL installation. MySQL Server manages access to the MySQL data directory that contains databases and tables.

    When MySQL server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients.
  • NBD
    Is responsible for handling all table data using the cluster ndbd engine. This process supports transaction management functionality distributed between the nodes, node recovery defective or offline, checkpoint to disk, online backup and other tasks related to the distribution of the cluster.
  • NDB_MGMD
    This is the process that controls the management server and is responsible to know and maintain the cluster configuration and distribute such information to all nodes that request to join the cluster. It also maintains the log of cluster activities and reports its status to the clients connecting.to it.

Here is a video explaining the operation of MySQL Cluster and also they explain its advantages:


Also here is a tutorial to install MySQL Cluster in Linux:



Thats all, peace!

Sources

1 comment:

  1. Pongo estos puntos a hace dos semanas cuando no publicaste. Son 8.

    ReplyDelete