HugeGraph 安装

felix.shao2025-02-18

HugeGraph 安装

2 安装

2.1 安装资源

 安装资源如下

资源包备注链接
apache-hugegraph-incubating-1.0.0.tar.gz服务端server 下载open in new window
apache-hugegraph-computer-incubating-1.0.0.tar.gz匹配图计算系统computer 下载open in new window
apache-hugegraph-toolchain-incubating-1.0.0.tar.gz图形加载器/仪表板/工具/客户端toolchain 下载open in new window

2.2 安装

2.2.1 HugeGraph-Server 安装

 HugeGraph-Server 是 HugeGraph 项目的核心部分,包含 Core、Backend、API 等子模块。
 Core 模块是 Tinkerpop 接口的实现,Backend 模块用于管理数据存储,目前支持的后端包括:Memory、Cassandra、ScyllaDB 以及 RocksDB,API 模块提供HTTP Server,将 Client 的 HTTP 请求转化为对 Core 的调用。

2.2.1.1 HugeGraph-Server 安装

 安装命令如下:

# 解压 server 文件
$ tar zxf apache-hugegraph-incubating-1.0.0.tar.gz -C /usr/local

 修改外部访问配置。
 如果需要外部访问 HugeGraphServer,请修改 conf/rest-server.propertiesrestserver.url 配置项 (默认为 http://127.0.0.1:8080 ),修改成机器名或 IP 地址(如 0.0.0.0 即不限制)。
 启动、停止都有对应的 Shell 脚本,见对应的 bin 目录。

2.2.1.2 内存数据库启动

 Memory 后端的数据是保存在内存中无法持久化的,不需要初始化后端,这也是唯一一个不需要初始化的后端。默认是 RocksDB 数据库,修改以下配置。

$ vi conf/graphs/hugegraph.properties
backend=memory
serializer=text

 启动命令如下:

$ vi conf/graphs/hugegraph.properties
backend=memory
serializer=text

 启动后可以通过 $ jps 命令查看进程状态。
 curl 请求 RESTfulAPI,返回结果 200,代表 server 启动

$ echo `curl -o /dev/null -s -w %{http_code} "http://localhost:8080/graphs/hugegraph/graph/vertices`
2.2.1.3 RocksDB 启动
$ vi conf/graphs/hugegraph.properties
backend=rocksdb
serializer=binary
rocksdb.data_path=.
rocksdb.wal_path=.

 初始化数据库(仅第一次启动时需要)。$ ./bin/init-store.sh

 启动命令如下同 4.1 小节内容。

2.2.2 HugeGraph-Tools 安装

 安装命令如下:

# 解压 toolchain 文件
$ tar zxf apache-hugegraph-toolchain-incubating-1.0.0.tar.gz -C /usr/local
$ cd apache-hugegraph-toolchain-incubating-1.0.0
2.2.2.1 HugeGraph-Loader
2.2.2.2

参考文献

Last Updated 2/18/2025, 5:05:12 PM