搭建nebula-CentOS集群(极速版)

环境准备

  • 系统

CentOS7.9

  • 机器

三台,分别为nebula01nebula02nebula03

  • 安装位置

/usr/local

  • nebula版本

2.6.1

  • nebula-graph-studio版本

3.2.3

快速开始

  • 下载tar.gz文件
1
2
3
cd /usr/local
wget https://oss-cdn.nebula-graph.com.cn/package/2.6.1/nebula-graph-2.6.1.el7.x86_64.tar.gz
wget https://oss-cdn.nebula-graph.com.cn/nebula-graph-studio/3.2.3/nebula-graph-studio-3.2.3.x86_64.tar.gz
  • 解压缩并重命名文件
1
2
tar -zxvf nebula-graph-2.6.1.el7.x86_64.tar.gz && mv nebula-graph-2.6.1.el7.x86_64 nebula
tar -zxvf nebula-graph-studio-3.2.3.x86_64.tar.gz && mv nebula-graph-studio-3.2.3.x86_64 nebula-graph-studio
  • 复制配置文件
1
2
3
4
cd nebula/etc
cp nebula-graphd.conf.default nebula-graphd.conf
cp nebula-metad.conf.default nebula-metad.conf
cp nebula-storaged.conf.default nebula-storaged.conf
  • 修改配置文件
1
vim nebula-graphd.conf
1
2
3
4
5
6
7
8
9
10
11
...
# The directory to host logging files
--log_dir=/data/nebula/logs
...
# Comma separated Meta Server Addresses
--meta_server_addrs=nebula01:9559,nebula02:9559,nebula03:9559
# Local IP used to identify the nebula-graphd process.
# Change it to an address other than loopback if the service is distributed or
# will be accessed remotely.
--local_ip=nebula01
...
1
vim nebula-metad.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
# The directory to host logging files
--log_dir=/data/nebula/logs
...
# Comma separated Meta Server addresses
--meta_server_addrs=nebula01:9559,nebula02:9559,nebula03:9559
# Local IP used to identify the nebula-metad process.
# Change it to an address other than loopback if the service is distributed or
# will be accessed remotely.
--local_ip=nebula01
...
# Root data path, here should be only single path for metad
--data_path=/data/nebula/meta
...
1
vim nebula-storaged.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
# The directory to host logging files
--log_dir=/data/nebula/logs
...
# Comma separated Meta server addresses
--meta_server_addrs=nebula01:9559,nebula02:9559,nebula03:9559
# Local IP used to identify the nebula-storaged process.
# Change it to an address other than loopback if the service is distributed or
# will be accessed remotely.
--local_ip=nebula01
...
# Root data path. Split by comma. e.g. --data_path=/disk1/path1/,/disk2/path2/
# One path per Rocksdb instance.
--data_path=/data/nebula/storage
...
  • 分发nebula文件,并修改对应的--local_ip
1
2
3
cd ../..
scp -r nebula nebula02:`pwd`/
scp -r nebula nebula03:`pwd`/
  • 启动集群

注:因为meta机器选择了nebula01、02、03共三台机器,启动时需要将三台同时执行命令拉起

1
nebula/scripts/nebula.service start all
  • 检查集群状态
1
nebula/scripts/nebula.service status all
1
2
3
[INFO] nebula-metad(de03025): Running as 24680, Listening on 9559 
[INFO] nebula-graphd(de03025): Running as 25453, Listening on 9669
[INFO] nebula-storaged(de03025): Running as 24787, Listening on 9779

此时nebula文件夹下生成cluster.id文件,集群成功启动

  • 启动nebula-graph-studio
1
2
cd nebula-graph-studio
nohup ./server &

注:同样可用于集群数据恢复(/data下的数据已备份)

Powered by Hexo and Hexo-theme-hiker

Copyright © 2017 - 2024 青域 All Rights Reserved.

UV : | PV :