segunda-feira, 26 de janeiro de 2015

How to Bootstrap MySQL/MariaDB Galera Cluster

http://ift.tt/1zjwolJ

January 27, 2015 By Severalnines Unlike standard MySQL server and MySQL Cluster, the way to start a MySQL/MariaDB Galera Cluster is a bit different. Galera requires you to start a node in a cluster as a reference point, before the remaining nodes are able to join and form the cluster. This process is known as cluster bootstrap. Bootstrapping is an initial step to introduce a database node as primary component, before others see it as a reference point to sync up data.   How does it work?   When Galera starts with the bootstrap command on a node, that particular node will reach Primary state (check the value of wsrep_cluster_status). The remaining nodes will just require a normal start command and they will automatically look for existing Primary Component (PC) in the cluster and join to form a cluster. Data synchronization then happens through either incremental state transfer (IST) or snapshot state transfer (SST) between the joiner and the donor.   So basically, you should only bootstrap the cluster if you want to start a new cluster or when no other nodes in the cluster is in PRIMARY state. Care should be taken when choosing the action to take, or else you might end up with split clusters or loss of data.   The following example scenarios illustrate when to bootstrap the cluster:   How to start Galera cluster?   The 3 Galera vendors use different bootstrapping commands (based on the software’s latest version). On the first node, run: Codership: $ service mysql bootstrap Percona XtraDB Cluster: $ service mysql bootstrap-pxc MariaDB Galera Cluster: $ service mysql bootstrap   The above command is just a wrapper and what it actually does is to start the MySQL instance on that node with gcomm:// as the wsrep_cluster_address variable. You can also manually define the variables inside my.cnf and run the standard start/restart command. However, do not forget to change wsrep_cluster_address back again to contain the addresses to all nodes after the start.   read more

from Planet MySQL http://ift.tt/1du18ol

Nenhum comentário:

Postar um comentário

Leave your comment here!