Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] creating a new graph in a distributed cluster, I encountered the error: GraphFactory could not instantiate this Graph implementation [class org.apache.hugegraph.HugeFactory]. #2725

Open
1 task done
kaiizi opened this issue Jan 23, 2025 · 6 comments
Labels
inactive question Further information is requested

Comments

@kaiizi
Copy link

kaiizi commented Jan 23, 2025

Problem Type (问题类型)

other exception / error (其他异常报错)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.3.0 (Apache Release Version)
  • Backend: mysql * 3 node
  • OS: 16 CPUs, 32 G RAM, Ubuntu 2204

Your Question (问题描述)

参考https://github.com/apache/incubator-hugegraph/wiki/HugeGraph-Multi%E2%80%90Node-Deployment-Configuration 文档
使用1.3.0版本部署分布式集群,调master节点接口创建新图如下:

`curl --location 'http://172.16.31.137:8080/graphs/test1-mysql'
--header 'Content-Type: text/plain'
--data 'gremlin.graph=org.apache.hugegraph.HugeFactory
backend=mysql
serializer=mysql
store=mysql_test_3

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://172.16.31.140:6446
jdbc.username=root
jdbc.password=_4-qmp_9aCH
jdbc.reconnect_max_times=3
jdbc.reconnect_interval=3
jdbc.ssl_mode=false

raft.mode=true
raft.path=./raft-log
raft.safe_read=true
raft.use_replicator_pipeline=true

raft.endpoint=172.16.31.137:8091
raft.group_peers=172.16.31.137:8091,172.16.31.138:8091,172.16.31.139:8091
raft.election_timeout=10000
raft.snapshot_interval=3600
raft.backend_threads=48
raft.read_index_threads=8
raft.snapshot_threads=4
raft.snapshot_parallel_compress=false
raft.snapshot_compress_threads=4
raft.snapshot_decompress_threads=4
raft.read_strategy=ReadOnlyLeaseBased
raft.queue_size=16384
raft.queue_publish_timeout=60
raft.apply_batch=1
raft.rpc_threads=80
raft.rpc_connect_timeout=5000
raft.rpc_timeout=60
raft.install_snapshot_rpc_timeout=36000
'`

报错:
{ "exception": "class java.lang.RuntimeException", "message": "GraphFactory could not instantiate this Graph implementation [class org.apache.hugegraph.HugeFactory]", "cause": "java.lang.reflect.InvocationTargetException" }
raft-log日志中未有报错信息;
如果不添加raft相关配置可以正常创建,但是其他节点无法查看对应新图,麻烦看下

  1. 是否是创建参数有问题
  2. 是否分布式集群部署文档中缺少相关配置
  3. 是否hugagraph不支持HA,多节点数据本身就不一致

Vertex/Edge example (问题点 / 边数据举例)

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

@dosubot dosubot bot added the question Further information is requested label Jan 23, 2025
Copy link

dosubot bot commented Jan 23, 2025

Hey there, @kaiizi! I'm here to help you with any bugs, questions, or contributions you have. Let me know how I can assist you!

The error "GraphFactory could not instantiate this Graph implementation" typically indicates a configuration or dependency issue. Here are some steps to troubleshoot and resolve the problem:

  1. Check Configuration Parameters: Ensure that all configuration parameters in your hugegraph.properties file are correctly set. Pay special attention to the Raft-related settings, as any misconfiguration can lead to instantiation errors.

  2. Verify Backend and Serializer Settings: Make sure that the backend and serializer settings are correctly defined. For MySQL, the settings should look like this:

    backend=mysql
    serializer=mysql
  3. Consistent Configuration Across Nodes: Ensure that all nodes in the cluster have consistent configurations, especially the Raft settings. This includes raft.endpoint, raft.group_peers, and other related parameters.

  4. Dependencies and Classpath: Verify that all necessary dependencies are included in your classpath. The error might be due to a missing library or an incorrect version.

  5. Raft Mode Specifics: Since the error does not occur when Raft configurations are removed, double-check the Raft settings. Ensure that the raft.path is accessible and writable by the application, and that the raft.group_peers list is correctly specified with all node endpoints.

  6. HugeGraph Version Compatibility: Ensure that the version of HugeGraph you are using (1.3.0) is compatible with your setup and that there are no known issues with Raft mode in this version.

  7. Review Logs for Additional Clues: Although the raft-log did not show errors, check other logs for any warnings or errors that might provide more context.

If these steps do not resolve the issue, consider testing with a minimal configuration to isolate the problem, and gradually add complexity to identify the specific cause.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@kaiizi
Copy link
Author

kaiizi commented Jan 23, 2025

master的hugegraph.properties配置如下,其他两个节点raft.endpoint ip为节点ip

`
gremlin.graph=org.apache.hugegraph.HugeFactory
backend=mysql
serializer=mysql

store=hugegraph

raft.mode=true
raft.path=./raft-log
raft.safe_read=true
raft.use_replicator_pipeline=true

raft.endpoint=172.16.31.137:8091
raft.group_peers=172.16.31.137:8091,172.16.31.138:8091,172.16.31.139:8091
raft.election_timeout=10000
raft.snapshot_interval=3600
raft.backend_threads=48
raft.read_index_threads=8
raft.snapshot_threads=4
raft.snapshot_parallel_compress=false
raft.snapshot_compress_threads=4
raft.snapshot_decompress_threads=4
raft.read_strategy=ReadOnlyLeaseBased
raft.queue_size=16384
raft.queue_publish_timeout=60
raft.apply_batch=1
raft.rpc_threads=80
raft.rpc_connect_timeout=5000
raft.rpc_timeout=60
raft.install_snapshot_rpc_timeout=36000

search.text_analyzer=jieba
search.text_analyzer_mode=INDEX

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://172.16.31.140:6446
jdbc.username=root
jdbc.password=_4-qmp_9aCH
jdbc.reconnect_max_times=3
jdbc.reconnect_interval=3
jdbc.ssl_mode=false
`

@imbajin
Copy link
Member

imbajin commented Jan 24, 2025

Please use 1.5.0 for the distributed cluster (the older/legacy version will be achieved soon)

If u meet any problem in the latest version, please open a issue for it

Copy link

github-actions bot commented Feb 8, 2025

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

@insist93
Copy link

Please use 1.5.0 for the distributed cluster (the older/legacy version will be achieved soon)

If u meet any problem in the latest version, please open a issue for it

As far as I know, there is no official document for 1.5.0 on distributed clusters, do you have any plans? After I follow the wiki documentation, how do I dynamically add a distributed graph? According to the 1.3.0documentation, the rockdb graph has been inserted and is still only available at the current node。
need help😭 @VGalaxies

@github-actions github-actions bot removed the inactive label Feb 18, 2025
Copy link

github-actions bot commented Mar 5, 2025

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants