Skip to content

Register the Storage Service

When connecting to Nebula Graph for the first time, you have to add the Storage hosts, and confirm that all the hosts are online.

Compatibility

  • Starting from Nebula Graph 3.0.0, you have to run ADD HOSTS before reading or writing data into the Storage Service.
  • In earlier versions, ADD HOSTS is neither needed nor supported.

Prerequisites

You have connnected to Nebula Graph.

Steps

  1. Add the Storage hosts.

    Run the following command to add hosts:

    ADD HOSTS <ip>:<port> [,<ip>:<port> ...];
    

    Example:

    nebula> ADD HOSTS 192.168.10.100:9779, 192.168.10.101:9779, 192.168.10.102:9779;
    

    Caution

    Make sure that the IP you added is the same as the IP configured for local_ip in the nebula-storaged.conf file. Otherwise, the Storage service will fail to start. For information about configurations, see Configurations.

  2. Check the status of the hosts to make sure that they are all online.

    nebula> SHOW HOSTS;
    +------------------+------+-----------+----------+--------------+----------------------  +------------------------+---------+
    | Host             | Port | HTTP port | Status   | Leader count | Leader distribution  |   Partition distribution | Version |
    +------------------+------+-----------+----------+--------------+----------------------  +------------------------+---------+
    | "192.168.10.100" | 9779 | 19669     | "ONLINE" | 0            | "No valid partition" | "No   valid partition"   | "3.1.0" |
    | "192.168.10.101" | 9779 | 19669     | "ONLINE" | 0            | "No valid partition" | "No   valid partition"   | "3.1.0" |
    | "192.168.10.102" | 9779 | 19669     | "ONLINE" | 0            | "No valid partition" | "No   valid partition"   | "3.1.0" |
    +------------------+------+-----------+----------+--------------+----------------------  +------------------------+---------+
    

    The Status column of the result above shows that all Storage hosts are online.


Last update: May 5, 2022