dosubot[bot] commented on issue #2787: URL: https://github.com/apache/incubator-hugegraph/issues/2787#issuecomment-2954467675
<!-- Answer --> HugeGraph 分布式部署 RocksDB(Raft 模式)大致流程如下: 1. 环境准备:每台机器安装 JDK 11+,建议 16GB 以上内存,SSD 更佳。下载 HugeGraph 1.5.0 二进制包或官方 Docker 镜像(推荐用 release tag)。 2. 配置文件(每台节点 graphs/hugegraph.properties 必须一致): ```properties backend=rocksdb serializer=binary store=hugegraph rocksdb.data_path=./data rocksdb.wal_path=./wal raft.group_peers=192.168.230.128:8091,192.168.230.129:8091,192.168.230.130:8091 # 推荐 raft 相关参数 raft.election_timeout=10000 raft.rpc_connect_timeout=5000 raft.rpc_timeout=60 # RocksDB 性能参数(单位为字节,不能写 128MB,需写 134217728) rocksdb.write_buffer_size=134217728 rocksdb.max_write_buffer_number=6 rocksdb.block_cache_size=8589934592 ``` 注意 raft.mode、raft.endpoint、raft.election_timeout_ms 等参数已废弃,不能再用。 3. rest-server.properties 只需配置 REST/RPC 端口,graphs 路径等,不要写 raft.group_peers。 4. 启动顺序:每台节点都执行一次 `bin/init-store.sh` 初始化(确保 data 目录无锁文件、无其他进程占用),然后启动服务 `bin/start-hugegraph.sh`。Docker 环境可用 `JAVA_OPTS` 环境变量设置 JVM 堆内存(如 `-Xmx32g -Xms32g`),docker-compose 需挂载各自配置文件,环境变量前缀用 hugegraph.。 5. 端口分配:每台节点 REST、Gremlin、RPC 端口不能冲突,比如 8081/8181/8091,8082/8182/8092,8083/8183/8093。 6. 常见问题:rocksdb.write_buffer_size、rocksdb.block_cache_size 等参数必须用字节数(如 134217728),不能写 128MB,否则报类型错误。遇到 lock 报错需确保无进程占用,必要时手动删除 lock 文件(确保无服务运行)[参考](https://github.com/apache/incubator-hugegraph/issues/2762)。 7. 集群健康:所有节点配置完全一致,raft.group_peers 必须包含所有节点,节点间网络互通,data/wal 路径可写。 详细可参考官方配置模板和 [分布式部署经验](https://github.com/apache/incubator-hugegraph/issues/2725)。如遇具体报错可贴日志进一步定位。 <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/c0d80a21-6ac5-4f39-a49a-28201d64acaf?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c0d80a21-6ac5-4f39-a49a-28201d64acaf?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c0d80a21-6ac5-4f39-a49a-28201d64acaf?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c0d80a21-6ac5-4f39-a49a-28201d64acaf?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c0d80a21-6ac5-4f39-a49a-28201d64acaf?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c0d80a21-6ac5-4f39-a49a-28201d64acaf?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c0d80a21-6ac5-4f39-a49a-28201d64acaf?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [! [Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph/issues/2787) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
