SingleStore DB

cluster-in-a-box
Description

Deploy a SingleStore DB cluster locally.

Usage
Deploy a SingleStore DB cluster locally

sdb-deploy cluster-in-a-box 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 SingleStore DB "cluster" is meant for testing purposes. 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.

Example usages:

    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:
  sdb-deploy cluster-in-a-box [flags]

Flags:
      --bind-address IPv4                      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
      --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. The folder contains the unpacked tarball file of singlestoredb-server. (ADVANCED)
      --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 colored output in console, which some terminal sessions/environments may have issues 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
      --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
  • If you already have the local host machine registered through sdb-toolbox-config, you will have to unregister the host machine before you can run this command.

  • --password is a required flag that specifies the SingleStore DB root password on each node. Note that the MEMSQL_PASSWORD environment variable is a safer alternative option for setting the password.

  • 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 machine.

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 SingleStore DB locally...
✓ Installed SingleStore DB 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'