Is it possible to setup grafana ha with singlestore database as a repository database?

Hi All,

the default for the grafana database is mysql, postgre and sqlite3, i have option to use singlestore database as the database of grafana, but so many error because of the limitation of singlestore i assume, rather than to create new env which is more resources, i have singlestore cluster with ten nodes which is can be use if it can.

This is the error logs when i start the grafana-server service :

sql=“CREATE UNIQUE INDEX UQE_user_login ON user (login);”
logger=settings t=2023-04-03T13:14:55.491132195+07:00 level=info msg=“Starting Grafana” version=9.4.3 commit=cf0a135595 branch=HEAD compiled=2023-03-03T03:28:42+07:00
logger=settings t=2023-04-03T13:14:55.491395594+07:00 level=warn msg=“"sentry" frontend logging provider is deprecated and will be removed in the next major version. Use "grafana" provider instead.”
logger=settings t=2023-04-03T13:14:55.491430718+07:00 level=info msg=“Config loaded from” file=/usr/share/grafana/conf/defaults.ini
logger=settings t=2023-04-03T13:14:55.491445811+07:00 level=info msg=“Config loaded from” file=/etc/grafana/grafana.ini
logger=settings t=2023-04-03T13:14:55.491458738+07:00 level=info msg=“Config overridden from command line” arg=“default.paths.data=/var/lib/grafana”
logger=settings t=2023-04-03T13:14:55.491471588+07:00 level=info msg=“Config overridden from command line” arg=“default.paths.logs=/var/log/grafana”
logger=settings t=2023-04-03T13:14:55.491489112+07:00 level=info msg=“Config overridden from command line” arg=“default.paths.plugins=/var/lib/grafana/plugins”
logger=settings t=2023-04-03T13:14:55.491501609+07:00 level=info msg=“Config overridden from command line” arg=“default.paths.provisioning=/etc/grafana/provisioning”
logger=settings t=2023-04-03T13:14:55.491513632+07:00 level=info msg=“Path Home” path=/usr/share/grafana
logger=settings t=2023-04-03T13:14:55.491527101+07:00 level=info msg=“Path Data” path=/var/lib/grafana
logger=settings t=2023-04-03T13:14:55.491539986+07:00 level=info msg=“Path Logs” path=/var/log/grafana
logger=settings t=2023-04-03T13:14:55.491551893+07:00 level=info msg=“Path Plugins” path=/var/lib/grafana/plugins
logger=settings t=2023-04-03T13:14:55.491564169+07:00 level=info msg=“Path Provisioning” path=/etc/grafana/provisioning
logger=settings t=2023-04-03T13:14:55.491576116+07:00 level=info msg=“App mode production”
logger=sqlstore t=2023-04-03T13:14:55.491649514+07:00 level=info msg=“Connecting to DB” dbtype=mysql
logger=migrator t=2023-04-03T13:14:55.501622723+07:00 level=info msg=“Starting DB migrations”
logger=migrator t=2023-04-03T13:14:55.504216605+07:00 level=info msg=“Executing migration” id=“add unique index user.login”
logger=migrator t=2023-04-03T13:14:55.610351915+07:00 level=error msg=“Executing migration failed” id=“add unique index user.login” error=“Error 1744: The unique key named: ‘UQE_user_login(login)’ cannot be created because unique keys must contain all columns of the shard key ‘(id)’. See Why do I get errors about UNIQUE KEYs? for details on restrictions on unique keys in SingleStore.”
logger=migrator t=2023-04-03T13:14:55.610422208+07:00 level=error msg=“Exec failed” error=“Error 1744: The unique key named: ‘UQE_user_login(login)’ cannot be created because unique keys must contain all columns of the shard key ‘(id)’. See Why do I get errors about UNIQUE KEYs? for details on restrictions on unique keys in SingleStore.” sql=“CREATE UNIQUE INDEX UQE_user_login ON user (login);”

1 Like

That link says

“Have an application enforce the uniqueness of the proposed unique key”

If grafana had to do that kind of enforcement for every type of backend it would be unsustainable and code bloat I would think

But maybe others might have a solution