DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
FREEDOM251

Freedom251 › Blog › Database administration

How to Create a Multi-Node MySQL Cluster on Linux VPS Servers

By Freedom251 Team · · 11 min read

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

For a new high-availability deployment, build a MySQL InnoDB Cluster across three separate Linux VPS instances, keep the servers on a private network, use Group Replication for membership and failover, and put MySQL Router in front of the database nodes. A three-member group is the practical minimum because it retains a quorum after one server fails.

The safest workflow is to install the same supported MySQL release on all nodes, prepare InnoDB and GTID-based replication, use MySQL Shell AdminAPI to create and expand the cluster, then bootstrap Router and point the application at Router rather than at an individual database server. The sections below show the topology, network rules, configuration, commands, failover tests, and recovery procedures.

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 a multi-node MySQL cluster contains

MySQL InnoDB Cluster combines four pieces: MySQL Server on each database node, Group Replication for synchronous membership and transaction certification, MySQL Shell for administration, and MySQL Router for application connection routing. The common topology is one read/write primary and two read-only secondaries.

Component Role Where it runs
MySQL Server Stores InnoDB data and participates in Group Replication Every database VPS
Group Replication Replicates committed transactions, tracks membership, and elects a primary when required Every database VPS
MySQL Shell Runs AdminAPI checks, cluster creation, membership changes, and status commands An administration host or one secured database host
MySQL Router Discovers cluster metadata and sends client connections to the current primary or read-only members An application tier or dedicated routing host

In single-primary mode, only the elected primary accepts writes. The other members keep synchronized copies and can serve read traffic when your application uses a read-only Router endpoint. Group Replication detects a changed membership, but it does not rewrite existing client connections; Router or equivalent middleware is what gives applications a stable endpoint during a primary change.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Choose the number of VPS nodes from the failure you must survive

Group Replication requires a majority to make progress. MySQL documents the sizing rule as n = 2 × f + 1, where f is the number of involuntary failures the group should tolerate while retaining quorum.

Members Failures tolerated with automatic progress What a further failure means
3 1 A second lost member leaves one of three, so automatic progress stops
5 2 A third lost member removes the majority
7 3 A fourth lost member removes the majority

Three members are therefore the normal minimum for high availability. Put them on separate VPS instances, not three MySQL processes on one machine. Separate failure domains are useful: independent virtual machines, separate host hardware where available, and a private network with predictable latency. If you place members in different regions, measure the resulting latency and bandwidth before production; the official documentation does not define a universal VPS size or latency threshold.

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

Prepare the Linux VPS layer

Provision separate, reachable instances

  • Provision three VPS servers with the same Linux family and a supported, identical MySQL Server release.
  • Assign each server a stable private address. Do not use an address that changes when a VPS is restarted.
  • Create forward and reverse name resolution for names such as db1.internal, db2.internal, and db3.internal. Every member must resolve and reach every other member on the private network.
  • Keep MySQL data on persistent storage. Select CPU, memory, storage IOPS, and network capacity from measured workload requirements rather than a generic VPS size.
  • Install MySQL Shell on a locked-down administration host or on a database host accessible only to administrators.

Open only the required paths

Use host firewalls and, where available, the VPS provider’s private-network firewall. The SQL port and the Group Replication port have different trust boundaries.

Port Protocol Source and purpose
3306 TCP Application and administration networks to the SQL listener; restrict it to trusted sources
33061 TCP Bidirectional Group Replication traffic between all database members; keep it off the public internet
Router listener ports TCP Application hosts to the Router listeners you configure; do not expose them broadly
SSH TCP Administration network only, preferably through a bastion or private management path

Test connectivity from every node, not just from the administration host. A firewall that permits db1 to reach db2 but blocks db3 to reach db1 can produce incorrect membership reporting and failed joins.

getent hosts db1.internal db2.internal db3.internal
nc -vz db1.internal 33061
nc -vz db2.internal 33061
nc -vz db3.internal 33061

Prepare MySQL consistently on all members

Use InnoDB and compatible server settings

Store application tables in InnoDB. Other storage engines can cause Group Replication errors or leave tables outside the consistency model you expect. Install the same supported MySQL release on all three VPS servers and keep release compatibility in mind during upgrades.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Every member needs a unique positive server_id. Enable GTIDs and GTID consistency on every member because Group Replication uses GTIDs to identify committed transactions. Keep lower_case_table_names and default_table_encryption identical across the group. Use row-based replication settings supported by your selected release.

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.

Core configuration values

AdminAPI should generate release-specific Group Replication details, but each server must have a distinct identity and a distinct internal address. A minimal configuration outline looks like this; substitute the real private names and a single UUID shared by all members.

