0

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.

manvith
  • 7
  • 5

2 Answers2

2
  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**
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
1

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

Pedro Gomes
  • 111
  • 1
  • 4
  • Need small clarification, according to mysql doc [link](https://dev.mysql.com/doc/refman/5.7/en/group-replication-monitoring.html) secondary will receive its data from the group members by using group_replication_applier channel, which is a replication channel of group replication. – manvith Dec 28 '18 at 05:55
  • The docs don't say exactly that, they say the group_replication_applier channel will be used to apply the data, not that the channel is the source of that data. So a traditional replication channel as a receiver (IO thread) and an applier (SQL thread). As in any modular application Group Replication will reuse some of the server components, so it uses the applier part and you can check it status on the performance schema tables for the applier status. But main point is: a GR group member is not a slave, as it can also do updates, so show slave status is not a good fit here. – Pedro Gomes Dec 29 '18 at 15:19
  • Small query, Is there any possibility to use same mysql server as a slave in master-slave replication as well as a member of a group in group replication? – manvith Jan 07 '19 at 16:05
  • Yes you can. All that the server receives as a slave will be replicated to the group. There are some restrictions though if you use single primary mode, there only the primary can be a slave. – Pedro Gomes Jan 09 '19 at 22:46