Bootstrapping the cluster

Bootstrapping refers to getting the initial cluster up and running. By bootstrapping you are defining which node is has the correct information, that all the other nodes should synchronize to (via SST). In the event of a cluster-wide crash, bootstrapping functions the same way: by picking the initial node, you are essentially deciding which cluster node contains the database you want to go forward with.

The MySQL configuration file should contain necessary configuration options to start the Percona XtraDB Cluster:

[mysqld]
# Path to Galera library
wsrep_provider=/usr/lib64/libgalera_smm.so
# Cluster connection URL
wsrep_cluster_address=gcomm://
# In order for Galera to work correctly binlog format should be ROW
binlog_format=ROW
# MyISAM storage engine has only experimental support
default_storage_engine=InnoDB
# This changes how |InnoDB| autoincrement locks are managed and is a requirement for Galera
innodb_autoinc_lock_mode=2

Bootstrapping the cluster is a bit of a manual process. On the initial node, variable wsrep_cluster_address should be set to the value: gcomm://. The gcomm:// tells the node it can bootstrap without any cluster to connect to. Setting that and starting up the first node should result in a cluster with a wsrep_cluster_conf_id of 1. After this single-node cluster is started, variable wsrep_cluster_address should be updated to the list of all nodes in the cluster. For example:

wsrep_cluster_address=gcomm://192.168.70.2,192.168.70.3,192.168.70.4

Although note that cluster membership is not defined by this setting, it is defined by the nodes that join the cluster with the proper cluster name configured Variable wsrep_cluster_name is used for that, if not explicitly set it will default to my_wsrep_cluster. Hence, variable wsrep_cluster_address does not need to be identical on all nodes, it’s just a best practice because on restart the node will try all other nodes in that list and look for any that are currently up and running the cluster.

Once the first node is configured, then each other node should be started, one at a time. In a bootstrap situation, SST is most likely, so generally multiple nodes joining at once should be avoided.

In case cluster that’s being bootstrapped has already been set up before, and to avoid editing the my.cnf twice to change the wsrep_cluster_address to gcomm:// and then to change it back to other node addresses, first node can be started with:

/etc/init.d/mysql bootstrap-pxc

This way values in my.cnf would remain unchanged. Next time node is restarted it won’t require updating the configuration file. This can be useful in case cluster has been previously set up and for some reason all nodes went down and the cluster needs to be bootstrapped again.

Version Specific Information

  • 5.5.31-23.7.5 - New bootstrap init script option bootstrap-pxc introduced.
Percona XtraDB Cluster
Call Us
+1-888-316-9775 (USA - Sales)
+1-208-473-2904 (USA - Sales)
+44-208-133-0309 (UK - Sales)
0-800-051-8984 (UK - Sales)
0-800-181-0665 (GER - Sales)
+1-877-862-4316 (Emergency)
+1-855-55TRAIN (Training)
+1-925-271-5054 (Training)

Table Of Contents

Previous topic

Multi-Master replication

Next topic

State Snapshot Transfer

This Page



© Copyright 2012-2014, Percona LLC and/or its affiliates.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
Created using Sphinx 1.1.3.
This documentation is developed in Launchpad as part of the Percona XtraDB Cluster source code.
If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please file a bug.
]]>