For the cluster address (where to connect to cluster at) Galera takes URL in the form
<backend schema>://<cluster address>[?option1=value1[&option2=value2]]
which can be optionally followed by a list of
key=value queries according to URL standard. In 0.7 it is the only way to customized Galera parameters. In 0.8 values supplied in the URL take precedence over the values supplied in
NOTE: Values supplied in the URL are valid only for this connection instance and need to be resupplied on every new connection to cluster. In 0.8 customized parameters can be made durable by putting them in
Galera currently supports 2 schemata:
- 'dummy' : a pass-through backend for testing and profiling. Does not connect or replicate anywhere, anything after it is ignored.
- 'gcomm' : a real group communication backend. This is what you want. This backend takes an address and has a number of parameters that can be set via option list (or via
wsrep_provider_optionsstarting with 0.8.x)
Cluster address should be either
- an address of ANY current cluster member if you want to connect node to existing cluster OR
- a comma-separated list of such possible cluster members (it is assumed that list members can belong to no more than 1 primary component) OR
- an empty string if you want this node to be the first in a new cluster (i.e. no preexisting nodes to connect to).
It can be either IP address or a DNS name optionally followed by port number.
As of version 2.2 Galera supports a comma-separated list of cluster members in the cluster address like:
Only use empty
gcomm:// address when you want create a NEW cluster. Never use it when your intention is to reconnect to an existing one. Therefore never leave it hardcoded in any configuration files.
One way to avoid editing my.cnf in order to remove
gcomm:// is to start all cluster nodes with the following URL:
'pc.wait_prim=no' option which makes the node to wait for primary component indefinitely.) Then bootstrap the primary component by setting
'pc.bootstrap=1' on any one of the nodes.
Option list can be used to set backend parameters, like listen address, timeout values and such. In 0.7.x it was the only way to customize Galera behavior. Parameter values set in the option list are not durable and need to be resubmitted on every connection to cluster. Parameters specified in the URL take precedence over parameters specified elsewhere (e.g. wsrep_provider_options in my.cnf).
Parameters that can be set through the option list are “evs.*”, “pc.*”, “gmcast.*”.
Listen address and port
If not set in parameter list gcomm will listen on all interfaces.
If not set in parameter list listen port will be taken from the cluster address. If not specified in the cluster address the port will be set to default: 4567.