Outdated Version

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

create-node

Create a MemSQL node on a specific host.

Usage

Create a MemSQL node on a specific host.

memsql-admin create-node will create a MemSQL node on a registered host by
creating its config file and various data directories on the filesystem.
It will also by default start the node.

Example usages:

    memsql-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 MemSQL root password
will be set to "TEST_PASSWORD".

If you do not want to use the --password flag to pass in the MemSQL
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:

    memsql-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:

    memsql-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 MemSQL root password will not be set. You
will have to run 'memsql-admin change-root-password' to set it.


To configure the port (default 3306):

    memsql-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 memsql-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:

    memsql-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:

    memsql-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:

	memsql-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:

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

Usage:
  memsql-admin create-node [flags]

Flags:
      --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 MemSQL config file path on the target host
      --no-start                                   Do not start the node
  -p, --password STRING                            The 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)
      --tracelogsdir STRING                        Absolute path to the tracelogs dir on the target host
      --user STRING                                SQL user for setting a role
      --user-password STRING                       Password for SQL user

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

Before running this command, MemSQL must be installed on the host first. Use memsql-deploy install to install MemSQL on the host machine.

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