Previous Next JavaScript must be enabled to correctly display this content

## Task for an Identical Node

To replace a failed Storage Node with an identical node, i.e. the target node uses the same host name, internet address, and port as the failed host.

1. Prerequisite information:

   1. The hostname and port number (registry port) of the machine in the cluster where the admin process is running ( e.g “host1” and 5000).

   2. The ID of the Storage Node to replace (e.g. "sn1").

      Note:

      The user can use the Admin CLI ping command to get the registry port and Storage Node Identifier of any failed Storage Node.

   3. Before starting the new Storage Node, the Storage Node to be replaced must be taken down. This can be done administratively or via failure.

   Note:

   The instructions below assume that the KVROOT in the target host is empty and has no valid data. When the new Storage Node Agent begins it starts the services that it hosts, which recovers their data from other hosts. The time taken for the recovery depends on the size of the shards involved and it happens in the background.

2. Create the configuration file of the failed host using the `generateconfig` command. The `generateconfig` command can be executed from any active host (machine) in the NoSQL cluster.

   The generateconfig's usage is:

       > java -Xmx64m -Xms64m \
       -jar KVHOME/lib/kvstore.jar generateconfig \
       -host <hostname> -port <port> -sn <StorageNodeId> -target <zipfile> \
       -security  <path to security login file>

   Parameter | Required | Description
   --- | --- | ---
   `host` | Yes | The host name of the failed storage node for which the config file is generated.
   `port` | Yes | The registry port of the failed storage node for which the config file is generated.
   `sn` | Yes | Identifier of the failed storage node.
   `target` | Yes | Full path of the zip file to be created.
   `security` | No | The client security configuration file. This parameter is only required if your store is secure. A fully qualified path to a file containing security information can be specified.

   For more information on generateconfig command, See generateconfig

   For example:

       > java -Xmx64m -Xms64m \
       -jar KVHOME/lib/kvstore.jar generateconfig -host adminhost \
       -port 13230 -sn sn1 -target /tmp/sn1.config.zip \
       -security USER/security/admin.security

   The command above creates the target "`/tmp/sn1.config.zip`" . This is a zip file with the required configuration to re-create the failed Storage Node. The top-level directory in the newly created zip file (`sn1.config.zip`) is the store's KVROOT.

   Note:

   This assumes that you must have followed the steps as mentioned in Create users and configure security with remote access.

3. Restore the Storage Node configuration on the target host:

   1. Copy the zip file `"sn1.config.zip"` to the target host.

   2. Unzip the archive into your target host's `KVROOT` directory. That is, if `KVROOT` is `/opt/kvroot`, then do the following:

          > cd /opt
          > unzip <path-to-sn1.config.zip>

      Note:

      If `kvroot` already exists under `/opt` directory , remove all the contents in the `kvroot` directory before unzipping the config file.

4. Restart the Storage Node on the target host.

       > java -Xmx64m -Xms64m \
       -jar KVHOME/lib/kvstore.jar start -root KVROOT

   Note:

   The hostname, port number and internet address of the target host and the failed node are the same. So no changes have to be done in the Storage Node pool and the topology of the store.