目录
1. 什么是 Nebula Graph
2. 部署 Nebula Graph 集群
2.1. 下载
2.2. 环境
2.3. 安装
2.4. 集群配置
2.5. 系统配置
2.5.1. 修改最大文件打开数
2.6. 启动
2.7. 检查
1. 什么是 Nebula Graph
Nebula Graph is an open-source, distributed, easily scalable, and native graph database. It is capable of hosting graphs with hundreds of billions of vertices and trillions of edges, and serving queries with millisecond-latency.
2. 部署 Nebula Graph 集群
2.1. 下载
2.2. 环境
使用 5 台服务器部署 Nebula Graph 集群
2.3. 安装
在 Nebula Graph 集群的所有服务器上,都安装 Nebula Graph。
sudo rpm -ivh nebula-graph-2.5.1.el8.x86_64.rpm
2.4. 集群配置
需要我们修改 Nebula Graph 的配置文件包含:
它们都在 Nebula Graph 安装目录下的 etc 目录中
注:Nebula Graph 的默认安装位置为
/usr/local/nebula
每台机器上需要修改的文件,如下图所示:
2.5. 系统配置
2.5.1. 修改最大文件打开数
修改配置文件:
/etc/security/limits.conf
在该配置文件中添加:
* soft nofile 65535
* hard nofile 65535
2.6. 启动
根据集群中服务器的用途,启动对应服务:
sudo /usr/local/nebula/scripts/nebula.service start <metad|graphd|storaged|all>
sudo /usr/local/nebula/scripts/nebula.service start all
sudo /usr/local/nebula/scripts/nebula.service start graphd
sudo /usr/local/nebula/scripts/nebula.service start storaged
2.7. 检查
官方提供了 Nebula Console 工具,可直接从 GitHub 上下载,这是个可执行文件,找一台服务器放上就行(不需要跟 Nebula Graph 集群放到一起),无须安装。
为了方便,将此文件命名为 nebula-console:
rename nebula-console-linux-amd64-v2.5.0 nebula-console
赋予 nebula-console 可执行权限:
chmod a+x nebula-console
连接到集群中任意一台机器上:
./nebula-console --addr 10.1.51.156 --port 9669 -u root -p nebula
执行命令:
SHOW HOSTS
至此
Nebula Graph 集群环境
搭建完成
参考:
Deploy Nebula Graph cluster with RPM/DEB package: https://docs.nebula-graph.io/2.5.1/4.deployment-and-installation/2.compile-and-install-nebula-graph/deploy-nebula-graph-cluster/ nebula-console: https://github.com/vesoft-inc/nebula-console/releases