October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Configure a Galera Cluster with MySQL: A Safe, Version-Aware Guide

A version-aware procedure for configuring Galera with MySQL: install compatible wsrep software, set the essential options, open replication ports, bootstrap one node, join the rest, and avoid split-brain recovery mistakes.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To configure Galera with MySQL, use a wsrep-enabled MySQL-compatible server and its matching Galera provider on every host, set the shared cluster and replication options in the server configuration, open the required network ports, bootstrap exactly one node with --wsrep-new-cluster (or the distribution’s bootstrap command), and start every other node normally. The bootstrap flag creates a new cluster; it must not be used for routine restarts or when joining an existing cluster.

The exact package names, provider-library path, service unit, SST method and bootstrap command vary between MySQL wsrep builds, MariaDB Galera releases and other vendor distributions. Treat the configuration below as a deployment plan, then substitute the syntax documented for your specific build.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What Galera changes about a MySQL deployment

Galera adds wsrep (Write Set Replication) to a MySQL-compatible server. Transactions are replicated between participating nodes and the cluster presents a primary component that can accept application traffic according to its configuration. Installing an ordinary MySQL server does not enable this behavior: the binary must include wsrep support, the Galera provider library must be installed, and the wsrep options must be turned on.

A working cluster therefore has four layers:

  • Compatible software: every node runs a wsrep-enabled server and a compatible provider generation.
  • Identity: nodes share one cluster name and peer list, while each node has a unique name and advertised address.
  • Replication settings: the provider, ROW binlogging, wsrep activation and InnoDB defaults are present.
  • Network and state transfer: Galera, IST, SST and client traffic can reach the addresses and ports that the server advertises.

A server process that starts successfully as a standalone database is not proof that it joined the Galera primary component. Always verify wsrep membership and state before sending application traffic to it.

Confirm the exact distribution before changing configuration

“MySQL with Galera” is not one universal package. Current documentation covers MariaDB Galera, MySQL wsrep builds and vendor distributions with different provider paths, systemd units and helper commands. Record these details for the release you are deploying:

Decision What to verify Why it matters
Server build The package explicitly includes wsrep support. A normal MySQL package will not become a Galera node merely because a few options are added.
Provider The installed Galera library path and provider generation match the server. An incorrect or incompatible library prevents startup or replication.
Service integration The service name and the distribution’s bootstrap helper, such as galera_new_cluster, or its equivalent. Bootstrap syntax is not identical across releases.
State transfer The selected SST method, its credentials and its donor behavior. A joining node may require a full state transfer before it can become synced.
Version policy Server, provider and node versions supported together by the vendor. Mixed versions can fail during startup, state transfer or protocol negotiation.

Do not copy a configuration from one distribution into another without translating the provider path, service commands and SST settings. Keep all nodes on a compatible release family unless the vendor documents a controlled upgrade path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan names, addresses and firewall rules

Choose one stable address for each node that the other nodes can reach. In cloud or multi-interface systems, explicitly bind and advertise the address used for replication; otherwise a node may publish an unreachable private, public or management interface.

The documented default traffic roles are:

Traffic Default port Purpose
Client connections 3306 Normal SQL traffic, unless the server is configured otherwise.
Galera replication 4567 Replication and cluster communication.
IST 4568 Incremental State Transfer for a node that is only slightly behind.
SST 4444 State transfer methods other than mysqldump, subject to the selected method.

Permit only the required sources in your firewall or security groups. At minimum, replication ports must be reachable between cluster members, and client port 3306 must be reachable from the application tier. A blocked 4567, 4568 or 4444 often appears as a join timeout rather than as a clear firewall error in the client application.

Build the option-file configuration

Put the shared cluster identity and replication settings in the server option file used by your distribution. The following is a structural template; replace values in angle brackets with the actual provider path, hostnames, node values and SST method supported by your build.

[mysqld]
wsrep_provider=<provider-library-path>
wsrep_cluster_name=<one-consistent-cluster-name>
wsrep_cluster_address=gcomm://<node-1-address>,<node-2-address>,<node-3-address>
wsrep_node_name=<unique-node-name>
wsrep_node_address=<reachable-node-address>
binlog_format=ROW
wsrep_on=ON
default_storage_engine=InnoDB
wsrep_sst_method=<method-supported-by-your-build>

