memsqlctl

Overview

memsqlctl Config File (memsqlctl.hcl)

The memsqlctl config file, memsqlctl.hcl overrides the default settings for the entire system.

Default location

/etc/memsql/memsqlctl.hcl

Format

HCL

Settings

  • nodeMetadataFile: The path to the state file, where memsqlctl stores the set of nodes on this host. This must be owned by the user specified by the user option.

  • defaultInstallDir: The default installation directory for SingleStore nodes created by memsqlctl. This must be owned by the user specified by the user option. By default, a node’s data and directories are rooted in a base install directory, which is in the default install directory. To locate the default install directory on a host, run the memsqlctl env command.

    Note: The singlestoredb-server/memsql-server RPM and Debian packages configure defaultInstallDir to be /var/lib/memsql. On hosts with a tarball-based installation, defaultInstallDir defaults to tarInstallDir/nodes.

  • user: The username of the user that owns everything SingleStore-related on this host. This includes defaultInstallDir (and its contents), nodeMetadataFile, and any state related to SingleStore nodes (e.g., memsql.cnf files, data directories, log files, etc.). This is also the user that will run memsqld. To change this value, you will also need to update the permissions on all SingleStore-related files and directories and restart all SingleStore nodes on this host.

  • sslCaFile: The path to the certificate authority (CA) certificate file in the PEM format, which is used by memsqlctl to authenticate the SingleStore server certificate on each node. The path can be absolute or relative to the location of the memsqlctl.hcl configuration file.

Remarks

To prevent unintentionally running SingleStore nodes as the root user, memsqlctl will error unless you explicitly set user = "root" in the memsqlctl.hcl configuration file.

The default installation process will create a memsql service user and associated group (of the same name) which will run SingleStore. All state owned by memsqlctl and nodes created by memsqlctl on this host will be owned by the memsql Linux user and group.

Example

The following example shows a memsqlctl.hcl file with the default values.

version = 1
nodeMetadataFile = "/var/lib/memsql/nodes.hcl"
defaultInstallDir = "/var/lib/memsql"
user = "memsql"

memsqlctl State File (nodes.hcl)

The memsqlctl state file (sometimes called the node metadata file) contains information about SingleStore nodes that exist on that host.

Included are the location of the memsql.cnf used by that node and an encrypted password to use to connect to the node.

Default location

/var/lib/memsql/nodes.hcl

Format

HCL

Remarks

If you get an error that you are missing your node metadata file, make sure the permissions are set correctly for this file. By default, the memsql user must have access to it.

The location of this file can be overridden temporarily with the --node-metadata-file command-line flag or permanently with the nodeMetadataFile setting in memsqlctl.hcl.

Examples

Example 1 (empty)

The following is an empty state file.

version = 1

Example 2 (2 nodes)

The following is a state file for a host with two nodes.

version = 1
node {
memsqlConfigPath = "/var/lib/memsql/e3e100b7-f432-4129-b7f6-ebfc7d3993d3/memsql.cnf"
password {
cipherText = "sXDnREUKCJ3d2M1i6Nf2GGVVwfLqFiIvHy/Z6g=="
}
}
node {
memsqlConfigPath = "/var/lib/memsql/3825e8c8-5a5b-43f0-9162-8c8de242d661/memsql.cnf"
password {
cipherText = "J5t6bZiX+ktxWtifWbfOSBBrmTtd5PfrGOd3cA=="
}
}
secure = "q9gqg4JLdUiCcbwUPEQVWCdjmWezRrYT2ruvXy42/I4="

Last modified: November 21, 2022

Was this article helpful?