hugegraph图集群部署

hugegraph图集群部署

构架说明

设备IP 角色 配置
83.1.12.1 cassandra-speed、 hugegaph-master 32C64G10T
83.1.12.2 cassandra-speed、 hugegaph-worker 32C64G10T
83.1.12.3 cassandra-worker、hugegaph-worker 32C64G10T
83.1.12.4 cassandra-worker、hugegaph-worker 32C64G10T
83.1.12.5 cassandra-worker、 hugegaph-worker 32C64G10T
83.1.12.6 cassandra-worker、hugegaph-worker 32C64G10T
1
jdk版本为1.8
1
2
3
4
5
本次使用cassandra作为后端存储

使用版本如下 其他版本可能存在数据库不兼容等问题
apache-cassandra-3.11.19-bin.tar.gz
apache-hugegraph-incubating-1.3.0.tar.gz

cassandra集群部署

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
tar xf apache-cassandra-3.11.19-bin.tar.gz -C /home
vim /home/apache-cassandra-3.11.19/conf/jvm-server.options
Xss改为 -Xss1m 或 521k

# 创建目录
mkdir data commitlog saved-caches
# 临时设置文件数
ulimit -n 65535

vim /home/apache-cassandra-3.11.19/conf/cassandra.yaml
# 修改下面内容
data_file_directories:
   - /home/apache-cassandra-3.11.19/data
   
commitlog_directory: /home/apache-cassandra-3.11.19/commitlog

saved_caches_directory: /home/apache-cassandra-3.11.19/saved_caches

# 改设备本身ip
listen_address: 83.1.12.1
rpc_address: 83.1.12.1

# speed节点推荐1-2个即可
seed_provider:
 - class_name: org.apache.cassandra.locator.SimpleSeedProvider
  parameters:
     - seeds: "83.1.12.1:7000"
     - seeds: "83.1.12.2:7000"
# 保存

配置密码
sed -i "s/authenticator: AllowAllAuthenticator/authenticator: PasswordAuthenticator/g" /home/apache-cassandra-3.11.19/conf/cassandra.yaml
sed -i "s/authorizer: AllowAllAuthorizer/authorizer: CassandraAuthorizer/g" /home/apache-cassandra-3.11.19/conf/cassandra.yaml

1
2
# 发送配置文件到node节点
for i in 2 3 4 5 6 ;do scp -r /home/apache-cassandra-3.11.19 root@83.1.12.$i:/home ;done
1
2
3
4
5
6
7
8
9
10
# 83.1.12.2-6操作
# 创建目录
mkdir data commitlog saved-caches
# 临时设置文件数
ulimit -n 65535

vim /home/apache-cassandra-3.11.19/conf/cassandra.yaml
# 改设备本身ip
listen_address: 83.1.12.x
rpc_address: 83.1.12.x
1
2
3
4
5
6
7
8
9
# 启动 优先启动seeds节点,在启动worker节点 先启动1和2 
/home/apache-cassandra-3.11.19/bin/cassandra -R

# 在启动3-6
/home/apache-cassandra-3.11.19/bin/cassandra -R


# 83.1.12.1 执行查看启动日志,已经节点加入日志
tail -1000f /home/apache-cassandra-3.11.19/logs/system.log | grep successfully
1
2
3
4
5
6
7
8
# 83.1.12.1执行 配置密码
cd /home/apache-cassandra-3.11.19/bin
./cqlsh -u cassandra -p cassandra  83.1.12.1
# 修改密码
ALTER USER cassandra WITH PASSWORD 'Kd@2025123';

# 使用新密码登录 验证是否修改成功
./cqlsh -u cassandra -p Kd@2025123  83.1.12.2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 查看集群状态 任意节点执行
cd /home/apache-cassandra-3.11.19/bin
[root@1-0001 bin]# ./nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address   Load       Tokens Owns (effective) Host ID                               Rack
UN  83.1.12.4  354.84 KiB  16      49.9%             65631d79-15a5-4bff-be1b-a3be8d0ca790 rack1
UN  83.1.12.1  348.86 KiB  16      49.0%             2c22ff66-fca1-473f-a6bf-9ce70b146391 rack1
UN  83.1.12.5  351.62 KiB  16      50.7%             dfd99c3f-794a-4fb0-ad7a-0be3618197e0 rack1
UN  83.1.12.3  355.85 KiB  16      51.1%             32a4570d-58a9-4753-8eb8-1384d3f748e4 rack1
UN  83.1.12.2  355.8 KiB   16      48.8%             6e0e69ea-a4ea-4167-b1ae-bd678afce6e6 rack1
UN  83.1.12.6  342.66 KiB  16      50.5%             68b0b805-ec56-4832-b6b3-dc9be512b30c rack1

部署hugegraph集群

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
下载服务端二进制包
apache-hugegraph-incubating-1.3.0.tar.gz

tar xf apache-hugegraph-incubating-1.3.0.tar.gz -C /home
# 开始配置
cd /home/apache-hugegraph-incubating-1.3.0/
vim conf/rest-server.properties
# 允许所有IP访问
restserver.url=http://0.0.0.0:8080
arthas.ip=0.0.0.0
# master只要一个
server.id=server1
server.role=master

# 集群设备的所有IP:端口
raft.group_peers=83.1.12.1:8090,83.1.12.2:8090,83.1.12.3:8090,83.1.12.4:8090,83.1.12.5:8090,83.1.12.6:8090
# 本身设备ip
raft.endpoint=83.1.12.1:8090
raft.path=./raft-data
raft.use_snapshot=true

# 配置数据库信息
vim conf/graphs/hugegraph.properties
backend=cassandra
serializer=cassandra

# 数据库链接信息
cassandra.host=83.1.12.1,83.1.12.2,83.1.12.3,83.1.12.4,83.1.12.5,83.1.12.6
cassandra.port=9042
cassandra.username=cassandra
cassandra.password=Kd@2025123
cassandra.connect_timeout=30
cassandra.read_timeout=60

# 配置gremlin-server为所有人访问
vim conf/gremlin-server.yaml
host: 0.0.0.0
port: 8182
1
2
# 发送配置文件到worker节点
for i in 2 3 4 5 6 ;do scp -r /home/apache-hugegraph-incubating-1.3.0/ root@83.1.12.$i:/home ;done
1
2
3
4
5
6
7
8
9
# 83.1.12.2-6服务器操作
# 编辑配置信息 修改为设备本身的IP

raft.endpoint=83.1.12.x:8090

# serverid不可重复2-6
server.id=server2
# 2-6都改为worker角色
server.role=worker
1
2
3
4
5
6
7
8
9
# master 83.1.12.1节点操作
# 初始化数据库
bin/init-store.sh
# 启动master节点
bin/start-hugegraph.sh


# worker 83.1.12.-6节点操作
bin/start-hugegraph.sh

配置web界面

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 配置web可视化窗口
下载 apache-hugegraph-toolchain-incubating-1.5.0.tar.gz

# 在任意节点部署即可
tar xf apache-hugegraph-toolchain-incubating-1.5.0.tar.gz -C /home

# 启动程序
./home/apache-hugegraph-toolchain-incubating-1.5.0/apache-hugegraph-hubble-incubating-1.5.0/bin/start-hubble.sh


浏览器访问ip:8088进入hubble界面
http://83.1.1.54:8088/

创建图 主机IP写集群任意IP即可

hugegraph图集群部署
http://ziiix.cn/2025/05/26/hugegraph图集群部署/
作者
John Doe
发布于
2025年5月26日
许可协议