Settings that must be consistent

  • wsrep_cluster_name identifies the logical cluster. Use the same value on every node.
  • wsrep_cluster_address contains the gcomm:// peer list used for discovery. Keep a usable list on every node, not just on the first node.
  • binlog_format=ROW is required for the documented Galera configuration.
  • wsrep_on=ON enables wsrep replication.
  • default_storage_engine=InnoDB keeps new tables on the engine expected by Galera.
  • wsrep_provider must point to the installed Galera provider library for that server build.

Settings that must be unique

Change wsrep_node_name and wsrep_node_address for each host. Duplicate node names or addresses make membership and troubleshooting ambiguous. The advertised address must resolve or route from every other node.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not persist an empty gcomm address

An empty gcomm:// tells a server to create a new cluster. The Galera documentation warns that placing this in persistent configuration can cause every restart to create a separate cluster instead of rejoining the original one. Keep bootstrap behavior transient and leave the normal peer list in the permanent option file.

Configure the cluster in a safe sequence

  1. Install compatible software on every host. Install the wsrep-enabled server and matching Galera provider. Confirm that the service can locate the provider library before attempting to form a cluster.
  2. Prepare host identity. Assign a unique node name and a stable, reachable node address to each host. Make sure DNS or static addressing resolves consistently from all members.
  3. Write the option file. Apply the shared cluster name, peer list, provider, ROW binlogging, wsrep activation, InnoDB default and SST method. Change only node-specific values between hosts.
  4. Open and test network paths. Test client access as well as member-to-member access for 4567, 4568 and the SST port required by the chosen method. Do this before bootstrap so a failed join is not confused with a configuration error.
  5. Bootstrap one node only. On the first node, use the distribution’s documented new-cluster command. Common forms are galera_new_cluster or starting the server with --wsrep-new-cluster. This creates the initial cluster UUID because no existing primary component is available.
  6. Start the remaining nodes normally. Do not add --wsrep-new-cluster. Start each service with its ordinary command; it should discover the bootstrapped node through wsrep_cluster_address and obtain state by IST or SST.
  7. Validate membership before production traffic. Check wsrep status, service logs and the cluster’s primary membership. Add application traffic only after the node reports a synchronized state and the cluster size is what you planned.

Bootstrap the first node without creating a split cluster

The first start is a special operation. Stop the database service if it is already running, then invoke the platform’s documented bootstrap procedure on exactly one selected host. For example:

sudo systemctl stop mysql
sudo galera_new_cluster

On a distribution without that helper, the equivalent is a service invocation that passes --wsrep-new-cluster to the server. The exact unit syntax differs, so use the command supplied for your package rather than inventing a second service definition. Once the first node is running, confirm that it formed a primary component before starting any peer.

Never use the new-cluster flag for an ordinary restart, maintenance reboot or join. The authoritative Galera warning is: “Do not use the –wsrep-new-cluster option when connecting to an existing cluster.” Using it on a second host can create an independent cluster UUID, leaving applications connected to different data sets.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Join the other nodes and handle state transfer

Start each additional node with the normal service command:

sudo systemctl start mysql

The joining node contacts peers in wsrep_cluster_address. If it has a sufficiently recent write set history, it can receive an Incremental State Transfer (IST) over the IST channel. If the missing history is no longer available, it receives a State Snapshot Transfer (SST) using the configured method. SST can require the dedicated transfer port and credentials, and it may temporarily make a donor serve a full copy of its state.

Do not judge success solely by a process state of “running.” A node can be running but non-primary, disconnected or still transferring. Wait for the node to become synchronized, then verify that the expected number of members is present.

Verify state from SQL and logs

