# register-node

## Description

Register an existing node on the host.

The path to the node’s `memsql.cnf` file must be passed into the `--memsql-config` flag. The default location for this file is at `/var/lib/memsql/<UUID>/memsql.cnf` on the host. Also, the `auditlogs`, `data`, `tracelogs`, and `plancache` directories specified in `memsql.cnf` must be owned by the SingleStore user for that node. The default owner:group for each node is `memsql:memsql`.

The `register-node` command also assumes the node is online. If you are trying to register a node that is offline, you must specify `--force` when running this command. **Note**: This will cause `memsqlctl` to skip safety checks that require the node to be online (e.g., password is correct).

The `--password` flag is required and specifies the SingleStore `root` password for the node being registered. You can use this flag in conjunction with the `--user` flag to specify a SingleStore user that is different from the `root` user and the user’s password. 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.

## Usage

```
Usage:
  memsqlctl register-node [flags]

Flags:
      --auditlogsdir DIRECTORY_PATH   Path to the auditlogs directory
      --datadir DIRECTORY_PATH        Path to the data directory
      --force                         Skip safety checks that require the node be online (e.g., the password is correct). Use this flag to register an offline node
  -h, --help                          Help for register-node
      --memsql-config FILE_PATH       Path to the node config file
      --password STRING               The current database root password
      --pid-file FILE_PATH            Path to the current pid file
      --plancachedir DIRECTORY_PATH   Path to the plancache directory
  -P, --port PORT                     The current port
      --ssl-fips-mode string          Whether the node operates in OpenSSL/FIPS mode
      --tracelogsdir DIRECTORY_PATH   Path to the tracelogs directory

Global Flags:
  -c, --config FILE_PATH                     Path to the memsqctl config file
      --default-install-dir DIRECTORY_PATH   Path to the default install directory
      --insecure-ssl                         Fall back to insecure SSL connections to local nodes if memsqlctl is unable to otherwise establish a connection (ADVANCED)
  -j, --json                                 Print output in JSON format
      --node-metadata-file FILE_PATH         Path to the node metadata file
      --parallelism POSITIVE_INTEGER         Maximum amount of operations to be run in parallel
      --ssl-ca FILE_PATH                     The path to the CA certificate file (in PEM format) to authenticate the database certificate
      --timeout duration                     Maximum time for operation to complete (e.g., 30s, 10m, 1.5h)
      --verbose-json                         Print output in JSON format, include some warnings and user messages
  -v, --verbosity count                      Increase logging verbosity
  -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.
* The `memsqlctl register-node` command is equivalent to the [sdb-admin register-node](https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/sdb-admin-commands/register-node.md) command.

## Output

The following example shows how to register an existing node with a different `memsql.cnf` file.

```shell
sudo memsqlctl register-node --memsql-config /tmp/memsql.cnf

```

```output

memsqlctl will perform the following actions:
  · Register node on port 3308
    - Config file = /tmp/memsql.cnf
      + datadir = /tmp/data
      + plancachedir = /tmp/plancache
      + tracelogsdir = /tmp/tracelogs
      + auditlogsdir = /tmp/auditlogs

Would you like to continue? [y/N]: y

```

***

Modified at: April 22, 2024

Source: [/db/v9.1/reference/singlestore-tools-reference/memsqlctl-commands/register-node/](https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/memsqlctl-commands/register-node/)

(An index of the documentation is available at /llms.txt)
