Garafna HA with mysql replication

I have setup Grafana HA and it works pretty well.
Now want Mysql HA too hence I installed mysql on both grafana nodes to use local DB and setup MySQL replication in both direction (2 way mysql replication)

It works well in start for sometime and later started getting issue on mysql replication as below

Last_SQL_Errno: 1062
Last_SQL_Error: Could not execute Write_rows event on table grafana.annotation; Duplicate entry ‘2143’ for key ‘PRIMARY’, Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event’s master log mysql-bin.000004, end_log_pos 34111120

Does Grafana not support that?


You need to have one database connected to multiple grafana instances. If you then want to do replication it’s up to you I guess, but the database you’re replicating to should not be connected to your grafana instances.


Thank you @mefraimsson

Is there any plan for Grafana supports DB as 1:1 and have DB replication behind it?


Not sure I follow you. Are you asking for support of failover like active/passive? Otherwise my earlier point was that replication is something that you configure for a database. Or are you asking about having grafana instances in for example two different data centers with a replication between - that’s not supported and nothing we’re planning to support. The way we support this scenario today is by using datasource and dashboard provisioning.


@mefraimsson, yes I am looking for Grafana to support for active/passive failover concept with DB failover.

Think is interesting for you.