You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "wanwancloud (via GitHub)" <gi...@apache.org> on 2025/06/09 08:49:49 UTC
[I] 1.5.0版本hugegraph.properties配置集群报错 [incubator-hugegraph]
wanwancloud opened a new issue, #2790:
URL: https://github.com/apache/incubator-hugegraph/issues/2790
### Bug Type (问题类型)
None
### Before submit
- [x] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
### Environment (环境信息)
- Server Version: 1.5.0 (Apache Release Version)
- Backend: RocksDB
- OS:32 CPUs, 64G RAM, KylinV10
- Data Size: xx vertices, xx edges <!-- (like 1000W 点, 9000W 边) -->
### Expected & Actual behavior (期望与实际表现)
hugegraph.properties配置如下
`
gremlin.graph=org.apache.hugegraph.HugeFactory
vertex.cache_type=l2
edge.cache_type=l2
backend=rocksdb
serializer=binary
store=hugegraph
task.scheduler_type=local
task.schedule_period=10
task.retry=0
task.wait_timeout=10
search.text_analyzer=jieba
search.text_analyzer_mode=INDEX
rocksdb.data_path=./data
rocksdb.wal_path=./wal
raft.mode=true
raft.group_peers=192.168.230.128:8091,192.168.230.129:8092,192.168.230.130:8093
`
rest-server.properties配置如下
`
server.id=server-2
server.role=worker
rpc.server_host=192.168.230.129
rpc.server_port=8092
rpc.server_timeout=30
rpc.remote_url=192.168.230.128:8091,192.168.230.129:8092,192.168.230.130:8093
`
如果 raft.mode=true 不写的话则不会开启集群功能
`
[root@localhost bin]# curl -X GET "http://192.168.230.128:8080/graphs/hugegraph/raft/list_peers" |jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 139 100 139 0 0 2194 0 --:--:-- --:--:-- --:--:-- 2241
{
"exception": "class org.apache.hugegraph.HugeException",
"message": "Allowed list_peers operation only when working on raft mode",
"cause": ""
}
`
如果 raft.mode=true 但是如果开启,
`
[root@localhost bin]# ./start-hugegraph.sh
Starting HugeGraphServer in daemon mode...
Connecting to HugeGraphServer (http://0.0.0.0:8080/graphs)...............
The operation timed out(30s) when attempting to connect to http://0.0.0.0:8080/graphs
See /home/apache-hugegraph-incubating-1.5.0/apache-hugegraph-server-incubating-1.5.0/logs/hugegraph-server.log for HugeGraphServer log output.
`
会报错,但是等一会通过验证集群是正常的
`
[root@localhost logs]# curl -X GET "http://192.168.230.128:8080/graphs/hugegraph/raft/list_peers" |jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 84 100 84 0 0 380 0 --:--:-- --:--:-- --:--:-- 392
{
"hugegraph": [
"192.168.230.128:8091",
"192.168.230.129:8092",
"192.168.230.130:8093"
]
}
`
`
[root@localhost bin]# curl -X GET "http://192.168.230.128:8080/graphs/hugegraph/raft/get_leader" |jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 36 100 36 0 0 1947 0 --:--:-- --:--:-- --:--:-- 2000
{
"hugegraph": "192.168.230.128:8091"
}
`