Run the following checks on each node after startup:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
SHOW STATUS LIKE 'wsrep_cluster_size';
SHOW STATUS LIKE 'wsrep_cluster_status';
SHOW STATUS LIKE 'wsrep_local_state_comment';
SHOW STATUS LIKE 'wsrep_ready';
SHOW VARIABLES LIKE 'wsrep%';
  • wsrep_cluster_size should match the number of members you intentionally started.
  • wsrep_cluster_status should show the primary component rather than a non-primary state.
  • wsrep_local_state_comment should reach Synced after any IST or SST completes.
  • wsrep_ready should indicate that the node is ready to serve wsrep-backed traffic.

Read the database service log at the same time. Look for provider-load errors, failed peer connections, donor or joiner messages, SST authentication failures and address or port errors. A synchronized node plus the expected primary membership is the combination that demonstrates a successful join.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot a node that will not join

The service fails immediately

  • Check that the wsrep_provider path exists and belongs to a provider compatible with the server package.
  • Confirm that the option-file section is being read by the service you actually start.
  • Check for invalid option names, a malformed gcomm:// list or a provider-generation mismatch in the service log.

The node starts but remains standalone

  • Confirm that wsrep_on=ON is active and that the node is using the intended option file.
  • Check the cluster name and peer list against a known-good member.
  • Verify the advertised wsrep_node_address; a node may bind to localhost or an unreachable interface if this is omitted or wrong.
  • Test bidirectional reachability on the Galera port and inspect firewall or security-group rules.

The join hangs during SST or IST

  • Check port 4568 for IST and port 4444 for SST methods other than mysqldump, unless your configured method uses a different path.
  • Verify SST credentials and the selected method on donor and joiner.
  • Read both donor and joiner logs; an error on one side can look like a timeout on the other.
  • Allow the transfer to finish before judging cluster health. A node that is copying state is not yet ready for normal application use.

The cluster reports a non-primary component

Stop sending application traffic while membership is uncertain. Confirm which nodes are reachable, avoid bootstrapping an additional node, and use the documented full-outage recovery process if every member was stopped.

Recover after a complete outage

A full outage is different from restarting one member. When all nodes are down, identify the node with the most advanced sequence state. The Galera recovery procedure uses that node’s grastate.dat metadata: set safe_to_bootstrap: 1 on the correctly selected node, then run the platform’s recovery bootstrap command, commonly galera_new_cluster.

Do not set the flag arbitrarily and do not use recovery bootstrap as a routine restart shortcut. Choosing a node with stale state can discard the newest transactions or force an unnecessary state transfer. After the recovered node forms the primary component, start the remaining nodes normally and verify synchronization and membership before reopening application traffic.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operational safeguards for production

  • Keep the normal peer list in persistent configuration; keep new-cluster flags transient.
  • Document the selected bootstrap node, its address, the service unit and the exact recovery command for your release.
  • Monitor wsrep membership, local state, readiness and cluster size, not only the database process.
  • Record which SST method is configured, which ports it uses and how its credentials are rotated.
  • Test a planned restart of one node without --wsrep-new-cluster before relying on the cluster for production work.
  • Keep provider and server versions compatible during upgrades, and verify the vendor’s documented rolling-upgrade procedure.
  • Use firewall rules that allow only the application networks and cluster members that need each port.

Configuration checklist

  • Every host runs a wsrep-enabled server, not a stock server without wsrep.
  • The provider library is installed, readable and compatible with the server.
  • All nodes use one cluster name and a reachable peer list.
  • Each node has a unique name and advertised address.
  • binlog_format=ROW, wsrep_on=ON and default_storage_engine=InnoDB are active.
  • Ports 4567, 4568 and the selected SST port are allowed between members; client access uses the configured SQL port, normally 3306.
  • Only the first node was bootstrapped with the new-cluster procedure.
  • Joining nodes report primary membership, synchronization and readiness before applications connect.
  • Full-outage recovery uses the node selected from sequence state and safe_to_bootstrap, not an arbitrary restart.

The Bottom Line

A reliable Galera setup is mostly disciplined sequencing: install matching wsrep software, configure one shared identity with unique node addresses, open the replication and state-transfer paths, bootstrap one node once, and let every other node join normally. Keep bootstrap settings out of permanent configuration, validate wsrep state rather than process status alone, and reserve safe_to_bootstrap recovery for a genuine full-cluster outage.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.