SingleStore DB

Additional Connection Examples
Add a Cluster Name

SingleStore DB’s monitoring solution allows multiple clusters to be monitored in a given remote database. If multiple clusters have been configured in a single metrics database, you can specify which one to use in Studio via the monitoringClusterName setting. By default, this is named memsql_cluster which is controlled by the cluster_name engine variable.

To display the name of your cluster, run the following SQL command.

SHOW VARIABLES like "%name%"; 

The following is an example of using the state file to change the cluster name via the cluster_name setting.

version = 1

cluster "localhost" {
  name                = localhost
  description         = ""
  hostname            = "127.0.0.1"
  port                = 3306
  profile             = "DEVELOPMENT"
  websocket           = false 
  monitoring          = {
    isLocal = true
    reuseCredentials = false
    username = “user”
    password = “password”
    monitoringDatabaseName = "metrics"
    monitoringClusterName = "my_development_cluster" 
  }
}
Connect with Different Credentials

The following state file example shows a remote monitoring database with different credentials than the source. In this example, both isLocal and reuseCredentials are set to false, and the hostname, port, username, and password are provided.

version = 1

cluster "localhost" {
  name                = localhost
  description         = ""
  hostname            = "127.0.0.1"
  port                = 3306
  profile             = "DEVELOPMENT"
  websocket           = false 
  monitoring          = {
    isLocal = false
    hostname = “127.0.0.1”
    port = 1000
    reuseCredentials = false
    username = “user”
    password = “password”
    monitoringDatabaseName = "metrics" 
  }
}