Nebula Graph: An open source distributed Graph database. As the only in-line database capable of storing trillions of configured nodes and edges, Nebula Graph not only meets the low-latency requirements of millisecond queries in high-concurrency scenarios, but also ensures high service availability and data security.

This article directory

  1. Introduction to the
  2. Nebula Integrated Architecture
    1. Meta Service
    2. Storage Service
    3. Graph Service
  3. Install the deployment
    1. Single machine running
    2. Cluster deployment
      1. Environment to prepare
      2. The installation
      3. configuration
    3. Test cluster

Introduction to the

Nebula Graph is an open source, third-generation distributed Graph database capable of storing trillions of attributed nodes and edges, but also for low-latency queries at the millisecond level in high-concurrency scenarios. Unlike Gremlin and Cypher, Nebula provides an SQL-like query language, nGQL, that performs CRUD operations on graphs in three combinations: pipes, semicolons, and variables. Nebula Graph currently supports both RocksDB and HBase on the storage tier.

Nebula Graph Committer Eshing Road for contributing this article.

Nebula Graph

nebula architexture

Nebula Graph has three main servicing processes:

Meta Service

Meta Service is the metadata management center for the entire cluster and uses Raft protocol to ensure high availability. It provides two main functions:

  1. Manage various meta-information, such as schemas
  2. Enables storage capacity expansion and data migration

Storage Service

Storage Service

Graph Service

The Graph Service, located in the computing layer of the architecture, is responsible for communicating with clients such as Console, parsing nGQL requests, and generating execution plans. The execution plan is optimized by the optimizer and handed over to the execution engine for execution. The execution engine requests the Schema of the point side from MetaService and obtains the data of the point side from the storage engine.

GraphService is a stateless service that can be extended indefinitely, and the execution plan of the computing layer is eventually delivered to the data node for execution.

Install the deployment

Nebula Graph offers two deployments: standalone and clustered. Single-node deployment is used for test and experience. Cluster deployment is recommended in production scenarios.

Single machine running

The best way to try out Nebula Graph or test it on a standalone machine is to run it through a Docker container, refer to the documentation, and pull the image into the container:

    $ docker pull vesoft/nebula-graph:latest
    $ docker run --rm -ti vesoft/nebula-graph:latest bash
Copy the code

Once inside the container, launch all of Nebula’s Services, then connect to the Graphd service inside the container via the Console client to execute the nGQL statements

    $ cd /usr/local/nebula $./scripts/nebula. Service start all $./bin/nebula -u user -p password ([email protected]) [(none)]> SHOW HOSTS; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | | Ip Port | Status | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | 172.17.0.2 | 44500 | online | ------------------------------- Got 1 rows (Time spent: 15621/16775 us)Copy the code

Cluster deployment

Environment to prepare

Nebula supports compilation and installation through a packaged Package. Because Nebula relies on so much, the installation package is recommended for simplicity.

This article prepared three machines with CentOS 7.5 system, IP is as follows:

    192.168.8.14 # cluster-14
    192.168.8.15 # cluster-15
    192.168.8.16 # cluster-16
Copy the code

Download the corresponding installation package on each machine:

$wget - O nebula - 1.0.0 - beta. El7-5. X86_64. RPM https://github.com/vesoft-inc/nebula/releases/download/v1.0.0-beta/nebula-1.0.0-beta.el7-5.x86_64.rpmCopy the code

In addition, because Nebula’s services require several ports to communicate with each other, you can temporarily turn off the firewall on all machines: (See the configuration file below for the ports used by /usr/local/nebula/etc)

    $ systemctl disable firewalld
Copy the code

This article deploys Nebula’s cluster as follows:

  - cluster-14: metad/storaged/graphd
  - cluster-15: metad/storaged
  - cluster-16: metad/storaged
Copy the code
The installation

Use RPM to install the installation package prepared in the previous step

    $ rpm -ivh nebula-*.rpm
Copy the code

The Nebula default installation directory is located at /usr/local/nebula

configuration

All configuration files for Nebula are located in the /usr/local/nebula/etc directory, and three default configurations are provided. Edit these configuration files separately:

First configuration file: Nebula – Tad

Metad ensures high availability through raft protocol, and each Metad service needs to be configured with the machine IP and port on which the service is deployed. The meta_server_addrs and local_IP fields are involved, and the default values of other fields are used. The following are two configuration examples on Cluster-14:

    # Peers- meta_server_addrs = 192.168.8.14:45500192168 8.15:45500192168 8.16:45500# Local ip- local_ip = 192.168.8.14# Meta daemon listening port
    --port=45500
Copy the code

Second configuration file: nebula- Graphd.conf

The Graphd runtime needs to get the schema data from Metad, so the configuration must show metad’s IP address and port options for the specified cluster, meta_server_addrs, and use the default Settings for the rest. The graphd configuration on Cluster-14 is as follows:

    # Meta Server Address- meta_server_addrs = 192.168.8.14:45500192168 8.15:45500192168 8.16:45500Copy the code

Third configuration file: nebula- Storaged

Storaged also uses raft protocol to ensure high availability and communicates with Metad during data migration. Therefore, you need to configure metad’s address and port meta_server_addrs and local address local_IP. Peers can be obtained through Metad. Some configuration options on Cluster-14 are as follows:

    # Meta server address- meta_server_addrs = 192.168.8.14:45500192168 8.15:45500192168 8.16:45500# Local ip- local_ip = 192.168.8.14# Storage daemon listening port
    --port=44500
Copy the code
Start the cluster

cluster-14

    $ /usr/local/nebula/scripts/nebula.service start all
    [INFO] Starting nebula-metad...
    [INFO] Done
    [INFO] Starting nebula-graphd...
    [INFO] Done
    [INFO] Starting nebula-storaged...
    [INFO] Done
Copy the code

cluster-15/cluster-16

    $ /usr/local/nebula/scripts/nebula.service start metad
    [INFO] Starting nebula-metad...
    [INFO] Done
    $ /usr/local/nebula/scripts/nebula.service start storaged
    [INFO] Starting nebula-storaged...
    [INFO] Done
Copy the code

Note: Some users may encounter

    [WARN] The maximum files allowed to open might be too few: 1024
Copy the code

Can modify the/etc/security/limits. Conf

Test cluster

Log in to one cluster and run the following command:

    $ /usr/local/nebula/bin/nebula -u user -p password --addr 192.168.8.14 --port 3699 ([email protected]) [(none)]> SHOW HOSTS; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | | Ip Port | Status | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = | 192.168.8.14 | 44500 | offline | ---------------------------------- Got 1 rows (Time spent: 3511/4024 us)Copy the code

The appendix

Nebula Graph: An open source distributed Graph database.

GitHub:github.com/vesoft-inc/…

Nebula graph. IO /cn/posts/

Weibo: weibo.com/nebulagraph