# SingleStore Server Config Files

The following directory structures reflect the default locations of a number of SingleStore processes and configuration files.

For deployments using RPM and Debian packages, SingleStore follows the Linux Standard Base (LSB) layout.

```
/opt/singlestoredb-server-<version>-<hash>/
├── memsqld            The memsqld process
└── memsqlctl          A tool to control and manage the nodes on a host

/etc/memsql/
└── memsqlctl.hcl      The memsqlctl configuration file

/etc/systemd/system
└── memsql.service     The memsql service file

```

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

| **File**             | **Location & Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | **Format**                                     |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| `memsqld`            | `/opt/singlestoredb-server-<version>-<hash>/memsqld`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Binary                                         |
|                      | The`memsqld`process.The`memsqld`process runs under the`memsql:memsql`user and group on each host, which owns all of theSingleStoredata and configuration files. This user and group are automatically created whenSingleStoreis deployed using a Debian or an RPM package, but must be created manually when deployed in a`sudo`-less environment using a tarball.The`memsqlctl`command can be used to start or stop`memsqld`and must be run by either the`memsql`user or the Linux`root`user (where, as`root`, this command is run as the`memsql`user).The user and group that can run`memsqld`can be changed in the node configuration file,`memsql.cnf`.**Note**: The location of the`memsqld`binary is dictated by the`singlestoredb-server`package during deployment. Specifying the location of the`memsqld`binary is only possible with[tarball-based deployments](https://docs.singlestore.com/db/v9.1/deploy/linux.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                |
| `memsqlctl`          | `/usr/bin/memsqlctl``/opt/singlestoredb-server-<version>-<hash>/memsqlctl`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Binary                                         |
|                      | A low-level tool used to control and manage the nodes on a host where`memsqlctl`is installed.Wraps several SQL commands that perform management tasks, and can be automated by popular configuration management tools.Controls the startup process of`memsqld`, which reads the node configuration file,[memsql.cnf](https://docs.singlestore.com/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-node-config-files.md), when starting up. As`memsqlctl`controls the`memsqld`process and node configuration,`memsqlctl`must be run as the user who runs`memsqld`, or a Linux user with`root`privileges.The`memsqlctl`tool is included in the`singlestoredb-server`/`memsql-server`package/tarball file along with theSingleStoredatabase engine.Similar, but not strictly equivalent, to[sdb-admin](https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/sdb-admin-commands.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |                                                |
| `memsqlctl.hcl`      | `/etc/memsql/memsqlctl.hcl`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | [HCL](https://github.com/hashicorp/hcl#syntax) |
|                      | The`memsqlctl`configuration file.This file can be used to override the default engine variable settings for the entireclusterand contains the following entries:<ul> <li><code>defaultInstallDir</code>: The default installation directory for nodes that are created by <code>memsqlctl</code>. Must be owned by the user specified by the <code>user</code> entry in this file. Default locations: <ul> <li><code>/var/lib/memsql</code>: RPM and Debian package-based deployments</li> <li><code>tarInstallDir/nodes</code>: Tarball-based deployments</li> </ul></li> <li><code>nodeMetadataFile</code>: The path to the <code>memsqlctl</code> state file, <a href="https://docs.singlestore.com/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-node-config-files.md">nodes.hcl</a>, where <code>memsqlctl</code> stores information about the nodes that reside on a host. Must be owned by the user specified by the <code>user</code> entry in this file.</li> <li><code>sslCaFile</code>: The path to the certificate authority (CA) certificate file, in PEM format. The path can be absolute or relative to the location of the <code>memsqlctl.hcl</code> file. Used by <code>memsqlctl</code> to authenticate the SingleStore server certificate on each node.</li> <li><code>user</code>: The user (username) that runs <code>memsqld</code> and that owns everything SingleStore-related on a host, including: <ul> <li>The <code>defaultInstallDir</code> and its contents</li> <li>The <code>nodeMetadataFile</code></li> <li>The <a href="https://docs.singlestore.com/db/v9.1/reference/configuration-reference/cluster-config-files/singlestore-node-config-files.md">memsql.cnf</a> files</li> <li>Data directories</li> <li>Log files</li> </ul> To change this value: <ul> <li>Update the <code>user</code> entry in this file</li> <li>Update the permissions on all SingleStore-related files and directories</li> <li>Restart all nodes on the host</li> </ul></li> </ul>Example`memsqlctl.hcl`file, with default values.`version = 1 nodeMetadataFile = "/var/lib/memsql/nodes.hcl" defaultInstallDir = "/var/lib/memsql" user = "memsql"`To prevent unintentionally running nodes as`root`,`memsqlctl`will display an error unless`user = "root"`is explicitly set in this file.The default installation process creates a`memsql:memsql`service user and group which runsSingleStore.All states, and all nodes created by`memsqlctl`on a host, are owned by the`memsql:memsql`user and group. |                                                |
| **`memsql.service`** | `/etc/systemd/system/memsql.service`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Text                                           |
|                      | The`memsql`service file.When the`memsql`service is enabled, all nodes on a host are restarted after the host is rebooted.WhenSingleStoreis deployed via package, the`memsql.service`file and the`memsql`service are created and enabled automatically.WhenSingleStoreis deployed via tarball, the`memsql.service`file and the`memsql`service must be created and enabled manually. The instructions for creating the`memsql.service`file and enabling the`memsql`service are included in each tarball-based[deployment guide](https://docs.singlestore.com/db/v9.1/deploy/linux.md).The following is an example`memsql.service`file.`[Unit] Description=SingleStore After=network.target  [Service] Type=oneshot RemainAfterExit=yes ExecStart=/opt/singlestore/singlestoredb-server/memsqlctl start-node  --yes --all ExecStop=/opt/singlestore/singlestoredb-server/memsqlctl stop-node  --yes --all Slice=system-memsql.slice TasksMax = 128000 LimitNICE=-10 LimitNOFILE=1024000 LimitNPROC=128000  [Install] WantedBy=multi-user.target`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |                                                |

***

Modified at: August 21, 2024

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

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