You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/speedystore/README.md
+44-21Lines changed: 44 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,17 @@ The diagram below, taken from the [SingleStore documentation](https://docs.singl
15
15

16
16
17
17
### Overview of Process
18
-
* SingleStore
19
-
*Configure the SingleStore pipeline and metrics database
20
-
*Configure the "monitoring user"
21
-
* Grafana
22
-
*Configure the Grafana Datasource
23
-
* Import the SingleStore Dashboards into Grafana
18
+
*Configure SingleStore
19
+
*Create the SingleStore pipeline and metrics database
20
+
*Create the "S2MonitorUser"
21
+
*Configure Grafana
22
+
*Create the Datasource
23
+
* Import the SingleStore Dashboards
24
24
25
-
### Configure the SingleStore pipeline and metrics database
25
+
### Create the SingleStore pipeline and metrics database
26
26
27
27
The SingleStore Toolbox is used to deploy, administer, and manage a SingleStore cluster. We will use the `sdb-admin start-monitoring-kube` command to configure and start the monitoring. It has a number of flags to control its operations. See the [SingleStore documentation](https://docs.singlestore.com/db/v8.9/reference/singlestore-tools-reference/sdb-admin-commands/start-monitoring-kube/) for more information.
28
28
29
-
30
29
To configure and start the monitoring, including the metrics database, we will (eventually) submit the following command:
@@ -49,11 +48,11 @@ The default name for the SingleStore cluster in a SAS SpeedyStore deployment is:
49
48
If the cluster name is different than the default, be sure to use the correct value in subsequent commands.
50
49
51
50
#### The `user` and `password` parameters
52
-
A core part of the monitoring is the exporter process which collects the metric data from the cluster. The exporter process is typically run as the SingleStore 'root' user due to the permissions required. In addition, we will need the password for the SingleStore 'root' user.
51
+
A core part of the monitoring is the exporter process which collects the metric data from the cluster. The exporter process is typically run as the SingleStore 'root' user due to the permissions required.
53
52
54
53
NOTE: It is possible to run the process as another user but the user must have the low level permissions needed to create and control the metrics database and pipelines. Setting up an alternate user is out-of-scope for this sample and we will use the 'root' user.
55
54
56
-
You can use the following command to get the password for the 'root' user:
55
+
In addition, we will need the password for the SingleStore 'root' user. You can use the following command to get the password for the 'root' user:
By default, the `sdb-admin start-monitoring-kube` command will display some information and ask the user if they would like to continue. To skip this prompt and have the configuration continue automatically, we will incle the `--yes` parameter.
68
+
67
69
#### Accessing the Kubernetess Cluster
68
-
The `sb-admin` command needs to access the Kubernetes cluster on which SAS Viya and SingleStore are running. It does this through a Kubernetes configuration file. By default, the command will use the file identified in the `KUBECONFIG` environment variable or the `~/.kube/config` file are used to discover the cluster. Alternatively, the `--config-file` option can be used to specify the kube config.
70
+
The `sb-admin` command needs to access the Kubernetes cluster on which SAS Viya and SingleStore are running. It does this through a Kubernetes configuration file. By default, the command will use the file identified in the `KUBECONFIG` environment variable or the `~/.kube/config` file are used to discover the cluster. Alternatively, the `--config-file` option can be used to specify the kube config file.
69
71
70
72
#### Run the `sb-admin start-monitoring-kube` command
71
73
After setting all of the required parameters, submit the following command to configure and start the monitoring, including the metrics database:
After running the command, the exporter process, the pipeline and the metrics database are created. To confirm this, you can use the SingleStore Studio. For example, in the screenshot below, you can see the newly created **'metrics'** database:
93
+
Once completed, the exporter process, the pipeline and the metrics database have been created. To confirm this, you can use the SingleStore Studio. For example, in the screenshot below, you can see the newly created **'metrics'** database:
76
94

77
95
78
-
### Configure the "monitoring user"
79
-
Grafana will need to connect to the 'metrics' database and you should create a specific user to be used for that purpose. While the permissions required by this user to pull metrics from the database are fairly limited, it can be helpful to grant additional permissions so the user can be used to manage the metrics database, pipelines and the exporter process.
96
+
### Create the "S2MonitorUser"
97
+
You need to create a specific user that Grafana can use to connect to the 'metrics' database. While the permissions required by this user to pull metrics from the database are fairly limited, it can be helpful to grant additional permissions so this same user can be used to manage the metrics database, pipelines and the exporter process.
80
98
81
-
For example, you might grant the following permissions:
99
+
After logging into SingleStore with the admin user, you can submit `CREATE USER` and `GRANT` commands to create the user and grant the user the desired permissions.
82
100
83
-
`GRANT CLUSTER, SHOW METADATA, SELECT, PROCESS ON *.* to '{S2MonitorUser}'@'%';`
101
+
For example, the following command creates a user called `S2MonitorUser` and assigns it a password:
84
102
85
-
`GRANT SELECT, CREATE, INSERT, UPDATE, DELETE, EXECUTE, INDEX, ALTER, DROP, CREATE DATABASE, LOCK TABLES, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, CREATE PIPELINE, DROP PIPELINE, ALTER PIPELINE, START PIPELINE, SHOW PIPELINE ON metrics.* to '{S2MonitorUser}'@'%';`
103
+
`CREATE USER S2MonitorUser IDENTIFIED BY 'password123' REQUIRE NONE;`
86
104
87
-
Alternatively, you might GRANT the "monitoring user" minimal permissions, and create a second user ("monitoring administrator") to manage the metrics database, pipelines and the exporter process.
105
+
Then you might grant the following permissions:
106
+
107
+
`GRANT CLUSTER, SHOW METADATA, SELECT, PROCESS ON *.* to 'S2MonitorUser'@'%';`
88
108
89
-
|**TO DO: Where do you submit those commands? SingleStore CLI?**
109
+
`GRANT SELECT, CREATE, INSERT, UPDATE, DELETE, EXECUTE, INDEX, ALTER, DROP, CREATE DATABASE, LOCK TABLES, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, CREATE PIPELINE, DROP PIPELINE, ALTER PIPELINE, START PIPELINE, SHOW PIPELINE ON metrics.* to 'S2MonitorUser'@'%';`
110
+
111
+
Alternatively, you might GRANT the "monitoring user" minimal permissions, and create a second user ("monitoring administrator") to manage the metrics database, pipelines and the exporter process.
90
112
91
113
|**TO DO: Does the first GRANT statement only grant the _minimal_ permissions needed to pull metirics? And the 2nd grants the extended permissions needed to be an administrator?**
|**TO DO**: Is the service-name always _name_of_singlestore_cluster_ + "-dll"
131
+
108
132
If the name of the SingleStore cluster is not ***sas-singlestore-cluster***, you will need to update that portion of the ***url*** field in the file as well.
109
133
110
134
Copy the file to some location, update the necessary information and save your changes. We suggest copying the file into your `$USER_DIR/monitoring` sub-directory, i.e. the same directory used for any other customizations related to the metric monitoring components you have made to your deployment of SAS Viya Monitoring.
@@ -119,7 +143,6 @@ You can use the following command to apply the necessary label:
|**TO DO**: Is the service-name always _name_of_singlestore_cluster_ + "-dll"
123
146
124
147
### Import the SingleStore Dashboards into Grafana
125
148
To import the SingleStore dashboards into Grafana, you can use the `deploy_dashboards.sh` script found in the `monitoring/bin` sub-directory of this repository.
0 commit comments