w3resource

Removing a Node from Group Replication


Remove Member from Group Replication

Write MySQL commands to safely remove a member from Group Replication.

Solution:

-- On the server you want to remove:
STOP GROUP_REPLICATION;

-- Reset replication settings:
RESET MASTER;

-- On one of the remaining members:
SELECT * FROM performance_schema.replication_group_members;
-- Verify the member is no longer listed

Explanation:

  • Purpose of the Query:
    • Safely removes a server from the replication group to maintain group integrity.
  • Key Components:
    • Stops replication on the server to be removed, resets replication settings.
  • Real-World Application:
    • Useful for maintenance, decommissioning, or reassigning servers.

Notes:

  • Ensure all data synchronization is complete before removal.

For more Practice: Solve these Related Problems:

  • Write SQL to remove a member from Group Replication ensuring all pending transactions are processed.
  • Write SQL commands to safely take a node offline from a Group Replication cluster during heavy load.


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous MySQL Exercise: Change Primary in Group Replication.
Next MySQL Exercise: Check Replication Consistency.

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.