# register-host

## Description

Registers a host in the cluster.


> **📝 Note**: SingleStore is not automatically deployed to a host when running this command. Rather, this command must be used in conjunction with other Toolbox commands to:- Add a host to a cluster to increase capacity
> - Add a host back to a cluster
> - Replace a host in a clusterRefer to [Cluster Expansion Steps](https://docs.singlestore.com/db/v9.1/user-and-cluster-administration/maintain-your-cluster/resize-your-cluster/cluster-expansion-steps.md) for additional information.

This command writes the host name and SSH details to the state file maintained by Toolbox.

The `--host` flag provides SSH connection details for this host. The value follows standard SSH format `[username@]hostname[:port]`. The hostname portion of this value will be used as the cluster-addressable hostname if `--cluster-hostname` is not also specified.

The `--cluster-hostname` option provides the ability to override the cluster hostname for the host they are registering. Toolbox will use this value when configuring intra-node communication.  Only specify the cluster hostname without other metadata such as username or port. For example: `singlestore-abc.domain` rather than `singlestore-abc.domain:3306`.

The `--identity-file` flag provides an optional SSH private key to be used to connect to the host.

Include the `--tar-install-state <state-file-name-including-path>` option to specify where to write the `tarInstallState` file on a host, which can be outside of the `tarInstallDir`. By default, this file is named `packages.hcl` and resides in the `tar` install directory as specified by the `--tar-install-dir` option, which is the recommended configuration.

**Examples**

```shell
sdb-toolbox-config register-host --host 127.0.0.1 --localhost
```

```shell
sdb-toolbox-config register-host --host user@192.0.12.3:50 --cluster-hostname first_host
```

## Usage

```
Usage:
  sdb-toolbox-config register-host [flags]

  For flags that can accept multiple values (indicated by VALUES after the name of the flag),
  separate each value with a comma.

Flags:
      --allow-duplicate-host-fingerprints   Whether to allow hosts with identical SSH host keys. (ADVANCED)
      --cluster-hostname SSH_ADDRESS        The cluster-addressable hostname for this host. Tools will use this value to configure intra-node communication. Specify the hostname without additional parameters (e.g., memsql-abc.domain instead of memsql-abc.domain:3306)
  -h, --help                                Help for register-host
      --host SSH_ADDRESS                    SSH connection details for this host in the standard SSH [username@]hostname[:port] format. The hostname value will be used as the cluster-addressable hostname if '--cluster-hostname' is not specified
  -i, --identity-file ABSOLUTE_PATH         The identity file for the host
      --localhost                           Whether this instance of Toolbox is located on the host
      --memsqlctl-config-path string        The path to the memsqlctl.hcl file on the target host. (ADVANCED)
      --memsqlctl-path string               The path to the memsqlctl binary on the target host. (ADVANCED)
      --skip-auto-config                    Skip automatic operating system configuration
      --skip-validation                     Skip validation of --memsqlctl-path and --memsqlctl-config-path
      --tar-install-dir string              The directory to use for tar packages on the target host. (ADVANCED)
      --tar-install-state string            The path to the packages.hcl file on the target host. (ADVANCED)

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

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

## Output

The following example uses the `register-host` command to register the current local host as a host for cluster deployment.

```shell
sdb-toolbox-config register-host --host node-1 --localhost

```

```output

Toolbox is about to register the following host:
  · Host: node-1
  · Localhost: true

Would you like to continue? [y/N]: y
✓ Successfully registered host node-1
+----------------+------------+-------------+---------------+
|      Host      | Local Host | SSH address | Identity File |
+----------------+------------+-------------+---------------+
| node-1         | Yes        |             |               |
+----------------+------------+-------------+---------------+

```

***

Modified at: July 2, 2024

Source: [/db/v9.1/reference/singlestore-tools-reference/sdb-toolbox-config-commands/register-host/](https://docs.singlestore.com/db/v9.1/reference/singlestore-tools-reference/sdb-toolbox-config-commands/register-host/)

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