SingleStore Node Config Files

The following is an example of a default installation directory structure for two nodes on a host.

/var/lib/memsql/
├── <node-1>                   A node directory
|   |
|   ├── memsql.cnf             The node configuration file; also stores engine variables
|   |
│   ├── auditlogs              When audit logging is enabled, holds an audit
|   |                          log of all database activity from the cluster
|   | 
│   ├── data                   The node's data; the default backup
|   |   |                      directory for local backups made to “./”
|   |   |
│   │   ├── logs               Transaction logs used in node recovery and replication
|   |   |
│   │   └── snapshots          Database snapshots
|   |
│   ├── plancache              Files for plans in the plancache
│   └── tracelogs
│       └── memsql.log         The consolidated general/error log
|
├── <node-2>                   Same file and directory descriptions as node-1 above
|   ├── memsql.cnf
│   ├── auditlogs
│   ├── data
│   │   ├── logs
│   │   └── snapshots
│   ├── plancache
│   └── tracelogs
│       └── memsql.log
|
├── db_files                   The location from which data can be loaded locally if SECURE_FILE_PRIV
|                              has not been set to NULL; SECURE_FILE_PRIV can also be set to a
|                              different directory; refer to Setting SECURE_FILE_PRIV for more info.
|
└── nodes.hcl                  The memsqlctl state file; also referred to as the node metadata file;
                               contains information about the nodes that reside on a host

All nodes on a host and their data reside within a default installation, or "base," directory which is defined by:

  • The defaultInstallDir entry in the memsqlctl configuration file, memsqlctl.hcl.

  • The basedir entry in the node configuration file, memsql.cnf.

To locate the default node base directory on a host, run the memsqlctl env command.

memsqlctl env
+-------------------+---------------------------------+
| memsqlctlConfig   | /etc/memsql/memsqlctl.hcl       |
| defaultInstallDir | /var/lib/memsql                 |
| nodeMetadataFile  | /var/lib/memsql/nodes.hcl       |
| userInfo          | uid=985(memsql) gid=978(memsql) |
| user              | memsql                          |
+-------------------+---------------------------------+

The following table lists each configuration file and provides the location of each file, additional information about each file, and each file’s format.

File

Location & Description

Format

memsql.cnf

/var/lib/memsql/<node-ID>/memsql.cnf

HCL

The node configuration file.

Stores engine variables, the values of which are loaded when a node starts. Compatible extension of MySQL’s my.cnf file.

This file contains a basedir entry that defines the node base directory, which is /var/lib/memsql (or simply .) by default.

The location of this file can be overridden temporarily by either:

nodes.hcl

/var/lib/memsql/nodes.hcl

HCL

The memsqlctl state file.

Also referred to as the node metadata file.

The file where memsqlctl stores information about the nodes that reside on a host.

This file contains

  • A memsqlConfigPath entry that defines the location of the node configuration file, memsql.cnf, which is /var/lib/memsql/<node-ID>/memsql.cnf by default

  • Encrypted passwords for connecting to each node

The location of this file can be overridden:

If an error is displayed stating that the node metadata file (nodes.hcl) is missing, confirm that the permissions are set correctly on this file. By default, the memsql:memsql user and group have access to this file.

The following is an example of an empty nodes.hcl file.

version = 1

The following is an example of a nodes.hcl file for a single host, two-node cluster with one Master Aggregator and one leaf node. Note that the directory structure is equivalent for both the aggregator and leaf node, differing only by the node ID.

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: August 21, 2024

Was this article helpful?