Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and deploy Nebula Graph

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to install and deploy Nebula Graph. It is very detailed and has a certain reference value. Friends who are interested must finish it!

Nebula Graph: an open source database of distributed maps. As the only database capable of storing trillions of nodes and edges with attributes, Nebula Graph can not only meet the requirements of millisecond low-latency query in high concurrency scenarios, but also achieve high service availability and ensure data security.

Brief introduction

Nebula Graph is an open source third-generation distributed graph database, which can not only store trillions of nodes and edges with attributes, but also meet the requirements of millisecond low-latency query in high concurrency scenarios. Different from Gremlin and Cypher,Nebula, it provides a query language nGQL of SQL-LIKE, which completes the operation of the CRUD of the graph through three combinations (pipes, semicolons and variables). RocksDB and HBase are currently supported in Nebula Graph in the storage layer.

Thanks to Nebula Graph community Committer Yixing Road for contributing this article.

The overall architecture of Nebula Graph

There are three main service processes in Nebula Graph:

Meta Service

Meta Service is the metadata management center of the whole cluster, which uses Raft protocol to ensure high availability. Two main functions are provided:

Manage various meta-information, such as Schema

Direct storage expansion and data migration

Storage Service

Storage Service is responsible for Graph data storage. The graph data is divided into many pieces of Partition, and the Partition of the same ID forms a Raft Group to achieve the consistency of multiple copies. The default storage engine for Nebula Graph is RocksDB's Key-Value storage.

Graph Service

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

GraphService is a stateless service that can be extended infinitely horizontally, and the execution plan of the computing layer will eventually be sent to the data node for execution.

Installation and deployment

Nebula Graph provides two deployment modes: stand-alone and cluster. Stand-alone deployment is mainly used for testing and experience. Cluster is recommended for production scenarios.

Stand-alone operation

The best way to practice or test Nebula Graph on a stand-alone machine is to run it through the Docker container, pull the image according to the documentation, and enter the container:

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

After entering the container, start all Services of Nebula first, and then connect to the graphd service inside the container through the Console client to execute the nGQL statement.

$cd / usr/local/nebula $. / scripts/nebula.service start all $. / bin/nebula-u user-p password (user@127.0.0.1) [(none)] > SHOW HOSTS = = | Ip | Port | Status | = | 172.17.0.2 | 44500 | online |-- Got 1 rows (Time spent: 15621 us 16775 us) Cluster deployment environment preparation

Nebula supports compilation and installation through packaged Package. Because Nebula is highly dependent, it is recommended to install it using an installation package for simplicity.

In this paper, three machines with CentOS 7.5 system are prepared, and the IP is as follows:

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

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.rpm

In addition, because some ports need to be opened for communication between Nebula services, firewalls on all machines can be turned off temporarily: (for more information on how to use ports, please see the configuration file below / usr/local/nebula/etc/)

$systemctl disable firewalld

This article will deploy the Nebula cluster as follows:

-cluster-14: metad/storaged/graphd-cluster-15: metad/storaged-cluster-16: metad/storaged installation

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

$rpm-ivh nebula-*.rpm

The default installation directory for Nebula is located in / 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 profile: nebula-metad.conf

Metad ensures high availability through the raft protocol, and the machine ip and port deployed by the service need to be configured for the service of each metad. It mainly involves two fields, meta_server_addrs and local_ip, and the others use the default configuration. Examples of two configurations on cluster-14 are as follows:

# Peers-meta_server_addrs=192.168.8.14:45500192.168.8.15:45500192.168.8.16:45500 # Local ip-local_ip=192.168.8.14 # Meta daemon listening port-port=45500

Second profile: nebula-graphd.conf

The graphd runtime needs to get schema data from metad, so the ip address and port option meta_server_addrs of the metad in the specified cluster must be displayed in the configuration, and others use the default configuration. The graphd configuration on cluster-14 is as follows:

# Meta Server Address-meta_server_addrs=192.168.8.14:45500192.168.8.15:45500192.168.8.16:45500

Third profile: nebula-storaged.conf

Storaged also uses the raft protocol to ensure high availability and communicates with metad during data migration, so you need to configure the address and port meta_server_addrs of metad and the native address local_ip, and its peers can be obtained through metad. Some of the configuration options on cluster-14 are as follows:

# Meta server address-- meta_server_addrs=192.168.8.14:45500192.168.8.15:45500192.168.8.16:45500 # Local ip-- local_ip=192.168.8.14 # Storage daemon listening port-- port=44500 starts 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

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

Note: some users may encounter

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

You can modify / etc/security/limits.conf yourself.

Test cluster

Log in to one of the clusters and execute the following command:

/ usr/local/nebula/bin/nebula-u user-p password-- addr 192.168.8.14-- port 3699 (user@192.168.8.14) [(none)] > SHOW HOSTS = = | Ip | Port | Status | = = | 192.168.8.14 | 44500 | offline |-- Got 1 rows (Time spent: 3511comp4024 us) above are all the contents of this article "how to install and deploy Nebula Graph". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report