Outdated Version

You are viewing an older version of this section. View current production version.

cluster-in-a-box

Deploy a MemSQL cluster locally.

Usage

Deploy a SingleStore DB cluster locally

memsql-deploy cluster-in-a-box conveniently runs various memsql-toolbox-config,
memsql-deploy, and memsql-admin commands as a single command to produce a simple
SingleStore DB 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 'memsql-deploy setup-cluster'.

Example usages:

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

This will install the latest version of memsql-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 will listen on port 3306 and the leaf node on port 3307.
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.

The password for the SingleStore DB 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 memsql-server package:

    memsql-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --version 6.7.0 --password PASSW0RD
    memsql-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --version 7.1 --password PASSW0RD --force-package-format deb

    memsql-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --file-path path/to/memsql-server.deb --password PASSW0RD
    memsql-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --file-path path/to/memsql-server.rpm --password PASSW0RD

    memsql-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --version 6.7.0 --password PASSW0RD --bind-address 0.0.0.0
    memsql-deploy cluster-in-a-box --license AAAAAAa/Aaa/AA== --password PASSW0RD --master-port 3333 --leaf-port 1234

Usage:
  memsql-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 memsql-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 PORT                         Have the leaf listen on the provided port (default 3307)
      --license LICENSE                        The SingleStore DB license for the cluster
      --master-port PORT                       Have the master listen on the provided port (default 3306)
      --password STRING                        The password for the SingleStore DB root user on each node
      --preinstalled-path ABSOLUTE_PATH        The path to the unpacked memsql-server binaries. The containing folder name must have the form memsql-server-<version>* (ADVANCED)
      --tar-install-dir ABSOLUTE_PATH          The directory to use for tar packages on the target host. (ADVANCED)
      --version VERSION                        The version of memsql-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                    Toolbox configuration file path
      --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 memsql-toolbox-config, you will have to unregister the host machine before you can run this command.

This command is interactive unless you use either the --yes or --json flags 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.

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

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

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