# 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](https://docs.singlestore.com/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-server-config-files.md) configuration file, [memsqlctl.hcl](https://docs.singlestore.com/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-server-config-files.md).
* 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.

```shell
memsqlctl env

```

```output

+-------------------+---------------------------------+
| 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](https://github.com/hashicorp/hcl#syntax) |
|              | 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:<ul> <li>The <a href="https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/sdb-admin-commands/update-node-base-install-dir.md">sdb-admin update-node-base-install-dir</a> command in Toolbox versions 1.16.1 and later</li> <li>The <a href="https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/sdb-admin-commands/update-node-basedir.md">sdb-admin update-node-basedir</a> command in Toolbox versions 1.11.4 through 1.16.0</li> </ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                |
| `nodes.hcl`  | `/var/lib/memsql/nodes.hcl`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | [HCL](https://github.com/hashicorp/hcl#syntax) |
|              | The[memsqlctl](https://docs.singlestore.com/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-server-config-files.md)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<ul> <li>A <code>memsqlConfigPath</code> entry that defines the location of the node configuration file, <code>memsql.cnf</code>, which is <code>/var/lib/memsql/&#x3C;node-ID>/memsql.cnf</code> by default</li> <li>Encrypted passwords for connecting to each node</li> </ul>The location of this file can be overridden:<ul> <li>Temporarily by running either:  <ul> <li>The <a href="https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/sdb-admin-commands/update-config.md">sdb-admin update-config --node-metadata-file</a>  command</li> <li>The  <a href="https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/memsqlctl-commands/update-config.md">memsqctl update-config --node-metadata-file</a> command</li> </ul></li> <li>Permanently by updating the <code>nodeMetadataFile</code> setting in the <code>memsqlctl</code> configuration file, <a href="https://docs.singlestore.com/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-server-config-files.md">memsqlctl.hcl</a></li> </ul>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="` |                                                |

***

Modified at: August 21, 2024

Source: [/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-node-config-files/](https://docs.singlestore.com/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-node-config-files/)

(An index of the documentation is available at /llms.txt)
