manvith
manvith

Reputation: 37

group replication vs master-slave replication

I want to know how can we differ master-slave replication and group-replication on a server.

will secondary server act as slave in mysql group replication? if yes, why show slave status on group replication member returns empty set.

Upvotes: 0

Views: 2054

Answers (2)

Gajendra Singh Rajput
Gajendra Singh Rajput

Reputation: 100

  1. The main difference b/w group replication and master-slave replication is Group replication has auto fail-over mechanism.

if a primary down then secondary become primary but in master-slave replication, we have to do it manually.

  1. Yes secondary server act as a Slave in GR, it is for read-only purpose.

  2. GR has a different command to see if all member in GR is synced with primary

    you can check here member state and member role

mysql> SELECT * FROM performance_schema.replication_group_members;


| CHANNEL_NAME                                      |MEMBER_ID|MEMBER_HOST|MEMBER_PORT | MEMBER_STATE|MEMBER_ROLE
  |group_replication_applier   | ce9be252 |  myhost1      |  24801         | **ONLINE      |Primary**

|group_replication_applier     | jk45ty45 |  myhost2        | 24801      | **ONLINE      |Secondary**

Upvotes: 2

Pedro Gomes
Pedro Gomes

Reputation: 121

A secondary is in many ways like a slave but it does not receive its data from a replication channel for example. So no, you will not see its status on show slave status.

You can check the status on such tables as:

replication_group_member_stats

or the group stats

replication_group_members

You can check the details on

https://dev.mysql.com/doc/refman/8.0/en/performance-schema-replication-tables.html

Upvotes: 1

Related Questions