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 the SingleStore data and configuration files. This user and group are automatically created when SingleStore is 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.
|
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, 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 the SingleStore database engine.
Similar, but not strictly equivalent, to sdb-admin.
|
memsqlctl.hcl
|
/etc/memsql/memsqlctl.hcl
|
HCL
|
|
The memsqlctl configuration file.
This file can be used to override the default engine variable settings for the entire cluster and contains the following entries:
-
defaultInstallDir : The default installation directory for nodes that are created by memsqlctl . Must be owned by the user specified by the user entry in this file.
Default locations:
-
nodeMetadataFile : The path to the memsqlctl state file, nodes.hcl, where memsqlctl stores information about the nodes that reside on a host. Must be owned by the user specified by the user entry in this file.
-
sslCaFile : The path to the certificate authority (CA) certificate file, in PEM format. The path can be absolute or relative to the location of the memsqlctl.hcl file. Used by memsqlctl to authenticate the SingleStore server certificate on each node.
-
user : The user (username) that runs memsqld and that owns everything SingleStore-related on a host, including:
To change this value:
-
Update the user entry in this file
-
Update the permissions on all SingleStore-related files and directories
-
Restart all nodes on the host
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 runs SingleStore.
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.
When SingleStore is deployed via package, the memsql.service file and the memsql service are created and enabled automatically.
When SingleStore is 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.
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
|