[mysqld]
server_id=101
gtid_mode=ON
enforce_gtid_consistency=ON
log_bin=binlog
binlog_format=ROW
log_replica_updates=ON
group_replication_group_name='3f4f6f7e-2f5d-4e6e-9f6a-7d5a1f5f7a11'
group_replication_local_address='db1.internal:33061'
group_replication_group_seeds='db1.internal:33061,db2.internal:33061,db3.internal:33061'
group_replication_start_on_boot=ON

On db2 and db3, change server_id and group_replication_local_address; keep the group UUID and seed list consistent. The local address is for Group Replication traffic, not for SQL administration. Do not copy a complete configuration file from one member without changing its identity.

Restart and verify before creating the group

After editing the MySQL configuration, restart each instance during a controlled maintenance window. Verify the effective values from SQL and confirm that the process is listening on the intended interfaces.

mysql -uroot -p -e "SELECT @@server_id, @@gtid_mode, @@enforce_gtid_consistency, @@lower_case_table_names, @@default_table_encryption;"
ss -lntp | grep 3306

Also verify that application tables use InnoDB and that no member has unique settings that would make it behave differently. Resolve DNS, firewall, certificate, and authentication problems before attempting a cluster join; fixing them after a partial join is harder to diagnose.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Create the cluster with MySQL Shell AdminAPI

1. Check the seed instance

Connect MySQL Shell in JavaScript mode to the intended first member. Use an administrative account with the privileges required by AdminAPI, and protect that account with TLS and a strong authentication policy.

mysqlsh --js [email protected]:3306

Run the instance validation before creating anything:

dba.checkInstanceConfiguration()

Address every reported error. Typical blockers include disabled GTIDs, an incompatible lower-case table setting, a duplicate server ID, non-InnoDB tables, missing binary logging, or a hostname that other members cannot resolve.

2. Let AdminAPI configure supported settings

AdminAPI is intended to avoid hand-editing every Group Replication option. After the check passes, configure the instance and repeat the check on the other two servers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
dba.configureInstance('[email protected]:3306')
dba.configureInstance('[email protected]:3306')
dba.configureInstance('[email protected]:3306')

Read the command output and restart a server when AdminAPI requests it. Configuration syntax and required variables can change between MySQL releases, so use the AdminAPI output for the installed release rather than copying an old blog configuration.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

3. Create a single-primary cluster

Connect to db1 again and create the cluster in single-primary mode. This mode is the normal starting point because it limits concurrent write conflicts and gives the application one clear write destination.

var cluster = dba.createCluster('prodCluster', {multiPrimary: false})
cluster.status()

The status should show db1 as the primary and an online group. Record the generated cluster name and metadata; Router will use that metadata later.

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

4. Add the remaining members

Add db2 and db3 through AdminAPI. If the instances contain no required data, AdminAPI can use MySQL Clone to provision a joining member. If they already contain data, follow the compatibility and provisioning checks reported by AdminAPI rather than attempting an ad hoc copy.

cluster.addInstance('[email protected]:3306')
cluster.addInstance('[email protected]:3306')
cluster.status()

Wait for each member to become ONLINE. Confirm that exactly one member is PRIMARY and that the other members are secondary/read-only members in the intended mode. Do not direct production traffic to a member that is still joining or recovering.

Single-primary and multi-primary are different operating models

Decision point Single-primary Multi-primary
Write conflicts Concentrated on one primary, so conflict handling is simpler Concurrent writes can conflict across members and require application-aware design
Failover Elects a replacement primary when the current one is lost Several members can accept writes, but conflict and certification failures are more visible
Application complexity One write endpoint through Router Applications must understand multi-writer behavior and retry conflicts correctly
Read scaling Reads can use secondary Router destinations Reads and writes can be distributed, subject to conflict and consistency trade-offs
Operational burden Lower for a first deployment Higher; choose it only with a documented workload reason
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Bootstrap MySQL Router for application failover

Router must be bootstrapped against the cluster metadata. Run it on an application tier or a dedicated routing host, not on an internet-facing address.

mysqlrouter --bootstrap [email protected]:3306 
  --directory /etc/mysqlrouter 
  --user mysqlrouter

Use the generated Router configuration as the application-facing endpoint. It contains listeners for read/write and, when enabled, read-only traffic. Keep direct db1, db2, and db3 addresses for administration and emergency recovery only.

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

Change the application’s connection string to the Router hostname and listener port. Test both a normal connection and a transaction that fails over. Router refreshes cluster metadata and routes new connections to the current primary; existing TCP sessions still need the application’s connection pool and retry policy to reconnect.

Protect Router and member traffic with TLS

Use TLS for client connections, recovery operations, and member traffic where supported by your deployment policy. Router supports TLS verification modes including VERIFY_CA and VERIFY_IDENTITY. With identity verification, certificate names must match the hostnames applications actually use. A certificate valid for db1.internal but a connection string that uses an unrelated alias will fail verification.

Store private keys with filesystem permissions that allow only the Router or MySQL service account to read them. Monitor certificate expiration and test certificate rotation before an emergency failover.

