Skip to content

Register the Storage Service

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

Compatibility

  • Starting from NebulaGraph 3.0.0, you have to run ADD HOSTS before reading or writing data into the Storage Service.
  • For NebulaGraph of versions earlier than 3.0.0 and NebulaGraph Cloud clusters, ADD HOSTS is not needed.

Prerequisites

You have connected to NebulaGraph.

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 | 19779     | "ONLINE" | 0            | "No valid partition" | "No   valid partition"   | "3.1.0" |
    | "192.168.10.101" | 9779 | 19779     | "ONLINE" | 0            | "No valid partition" | "No   valid partition"   | "3.1.0" |
    | "192.168.10.102" | 9779 | 19779     | "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: December 6, 2022