Skip to content

Deploying Cluster

In this document, we will walk you through the process of deploying a Nebula Graph cluster. At the same time, we have deployed a cluster with Docker so that you can try it in minutes.

Prerequisites

Before you start deploying the Nebula Graph cluster, make sure that you have installed the latest Nebula Graph version on each host of your cluster. Installation method reference:

Because Nebula Graph have a lot of dependencies, we recommend installing with packages.

In this document, we prepared 3 machines with CentOS 7.5 system, the IPs are as follows:

192.168.8.14 # cluster-14
192.168.8.15 # cluster-15
192.168.8.16 # cluster-16

Services of Nebula Graph to Be Deployed

In this document, we are going to deploy the following services of Nebula Graph:

  • 3 replicas of nebula-metad service
  • 3 replicas of nebula-storaged service
  • 3 replica of nebula-graphd service
- cluster-14: metad/storaged/graphd
- cluster-15: metad/storaged/graphd
- cluster-16: metad/storaged/graphd

Modifying the Configuration Files

All configuration files of Nebula Graph are located in the /usr/local/nebula/etc directory. Nebula Graph provides three default configurations.

nebula-metad.conf

When deploying a cluster, you need to modify two parameters in the nebula-metad.conf file according to the services deployed on each node: local_ip and meta_server_addrs. local_ip needs to be changed to the node's IP, meta_server_addrs needs to be changed to ip:port of the meta service on the cluster. Multiple ip:port pairs need to be separated by commas.

Following is the two configuration on cluster-14 :

# Peers
--meta_server_addrs=192.168.8.14:45500,192.168.8.15:45500,192.168.8.16:45500
# Local ip
--local_ip=192.168.8.14
# Meta daemon listening port
--port=45500

nebula-graphd.conf

When deploying a cluster, you need to configure the metad address and port meta_server_addrs for the graphd service. Following is part of the configuration on cluster-14:

# Meta Server Address
--meta_server_addrs=192.168.8.14:45500,192.168.8.15:45500,192.168.8.16:45500

nebula-storaged.conf

When deploying a cluster, you need to configure the metad address and port meta_server_addrs and the local address local_ip for the storaged service. Following is part of the configuration on cluster-14:

# Meta server address
--meta_server_addrs=192.168.8.14:45500,192.168.8.15:45500,192.168.8.16:45500
# Local ip
--local_ip=192.168.8.14
# Storage daemon listening port
--port=44500

Starting Your Cluster

Please refer to the Start and stop Nebula Graph service documentation to start your cluster.

Testing Your Cluster

Log in to one host in the cluster and execute the following command:

[(none)]> SHOW HOSTS;
=============================================================================================================================================
| Ip           | Port  | Status | Leader count | Leader distribution                                 | Partition distribution               |
=============================================================================================================================================
| 192.168.8.14 | 44500 | online | 0            | No valid partition                                  | No valid partition                   |
---------------------------------------------------------------------------------------------------------------------------------------------
| 192.168.8.15 | 44500 | online | 3            | toy: 1, test: 1, basketballplayer: 1                | basketballplayer: 1, toy: 1, test: 1 |
---------------------------------------------------------------------------------------------------------------------------------------------
| 192.168.8.16 | 44500 | online | 0            | No valid partition                                  | No valid partition                   |
---------------------------------------------------------------------------------------------------------------------------------------------
| Total        |       |        | 3            | basketballplayer: 1, toy: 1, test: 1                | basketballplayer: 1, test: 1, toy: 1 |
---------------------------------------------------------------------------------------------------------------------------------------------

Last update: April 16, 2021