Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL8 - replication monitoring and alerts #5945

Open
dancvrcek opened this issue May 2, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@dancvrcek
Copy link

commented May 2, 2019

Feature idea summary

MySQL8 seems to have changed its replication status data. At least in situations, when one uses "mysqlsh" based management of an InnoDB cluster. (but I might have missed something, in which case I apologise).

Currently, the requirement is to give netdata@localhost the "replication client" privilege. However, "show slave status" only returns an empty set for us.

What seems to work is to use performance_schema database, and in particular "replication_group_members" table.

It shows the most important data for monitoring (at least in our case):

*************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
MEMBER_ID: 45079783-9385-11e8-9706-1605ec76d48e
MEMBER_HOST: a2
MEMBER_PORT: 3306
MEMBER_STATE: ONLINE
MEMBER_ROLE: PRIMARY
MEMBER_VERSION: 8.0.16
*************************** 2. row ***************************
CHANNEL_NAME: group_replication_applier
MEMBER_ID: 7d1dbd7b-5c44-11e9-8027-8ef83dffb8f9
MEMBER_HOST: a3
MEMBER_PORT: 3306
MEMBER_STATE: RECOVERING
MEMBER_ROLE: SECONDARY
MEMBER_VERSION: 8.0.16
*************************** 3. row ***************************
CHANNEL_NAME: group_replication_applier
MEMBER_ID: c66c22ce-5c46-11e9-b7de-1a4e03cb7ac2
MEMBER_HOST: a1
MEMBER_PORT: 3306
MEMBER_STATE: ONLINE
MEMBER_ROLE: SECONDARY
MEMBER_VERSION: 8.0.16

The change would probably require:

  1. extend / change privilege for netdata@localhost to include
    grant select on performance_schema.* to 'netdata'@'localhost';

  2. add a new metric "replication_group_members" with parameters

  • member_state with an array of values?
  • member_role ... dtto - to show which node is master
  1. alerts
  • change of the master
  • change of member state - from ONLINE to "something" and from "something" to RECOVERING and RECOVERING to ONLINE, I think the set of "something" is - OFFLINE, UNREACHABLE, ERROR, (MISSING)
Expected behavior
  1. Provide alerts on the member state changes and role changes.
  2. availability of badges for member state and role.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.