Connect Data Visualization Tools
On this page
After configuring the metrics
database, you can connect data visualization tools such as Grafana to your cluster’s monitoring data.
Note
If you may monitor multiple Source clusters, make sure to name each Source cluster to identify the cluster in the visualization tool.cluster_
sync variable.SET GLOBAL cluster_
Alternatively, you can run the following Toolbox command on a host where Toolbox is set up to manage the Source cluster: sdb-admin update-config --key cluster_
Configure Grafana
Note: If you already have Grafana installed, you may skip to Add the Grafana Monitoring Data Source.
Install Grafana
If a Grafana instance is not already available, install the latest version of Grafana on the collecting Master Aggregator host.
Add the Grafana Monitoring Data Source
Note
For those SingleStoreDB instances that don’t run database queries as root
, this requires both admin privileges and SELECT
and EXECUTE
grants to the metrics
database as per GRANT.
For example:
GRANT SELECT, EXECUTE ON metrics.
where <user>
is the user other than root
under which these queries will be run.
-
Connect to Grafana at
http://<grafana-hostname>:3000
and log in usingadmin
as the username andadmin
as the password. -
Add a
monitoring
MySQL data source with the following settings.The SingleStoreDB data source port is 3306
by default.-
Data source name:
monitoring
-
Data source type:
mysql
-
Data source host:
<metrics-cluster-master-aggregator-host>
-
Data source port:
3306
-
Database name:
metrics
-
User:
root
-
Password:
<secure-password-or-blank-if-none>
-
-
Alternatively, edit the
sample.
file in theyaml /etc/grafana/provisioning/datasources
directory and add the following content, substituting the values in angle brackets with your SingleStoreDB configuration.# # config file versionapiVersion: 1datasources:- name: monitoringtype: mysqlurl: <metrics-cluster-master-aggregator-host>:<port>database: metricsuser: rootpassword: <secure-password-or-blank-if-none>isDefault: trueversion: 1 -
Restart the Grafana server.
sudo systemctl restart grafana-server
Connect the Grafana Dashboards
Note
You may need Editor privileges to create new Grafana dashboards.
-
Download the cluster monitoring dashboards from SingleStore.
-
Import the dashboards into Grafana.
To import a dashboard, click the +
icon in the side menu, and then click Import.From here you can upload a dashboard JSON file, paste a Grafana. com dashboard URL, or paste dashboard JSON text directly into the text area. -
Alternatively, edit the
sample.
file in theyaml /etc/grafana/provisioning/dashboards/
directory and add the following content.# # config file versionapiVersion: 1providers:- name: 'default'orgId: 1folder: ''folderUid: ''type: fileoptions:path: /var/lib/grafana/dashboardsNext, copy the dashboard JSON files to the
/var/lib/grafana/dashboards
directory and ensure that the dashboards are owned bygrafana:grafana
(viachown grafana:grafana *
). -
Restart the Grafana server.
sudo systemctl restart grafana-server
View Monitoring Data from Multiple Clusters (Optional)
You can view monitoring data from multiple source clusters in a single Grafana instance using the following steps:
-
Ensure that all cluster monitoring data is stored in a single database (on the
metrics
cluster).This will allow a single Grafana datasource to be configured. -
On each source cluster, enable the exporter process.
-
On the
metrics
cluster, run sdb-admin start-monitoring for each source cluster and store the monitoring data in the same database. -
Name each Source cluster to allow Grafana to identify the cluster.
For more information, see Note. -
Use the cluster tab in the Grafana UI to toggle between monitoring data from each source cluster.
Related Resources
Last modified: September 5, 2023