### Vertex/Edge example (问题点 / 边数据举例)
```javascript
所以如果要开启集群那么 raft.mode=true 这个参数是必须要写的,但是在之前lssues反馈中却说raft.mode=true已经废弃,只需要写raft.group_peers=192.168.230.128:8091,192.168.230.129:8092,192.168.230.130:8093 这个参数就自动开启集群模式,这个显然是错误的。
上诉启动报错是否是因为超时的原因
```
### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
```javascript
```
--
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: dev-unsubscribe@hugegraph.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] 1.5.0版本hugegraph.properties配置集群报错 [incubator-hugegraph]
Posted by "wanwancloud (via GitHub)" <gi...@apache.org>.
wanwancloud commented on issue #2790:
URL: https://github.com/apache/incubator-hugegraph/issues/2790#issuecomment-2955294533
建议官方文档更新一下,踩坑踩了很多。从cassandra到Rocksdb ,特别是集群部署官方文档中没有提及,只有单机部署。
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] 1.5.0版本hugegraph.properties配置集群报错 [incubator-hugegraph]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #2790:
URL: https://github.com/apache/incubator-hugegraph/issues/2790#issuecomment-2955130844
<!-- Answer -->
你的分析基本正确,但有几点需要澄清和补充:
1. **raft.mode 是否必须**
在 HugeGraph 1.5.0 版本,[raft.mode 已经被废弃](https://github.com/apache/incubator-hugegraph/issues/2787),只要配置了 `raft.group_peers`,就会自动启用 Raft 集群模式,无需再写 `raft.mode=true`。如果你发现不写 `raft.mode=true` 无法启用集群,建议检查下所有节点的 `hugegraph.properties` 配置是否完全一致,尤其是 `raft.group_peers`、端口等参数。
2. **配置文件位置**
`raft.group_peers` 必须写在每个节点的 `graphs/hugegraph.properties` 文件里,[不能写在 rest-server.properties](https://github.com/apache/incubator-hugegraph/issues/2787)。
3. **启动超时原因**
你遇到的启动超时(比如 30s 连接超时),主要原因是 Raft 集群启动和选主需要一定时间,期间 REST 服务端口还未完全 ready,或者 leader 选举还没完成。HugeGraph 内部 raft 相关代码(如 RaftNode、RaftContext)会等待 leader 选举和日志同步,超时会报错,但通常等一会集群就会正常工作(如你后续 curl 查询 raft 状态是正常的)[源码参考](https://github.com/apache/incubator-hugegraph/blob/337dc86567834acd717a2240a79fef2815d4bb6f/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/raft/RaftNode.java)。
4. **建议**
- 不要再写 `raft.mode=true`,只保留 `raft.group_peers` 即可。
- 检查所有节点的 `hugegraph.properties` 配置完全一致,端口不冲突。
- 如果启动超时,可以适当调大 `restserver.request_timeout` 或相关 raft 超时参数(如 `raft.rpc_timeout`、`raft.election_timeout`),并确保网络畅通。
- 避免使用已废弃的 raft 相关参数(如 raft.endpoint、raft.election_timeout_ms 等)。
相关讨论和源码可参考:
- [raft.mode 已废弃,自动根据 raft.group_peers 判断](https://github.com/apache/incubator-hugegraph/issues/2787)
- [Raft 启动和超时机制源码](https://github.com/apache/incubator-hugegraph/blob/337dc86567834acd717a2240a79fef2815d4bb6f/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/raft/RaftNode.java)
如还有具体日志报错,可以贴出来进一步分析。
<!-- 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/069982b4-f4bf-44af-ac3a-f5672d531d24?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/069982b4-f4bf-44af-ac3a-f5672d531d24?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/069982b4-f4bf-44af-ac3a-f5672d531d24?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/069982b4-f4bf-44af-ac3a-f5672d531d24?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/069982b4-f4bf-44af-ac3a-f5672d531d24?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/069982b4-f4bf-44af-ac3a-f5672d531d24?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/069982b4-f4bf-44af-ac3a-f5672d531d24?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/2790)
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] 1.5.0版本hugegraph.properties配置集群报错 [incubator-hugegraph]
Posted by "wanwancloud (via GitHub)" <gi...@apache.org>.
wanwancloud commented on issue #2790:
URL: https://github.com/apache/incubator-hugegraph/issues/2790#issuecomment-2955138191
1.5.0版本 如果不写 raft.mode=true 无法启用集群,每个节点都是单节点的状态允许。上面我已经提供api请求查询节点状态的信息,显示非集群状态 所有节点的 hugegraph.properties 配置完全一致,尤其是 raft.group_peers、端口等参数是完全一致的
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] 1.5.0版本hugegraph.properties配置集群报错 [incubator-hugegraph]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on issue #2790:
URL: https://github.com/apache/incubator-hugegraph/issues/2790#issuecomment-2955283305
> 1.5.0版本 如果不写 raft.mode=true 无法启用集群,每个节点都是单节点的状态允许。上面我已经提供api请求查询节点状态的信息,显示非集群状态 所有节点的 hugegraph.properties 配置完全一致,尤其是 raft.group_peers、端口等参数是完全一致的
@wanwancloud
refer here https://github.com/apache/incubator-hugegraph/issues/2787#issuecomment-2954951182
最新的代码里, 配置文件这里过时的 raft 参数已经全部移除了, 不会再对用户产生误导:
1. [hstore](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-dist/src/assembly/static/conf/graphs/hstore.properties.template) (raft + rocksdb) 配置文件
2. [其他后端](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-dist/src/assembly/static/conf/graphs/hugegraph.properties)的
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [I] 1.5.0版本hugegraph.properties配置集群报错 [incubator-hugegraph]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on issue #2790:
URL: https://github.com/apache/incubator-hugegraph/issues/2790#issuecomment-2970436802
> 建议官方文档更新一下,踩坑踩了很多。从cassandra到Rocksdb ,特别是集群部署官方文档中没有提及,只有单机部署。
@wanwancloud 感谢建议, 文档结构已经做了大的重构和改进, 后续会快速同步更多的子文档了
refer: https://hugegraph.apache.org/docs/quickstart/hugegraph/
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org