In existing setup we have 3 grafana-server machines connecting to 3 machine master-slave mysql cluster.
We are planning to have a HA MySql cluster setup with multiple master nodes distributed across couple of different geographical locations. There will be more grafana server machines and all of them will talk to MySql cluster via a load balancer.
My question is: do we need to have any change in grafana schema to enable it to work with multi master mysql setup? Are there any limitations (for e.g. grafana to be aware of a column that is created as primary key or such) in terms of using multi master mysql setup?
I am in the same boat as yours. Spent some time in connecting grafana to multi master mariadb galero cluster but no success. I saw it created multiople records instead of 1 in tables with no primary key. It would be great if you can help me if you have figured out the solution to this.
Sure Komal I’ll share what i learn with multi-master tryout.
So did you see same row repeated multiple times in a table? Any specific tables? Could you please share some more details about what you tried?
I am truing to push sessions into mariadb galero instead of files
SInce mariadb galero do not support Myisam storage engine, should I use innodb storage engine ?
When I am using innodb storage engine, I get deadlock error:
EROR[05-25|20:51:10] Request error logger=context userId=0 orgId=0 uname= error=“session(release): Error 1213: Deadlock found when trying to get lock; try restarting transaction” stack="/usr/local/go/src/runtime/panic.go:489
MyISam storage engine didn’t work as mariadb galero doesmn’t support it hence replication didn’t happen.
I have a similar setup. I am using 3 instances of grafana behind a k8s service. I have a mysql-galera cluster with 3 nodes. I am using this to store the dashboards, and grafana sessions. I have created the session table with type InnoDB. The replication is going through well. I have 2 dashboards and some alerts configured on them. The issue i am having is of session creation. Grafana instances creating too many sessions behind the scenes. Ex In a days time around 25k sessions. Is this a regular thing? Is there a configuration that i can use so that the http calls don’t create a new session every time? seems like these calls are going directly from grafana server and not originating from UI. Also i noted that the cleanup service only cleans up tmp files not the sessions in mysql. Over a period of time should we clean the sessions by ourselves? Following are the info logs…