Validate quorum, routing, and failover before production

Check normal health

  • Run cluster.status() and confirm every intended member is ONLINE.
  • Confirm one primary in single-primary mode and verify that secondaries are not accepting unintended writes.
  • Check Group Replication membership, applier state, transaction backlog, disk space, memory pressure, and error logs.
  • Open an application connection through Router and verify that writes land on the primary and reads use the endpoint your design specifies.
  • Confirm that backups complete independently of replication. A replicated deletion is still a deletion on every member.

Exercise an unplanned primary loss

  1. Use a maintenance or test window and stop the primary MySQL service or isolate its private network interface.
  2. Watch cluster.status() until the remaining members agree on membership and a new primary is elected.
  3. Open a new application connection through Router and verify that it reaches the elected primary.
  4. Check the application’s connection-pool logs. Existing sessions may fail; the application must reconnect and retry only transactions that are safe to retry.
  5. Restore the failed VPS, inspect its logs, and rejoin it only after its data and configuration pass AdminAPI validation.

Exercise a planned switchover

Use the cluster’s supported primary-switching operation from MySQL Shell for a planned maintenance event rather than abruptly stopping the primary. Drain application traffic, perform the switchover, confirm Router metadata refresh, and then patch or reboot the former primary.

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.

Recovery procedures and routine operations

Rejoining a rebuilt VPS

Treat a rebuilt server as a new instance. Install the same MySQL release, restore consistent configuration values, assign a unique server ID and local Group Replication address, and verify DNS and firewall access. Run dba.checkInstanceConfiguration() before adding it. Allow AdminAPI to clone or otherwise synchronize the member according to the state it reports; do not attach a stale data directory by hand.

When the group loses quorum

If enough members disappear that no majority remains, automatic progress stops by design. Do not force multiple isolated nodes to accept writes. First determine which member has the authoritative, most recent state, restore private-network connectivity or recover failed VPS instances, and follow the MySQL release’s documented rebootstrap procedure. Record the event and investigate why quorum was lost before returning to production traffic.

Monitor the parts that can fail independently

  • Group membership and quorum.
  • Primary and secondary state, applier errors, and transaction backlog.
  • CPU, memory, disk capacity, storage latency, and network saturation on every VPS.
  • Router metadata refresh, listener availability, and connection errors.
  • TLS certificate expiry and hostname mismatches.
  • Private-network reachability and DNS consistency.
  • Backup success, restore duration, and the age of the newest restorable copy.

Plan upgrades as a runbook

Keep MySQL versions compatible during a rolling upgrade and follow the release-specific Group Replication and Router compatibility guidance. Upgrade one secondary, validate that it returns to ONLINE, perform a controlled primary switchover if required, and then upgrade the former primary. Never assume that a package upgrade preserves every configuration variable; rerun AdminAPI checks after each change.

Troubleshoot the common failure modes

Symptom Likely cause Action
AdminAPI refuses an instance GTID, server ID, storage engine, version, or naming inconsistency Run dba.checkInstanceConfiguration(), fix every reported item, restart if requested, and check again
Member never becomes ONLINE Blocked 33061/TCP, incorrect local address, DNS failure, or certificate/authentication problem Test bidirectional reachability from all members and compare the effective Group Replication addresses
Group has no primary Loss of quorum or an election that cannot complete Restore enough members and private connectivity; do not create parallel writable groups
Application keeps writing to a failed node Connection string points directly to a VPS or the pool has stale sessions Use Router for new connections, close failed sessions, and enable safe reconnect logic
TLS verification fails after routing changes Certificate names do not match the hostname used by the application or Router Use matching DNS names and certificate identities, then retest with strict verification
New member has unexpected data It was added with an incompatible or stale data directory Remove it from service, follow the AdminAPI provisioning path, and rejoin only after validation

Production readiness checklist

  • Three separate VPS instances are provisioned on a stable private network.
  • Every member has a unique positive server_id, a unique Group Replication local address, and the same group UUID.
  • Application tables use InnoDB; GTID mode and GTID consistency are enabled everywhere.
  • MySQL release compatibility, lower-case table behavior, encryption defaults, and row-based replication settings are consistent.
  • TCP 3306 is restricted to trusted application and administration sources; TCP 33061 is reachable only between members.
  • AdminAPI reports clean instance configuration, and all intended members show ONLINE.
  • Router is bootstrapped, protected with TLS, and used by the application instead of direct node addresses.
  • Connection pools handle dropped sessions and retry only transactions that your application can safely retry.
  • Planned switchover, unplanned primary loss, quorum loss, and rebuilt-member rejoin have been tested and documented.
  • Backups have been restored in a separate test, and monitoring covers membership, replication health, Router, certificates, resources, and network reachability.

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.

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

Database administrationGroup ReplicationHigh AvailabilityInnoDB ClusterLinux VPSMySQLMySQL Router

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.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.