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
To monitor multiple Source clusters, be sure to name each Source cluster to identify the cluster in the visualization tool.cluster_
sync variable.
To perform this action, connect to the Master aggregator of the Source cluster and run the following SQL command:
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 any computer that can connect to the metrics
cluster.
Add the Grafana Monitoring Data Source
-
Connect to Grafana at
http://<grafana-hostname>:3000
and log in usingadmin
as both the username and password. -
Add a
monitoring
MySQL data source with the following settings.The SingleStore data source port is 3306
by default.-
Data source name:
monitoring
-
Data source type:
mysql
-
Data source host:
<any-metrics-cluster-aggregator-host-or-a-load-balancer>
-
Data source port:
3306
-
Database name:
metrics
-
User: Either
root
or the monitoring user specified earlier -
Password: Either a 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 SingleStore configuration.# # config file versionapiVersion: 1datasources:- name: monitoringtype: mysqlurl: <any-metrics-cluster-aggregator-host-or-a-load-balancer>:<port>database: metricsuser: Either root or the monitoring user specified earliersecureJsonData:password: Either a secure-password or blank if noneisDefault: 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: October 24, 2024