apache / incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
https://hugegraph.apache.org
Apache License 2.0
2.62k stars 518 forks source link

Raft模型下hugegraph启动失败 #1405

Closed xxyp closed 3 years ago

xxyp commented 3 years ago

Raft模型下hugegraph启动失败

Actual behavior 实际表现

2021-03-27 16:37:14 5687 [main] [INFO ] com.alipay.sofa.jraft.core.NodeImpl [] - The number of active nodes increment to 1. 2021-03-27 16:37:14 5756 [main] [INFO ] com.alipay.sofa.jraft.core.FSMCallerImpl [] - Starts FSMCaller successfully. 2021-03-27 16:37:14 5765 [main] [WARN ] com.alipay.sofa.jraft.storage.snapshot.local.LocalSnapshotStorage [] - No data for snapshot reader ./raft-log/snapshot. 2021-03-27 16:37:14 5798 [main] [INFO ] com.alipay.sofa.jraft.core.NodeImpl [] - Node <default/10.65.23.66:8281> init, term=10, lastLogId=LogId [index=0, term=0], conf=10.65.23.66:8281,10.65.24.115:8281, oldConf=. 2021-03-27 16:37:14 5800 [main] [WARN ] com.alipay.sofa.jraft.RaftGroupService [] - RPC server is not started in RaftGroupService. 2021-03-27 16:37:14 5800 [main] [INFO ] com.alipay.sofa.jraft.RaftGroupService [] - Start the RaftGroupService successfully. 2021-03-27 16:37:14 5802 [main] [INFO ] com.baidu.hugegraph.backend.store.raft.RaftBackendStoreProvider [] - The raft node is initialized 2021-03-27 16:37:17 8803 [main] [WARN ] com.baidu.hugegraph.backend.store.raft.RaftNode [] - Waiting for raft group 'default' election cost 3.0s 2021-03-27 16:37:20 11803 [main] [WARN ] com.baidu.hugegraph.backend.store.raft.RaftNode [] - Waiting for raft group 'default' election cost 6.001s 2021-03-27 16:37:23 14803 [main] [WARN ] com.baidu.hugegraph.backend.store.raft.RaftNode [] - Waiting for raft group 'default' election cost 9.001s 2021-03-27 16:37:25 16535 [JRaft-ElectionTimer-<default/10.65.23.66:8281>0] [INFO ] com.alipay.sofa.jraft.core.NodeImpl [] - Node <default/10.65.23.66:8281> term 10 start preVote. 2021-03-27 16:37:25 16560 [JRaft-ElectionTimer-<default/10.65.23.66:8281>0] [ERROR] com.alipay.sofa.jraft.rpc.impl.AbstractClientService [] - Fail to connect 10.65.24.115:8281, remoting exception: com.alipay.remoting.exception.RemotingException: Create connection failed. The address is 10.65.24.115:8281. 2021-03-27 16:37:25 16560 [JRaft-ElectionTimer-<default/10.65.23.66:8281>0] [WARN ] com.alipay.sofa.jraft.core.NodeImpl [] - Node <default/10.65.23.66:8281> channel init failed, address=10.65.24.115:8281. 2021-03-27 16:37:26 17804 [main] [WARN ] com.baidu.hugegraph.backend.store.raft.RaftNode [] - Waiting for raft group 'default' election cost 12.002s 2021-03-27 16:37:29 20804 [main] [WARN ] com.baidu.hugegraph.backend.store.raft.RaftNode [] - Waiting for raft group 'default' election cost 15.002s 2021-03-27 16:37:32 23804 [main] [WARN ] com.baidu.hugegraph.backend.store.raft.RaftNode [] - Waiting for raft group 'default' election cost 18.002s 2021-03-27 16:37:35 26805 [main] [WARN ] com.baidu.hugegraph.backend.store.raft.RaftNode [] - Waiting for raft group 'default' election cost 21.003s

Linary commented 3 years ago

@xxyp 麻烦提供一下 10.65.23.66:8281,10.65.24.115:8281 这两个服务的配置项。

xxyp commented 3 years ago

10.65.23.66:8281,10.65.24.115:8281

gremlin entrence to create graph

gremlin.graph=com.baidu.hugegraph.HugeFactory

cache config

schema.cache_capacity=100000

vertex-cache default is 1000w, 10min expired

vertex.cache_capacity=10000000

vertex.cache_expire=600

edge-cache default is 100w, 10min expired

edge.cache_capacity=1000000

edge.cache_expire=600

schema illegal name template

schema.illegal_name_regex=\s+|~.*

vertex.default_label=vertex

backend=rocksdb serializer=binary

store=hugegraph

raft.mode=true raft.safe_read=false raft.use_snapshot=false raft.endpoint=10.65.23.66:8281 raft.group_peers=10.65.23.66:8281,10.65.24.115:8281 raft.path=./raft-log raft.use_replicator_pipeline=true raft.election_timeout=10000 raft.snapshot_interval=3600 raft.backend_threads=48 raft.read_index_threads=8 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=60000

search.text_analyzer=jieba

10.65.23.66:8281 raft的配置项如上,其他就改了conf/rest-server.properties的restserver.url=http://10.65.23.66:8080 66作为master节点,115 worker节点

Linary commented 3 years ago

另一台的raft配置是否为:

raft.endpoint=10.65.24.115:8281
raft.group_peers=10.65.23.66:8281,10.65.24.115:8281

并且要两台都启动(一前一后即可),不然选不出leader。