cluster-in-a-box

Description

Deploy a SingleStoreDB cluster locally.

This command conveniently runs various sdb-toolbox-config, sdb-deploy, and sdb-admin commands as a single command to produce a simple database configuration (a Master Aggregator and a leaf node) that can be connected to and queried. This SingleStoreDB "cluster" is meant for testing purposes.

If you already have the local host registered through sdb-toolbox-config, you will have to unregister the host before you can run this command.

The --password flag is a required and specifies the SingleStoreDB root password on each node. Note that the MEMSQL_PASSWORD environment variable is a safer alternative option for setting the password.

Wrap the password string in single quotes (') to avoid having the shell try to interpret any special characters included in the string.

To set up a cluster on more than one host, see sdb-deploy setup-cluster. By default, cluster-in-a-box deploys a leaf node per NUMA node if NUMA is available on the host.

Examples

sdb-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --password PASSW0RD

This will install the latest version of singlestoredb-server on the host and deploy a Master Aggregator and a leaf node on localhost.

A valid license is required. If you set a MEMSQL_LICENSE environment variable, you can omit the --license flag.

By default, the Master Aggregator node listens on the first free port (n) in the range 3306 to 3326, whereas the leaf node listens on the first free port in the range n+1 to n+200.

Each node will bind its socket to 127.0.0.1, which will prevent them from being accessible from other hosts. You may change these settings with the flags --master-port, --leaf-port, and --bind-address. You may specify --bind-address 0.0.0.0 to connect to the cluster from other hosts.

On hosts with NUMA configuration, you can set ports for leaf nodes using the --leaf-port flag. If --leaf-port is not specified, cluster-in-a-box will deploy m leaf nodes that will listen on the first free ports available in the range n+1 to n+200, where m represents the number of NUMA nodes available and n represents the Master Aggregator node port.

To disable optimizations, use the --no-optimize flag. This flag also disables NUMA optimization, which is enabled by default.

The password for the database root user can be set either with the --password flag, or in the MEMSQL_PASSWORD environment variable. If neither is specified, you will be prompted to enter the password. If you prefer to install a version other than the latest release, you may specify the desired version, or the path to a singlestoredb-server package:

sdb-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --version 6.7.0 --password PASSW0RD
sdb-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --version 7.1 --password PASSW0RD --force-package-format deb
sdb-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --file-path path/to/singlestoredb-server.deb --password PASSW0RD
sdb-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --file-path path/to/singlestoredb-server.rpm --password PASSW0RD
sdb-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --version 6.7.0 --password PASSW0RD --bind-address 0.0.0.0
sdb-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --password PASSW0RD --master-port 3333 --leaf-port 1234

Deploy the cluster on a host with 4 NUMA nodes

sdb-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --password PASSW0RD --master-port 3333 --leaf-port 4005,4006,4007,4008

Usage

Usage:
sdb-deploy cluster-in-a-box [flags]
Flags:
--bind-address IP Set the bind address for the master aggregator and the leaf nodes.
The default configuration makes the cluster unavailable outside localhost.
Set "--bind-address 0.0.0.0" to access nodes from a different IP (default 127.0.0.1)
--file-path ABSOLUTE_PATH The path to the singlestoredb-server package to install
--force-package-format {deb, rpm, tar} Specify 'deb', 'rpm', or 'tar' package format. Required if you have both dpkg and rpm package managers found on the host
-h, --help Help for cluster-in-a-box
--leaf-port PORTSLICE Have the leaf nodes listen on the specified ports (default [])
--license LICENSE The license for the cluster
--master-port PORT Have the master aggregator node listen on the specified port
--no-optimize Disable optimizations, including NUMA optimization
--password STRING The password for the database root user on each node. If a password is specified on the command line, it must not contain an unescaped '$' character as it will be replaced by the shell.
If a password is not specified on the command line, Toolbox will attempt to read the password from the ‘MEMSQL_PASSWORD’ environment variable.
If this variable is present but does not contain a value, or if the variable does not exist, Toolbox will prompt for a password
--preinstalled-path ABSOLUTE_PATH The path to the folder (must be of the form 'singlestoredb-server-<version>*' or 'memsql-server-<version>*') that contains the singlestoredb-server binaries. Depending on the mode of cluster deployment, the folder contains either the unpacked tarball file or the installed package file (Debian or RPM) of singlestoredb-server. (ADVANCED)
--skip-auto-config Skip automatic operating system configuration
--tar-install-dir ABSOLUTE_PATH The installation directory for the singlestoredb-server tarball on the target host. (ADVANCED)
--version VERSION The version of singlestoredb-server to install (default production:latest)
Global Flags:
--backup-cache FILE_PATH File path for the backup cache
--cache-file FILE_PATH File path for the Toolbox node cache
-c, --config FILE_PATH File path for the Toolbox configuration
--disable-colors Disable color output in console, which some terminal sessions/environments may have difficulty with
--disable-spinner Disable the progress spinner, which some terminal sessions/environments may have issues with
-j, --json Enable JSON output
--parallelism POSITIVE_INTEGER Maximum number of operations to run in parallel
--runtime-dir DIRECTORY_PATH Where to store Toolbox runtime data
--ssh-max-sessions POSITIVE_INTEGER Maximum number of SSH sessions to open per host, must be at least 3
--ssh-strict-host-key-checking Enable strict host key checking for SSH connections
--ssh-user-known-hosts-file FILE_PATH Path to the user known_hosts file for SSH connections. If not set, /dev/null will be used
--state-file FILE_PATH Toolbox state file path
-v, --verbosity count Increase logging verbosity: valid values are 1, 2, 3. Usage -v=count or --verbosity=count
-y, --yes Enable non-interactive mode and assume the user would like to move forward with the proposed actions by default

Remarks

This command is interactive unless you use either --yes or --json flag to override interactive behavior.

Output

The following example uses the cluster-in-a-box command to install a master aggregator and a leaf node on the local host.

sdb-deploy cluster-in-a-box --license <base64-encoded_license>
sdb-deploy will perform the following actions:
  · Install singlestoredb-server 7.3.10 locally
  · Deploy a master aggregator on port 3306
  · Deploy a leaf node on port 3307

Would you like to continue? [y/N]: y
✓ Downloaded singlestoredb-server 7.3.10
Installing SingleStoreDB locally...
✓ Installed SingleStoreDB 7.3.10 locally
✓ Deployed master aggregator on port 3306
✓ Deployed leaf node on port 3307

To view your cluster, run 'sdb-admin list-nodes'

Last modified: July 24, 2023

Was this article helpful?