Outdated Version

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

create-node

Info

SingleStore Managed Service does not support this command.

Create a SingleStoreDB node on a specific host.

Usage

Create a SingleStoreDB node on a specific host.

sdb-admin create-node will create a SingleStoreDB node on a registered host by
creating its config file and associated data directories on the filesystem.
This command will also start the node by default. If you are managing the node 
state with systemd (via sdb-systemd-client), consider running this command with 
the '--no-start' flag, and then start the node using 'sdb-admin start-node' or 
'sdb-admin restart-node'. 

Example usages:

    sdb-admin create-node --host host1 --password TEST_PASSWORD

This will create a node on host1 with its files in the default install directory
on host1. The node will also be started and the database root password
will be set to "TEST_PASSWORD".

If you do not want to use the --password flag to pass in the database
root password you may also set the environment variable "MEMSQL_PASSWORD".

The --password must be specified if the node will be started, but it may be set
to the empty string (equivalent to no password) for convenience in demo or
testing situations:

    sdb-admin create-node --host host1 --password ""


If you only want to lay out the node's data and directories on the filesystem
but do not want to start the process, set --no-start:

    sdb-admin create-node --host host1 --no-start

Note that you must NOT specify a password when you use --no-start and thus when
the node is eventually started, its SingleStoreDB root password will not be set. You
will have to run 'sdb-admin change-root-password' to set it.


To configure the port (default 3306):

    sdb-admin create-node --host host1 --password TEST_PASSWORD --port 3307


By default the node's data and directories will be rooted in a base install
directory (named a randomly generated UUID) which is in the default install dir.
To find out where the default install dir is on host1, run "memsqlctl env" on
host1. Note that the singlestoredb-server rpm and deb packages configure the default
install dir to be /var/lib/memsql.


If you want to change where the node's base install dir is on host1:

    sdb-admin create-node --host host1 --password TEST_PASSWORD --base-install-dir /memsql_node_1

This will lay out all of the node's data and directories on host1 in
/memsql_node_1. The filesystem will resemble:
/memsql_node_1
  memsql.cnf
  data/
  auditlogs/
  plancache/
  tracelogs/


If you want to change the location of only one directory and leave the rest
in a directory rooted in the default install dir on host1:

    sdb-admin create-node --host host1 --password TEST_PASSWORD --datadir /data/memsql_node_1/data

The filesystem will resemble:
{default install dir}
  {base dir}
    memsql.cnf
    auditlogs/
    plancache/
    tracelogs/

/data/memsql_node_1
  data/


In addition, the --role flag can be used to assign a role to the node
after creation. Possible roles are 'leaf', 'aggregator', and 'master'.

Create an aggregator node:

	sdb-admin create-node --host host1 --password TEST_PASSWORD --role aggregator

Some additional flags can be used to set role-specific options. 

For example, the role of 'master'
requires a license to be provided or the MEMSQL_LICENSE environment variable to be set:

	sdb-admin create-node --host host1 --password TEST_PASSWORD --role master --license your_license

Usage:
  sdb-admin create-node [flags]

Flags:
      --allow-ipv6                                 Allow the node to use IPv6
      --auditlogsdir STRING                        Absolute path to the auditlogs dir on the target host
      --availability-group INT                     Availability group to assign to the leaf node
      --base-install-dir STRING                    Absolute path to the base install directory on the target host
      --bind-address STRING                        The bind address
      --datadir STRING                             Absolute path to the data dir on the target host
      --disable-auto-restart                       Disable automatic restarting of memsqld on error
      --force-master                               Force-assigns the role of master, even if a master exists
  -h, --help                                       Help for create-node
      --host string                                Where to create the node
      --license LICENSE                            License to apply to the master node
      --memsql-config STRING                       Absolute path to the node config file path on the target host
      --no-start                                   Do not start the node
  -p, --password STRING                            The database user's password. 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 and --no-start is not set, 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
      --plancachedir STRING                        Absolute path to the plancache dir on the target host
  -P, --port PORT                                  The port
      --role {master, aggregator, leaf, unknown}   Role that a node will be assigned when created. Possible roles are LEAF, AGGREGATOR, and MASTER (default Unspecified)
      --ssl-fips-mode string                       Whether the node operates in OpenSSL/FIPS mode
      --tracelogsdir STRING                        Absolute path to the tracelogs dir on the target host
      --user STRING                                The database user for setting a role
      --user-password STRING                       The database user's password for setting the role. If a password is specified on the command line, it must not contain an unescaped '$' character as it will be replaced by the shell

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-control-persist SECONDS           Enable SSH ControlPersist and set it to the specified duration in seconds
      --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

Before running this command, SingleStore DB must be installed on the host first. Use sdb-deploy install to install SingleStore DB on the host machine.

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