incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

[Question] 部署完pd hstore 初始化ini-store.sh失败

Open hexuxu110 opened this issue 1 year ago • 9 comments

Problem Type (问题类型)

server status (启动/运行异常)

Before submit

  • [x] #2840

Environment (环境信息)

  • Server Version: 1.5.0 (Apache Release Version)
  • Backend: Hstore
  • OS: xx CPUs, xx G RAM, Ubuntu 2x.x / CentOS 7.x
  • Data Size: xx vertices, xx edges

Your Question (问题描述)

Initializing HugeGraph Store... 2025-07-24 19:22:11 [main] [ERROR] o.a.h.p.c.PDClient - PDClient connect to 10.156.90.54:8686 exception DEADLINE_EXCEEDED: deadline exceeded after 59.946484024s. [closed=[], open=[[buffered_nanos=326058051, remote_addr=10.156.90.54/10.156.90.54:8686]]], 2025-07-24 19:22:12 [main] [ERROR] o.a.h.p.c.PDClient - PDClient connect to 10.158.189.231:8686 exception UNAVAILABLE: io exception, finishConnect(..) failed: Connection refused: /10.158.189.231:8686 2025-07-24 19:22:12 [main] [ERROR] o.a.h.p.c.PDClient - PDClient connect to 10.159.113.63:8686 exception UNAVAILABLE: io exception, finishConnect(..) failed: Connection refused: /10.159.113.63:8686 2025-07-24 19:22:12 [main] [ERROR] o.a.h.b.s.h.HstoreStore - Failed to open Hstore 'g':org.apache.hugegraph.pd.common.PDException: PD unreachable, pd.peers=10.156.90.54:8686,10.158.189.231:8686,10.159.113.63:8686 main dict load finished, time elapsed 1241 ms model load finished, time elapsed 90 ms.

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


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


hexuxu110 avatar Jul 24 '25 11:07 hexuxu110

你遇到的 PDClient 连接报错(如 DEADLINE_EXCEEDED、UNAVAILABLE、Connection refused)通常说明 HugeGraph 无法和 PD(Placement Driver)节点建立 gRPC 连接,常见原因包括 PD 服务未启动、端口未监听、网络不通或配置不一致。可以按以下顺序排查:

  1. 检查所有 PD 节点进程是否已启动,并且 8686 端口处于监听状态(用 netstat -anp | grep 8686 或 lsof -i:8686 查看);
  2. 确认配置文件(尤其是每台机器的 hugegraph.properties)完全一致,raft.group_peers、pdserver.address、raft.address、grpc.host/port 等参数必须包含所有节点的正确 IP 和端口,且不能有遗漏或冲突,且不能写在 rest-server.properties 里;
  3. 如果 PD 和 Store 不在同一台机器,配置里不能用 127.0.0.1,必须用实际内网 IP;
  4. 检查网络和防火墙设置,确保各节点间端口互通;
  5. Store 节点首次启动前必须执行 init-store.sh,且 RocksDB 数据目录不能被其他进程占用(否则会报 lock 错);
  6. 检查 PD 和 Store 节点日志,关注 raft 选主、注册超时、分区分配失败等报错,能帮助定位问题;
  7. 如果服务器内存不足,PD 进程可能被系统 kill(可用 journalctl -k | grep -i 'killed process' 检查);
  8. 确保所有组件(PD、Store、Server)版本一致,否则也会导致连接失败。

详细排查建议可参考 相关社区经验 和 配置一致性说明。

To reply, just mention @dosu.


Docs are dead. Just use Dosu.

Leave Feedback Ask Dosu about hugegraph Share Dosu with your team

dosubot[bot] avatar Jul 24 '25 11:07 dosubot[bot]

3pd 3 store 3server

一台物理机部署1pd 1store 1server 启动第一台就报以上错误

hexuxu110 avatar Jul 24 '25 11:07 hexuxu110

3pd 3 store 3server

一台物理机部署1pd 1store 1server 启动第一台就报以上错误

  1. 没有当前的配置参考来源 + 设置
  2. 可以先参考一下 docker-compose 和 wiki 里
  3. 说明一下参考 2 的里面遇到的具体错误复现方式

imbajin avatar Jul 25 '25 03:07 imbajin

Server: hugegraph.properties

gremlin entrance to create graph

auth config: org.apache.hugegraph.auth.HugeFactoryAuthProxy

gremlin.graph=org.apache.hugegraph.HugeFactory

cache config

#schema.cache_capacity=100000

vertex-cache default is 1000w, 10min expired

vertex.cache_type=l2 #vertex.cache_capacity=10000000 #vertex.cache_expire=600

edge-cache default is 100w, 10min expired

edge.cache_type=l2 #edge.cache_capacity=1000000 #edge.cache_expire=600

schema illegal name template

#schema.illegal_name_regex=\s+|~.*

#vertex.default_label=vertex

backend=hstore serializer=binary

store=hugegraph task.scheduler_type=distributed

pd config

#pd.peers=127.0.0.1:8686 pd.peers=机器IPA:8686,机器IPB:8687,机器IPC:8688

search config

search.text_analyzer=jieba search.text_analyzer_mode=INDEX

rocksdb backend config

rocksdb.data_path=/path/to/disk rocksdb.wal_path=/path/to/disk

rest-server.properties restserver.url=http://0.0.0.0:8081 gremlinserver.url=http://127.0.0.1:8181

graphs=./conf/graphs

rpc.server_host=127.0.0.1 rpc.server_port=8091

rpc.remote_url=127.0.0.1:8091 rpc.client_connect_timeout=60 rpc.client_reconnect_period=15 rpc.client_read_timeout=60 rpc.client_retries=5 rpc.client_load_balancer=consistentHash

hexuxu110 avatar Jul 25 '25 09:07 hexuxu110

PD配置

Licensed to the Apache Software Foundation (ASF) under one or more

contributor license agreements. See the NOTICE file distributed with

this work for additional information regarding copyright ownership.

The ASF licenses this file to You under the Apache License, Version 2.0

(the "License"); you may not use this file except in compliance with

the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

spring: application: name: hugegraph-pd

management: metrics: export: prometheus: enabled: true endpoints: web: exposure: include: "*"

logging: config: 'file:./conf/log4j2.xml'

TODO: handle the license file later (PDConfig)

license: verify-path: ./conf/verify-license.json license-path: ./conf/hugegraph.license grpc: port: 8686

The service address of grpc needs to be changed to the actual local IPv4 address when deploying.

host: 127.0.0.1

server:

REST service port number

port: 8620

pd:

Storage path

data-path: ./pd_data

The check cycle of automatic expansion regularly checks the number of partitions in each store and automatically balances the number of partitions

patrol-interval: 1800

The minimum number of surviving store nodes, less than which the entire cluster is unavailable

initial-store-count: 1

The initial store list, grpc IP: grpc port, the store in the list is automatically activated

initial-store-list: 机器IPA:8500, 机器IPB:8500, 机器IPC:8500

raft:

The address of the local raft service

address: 127.0.0.1:8610

The service address of the PD cluster

peers-list: 机器IPA:8610,机器IPB:8610,机器IPC:8610

store:

The time when the store went offline. After that time, the store is considered permanently unavailable, and the replica is allocated to another machine, in seconds

max-down-time: 172800

Specifies whether to enable store monitoring data storage

monitor_data_enabled: true

The interval between monitoring data, minute, hour, second

default: 1 min * 1 day = 1440

monitor_data_interval: 1 minute

Retention time of monitoring data is 1 day; day, month, year

monitor_data_retention: 1 day

partition:

Default number of replicas per partition

default-shard-count: 3

The default maximum number of replicas per machine

the initial number of partitions= store-max-shard-count * store-number / default-shard-count

store-max-shard-count: 12

hexuxu110 avatar Jul 25 '25 09:07 hexuxu110

Hstore相关:

pdserver:

PD service address, multiple PD addresses separated by commas

address: 机器IPA:8686 机器IPB:8686, 机器IPC:8686

management: metrics: export: prometheus: enabled: true endpoints: web: exposure: include: "*"

grpc:

grpc service address

host: 127.0.0.1 port: 8500 netty-server: max-inbound-message-size: 1000MB raft:

raft cache queue size

disruptorBufferSize: 1024 address: 127.0.0.1:8510 max-log-file-size: 600000000000

Snapshot generation interval, in seconds

snapshotInterval: 1800 server:

rest service address

port: 8520

app:

Storage path, support multiple paths, separated by commas

data-path: ./storage #raft-path: ./storage

spring: application: name: store-node-grpc-server profiles: active: default include: pd

logging: config: 'file:./conf/log4j2.xml' level: root: info

hexuxu110 avatar Jul 25 '25 09:07 hexuxu110

复现方式 部署第一台物理机,部署pd正常 部署hstore正常 初始化init-storo.sh 报错 Initializing HugeGraph Store... 2025-07-25 17:51:40 [main] [ERROR] o.a.h.p.c.PDClient - PDClient connect to 10.156.90.54:8686 exception UNAVAILABLE: io exception, finishConnect(..) failed: Connection refused: /10.156.90.54:8686 2025-07-25 17:52:40 [main] [ERROR] o.a.h.p.c.PDClient - PDClient connect to 10.158.189.231:8686 exception DEADLINE_EXCEEDED: deadline exceeded after 59.997127084s. [closed=[], open=[[buffered_nanos=24632174, remote_addr=10.158.189.231/10.158.189.231:8686]]], 2025-07-25 17:52:40 [main] [ERROR] o.a.h.p.c.PDClient - PDClient connect to 10.159.113.63:8686 exception UNAVAILABLE: io exception, finishConnect(..) failed: Connection refused: /10.159.113.63:8686 2025-07-25 17:52:40 [main] [ERROR] o.a.h.b.s.h.HstoreStore - Failed to open Hstore 'g':org.apache.hugegraph.pd.common.PDException: PD unreachable, pd.peers=10.156.90.54:8686,10.158.189.231:8686,10.159.113.63:8686 main dict load finished, time elapsed 956 ms model load finished, time elapsed 53 ms. 2025-07-25 17:52:41 [main] [ERROR] o.a.h.p.c.AbstractClient - PDClient connect to 10.156.90.54:8686 exception UNAVAILABLE: io exception, finishConnect(..) failed: Connection refused: /10.156.90.54:8686 2025-07-25 17:53:41 [main] [ERROR] o.a.h.p.c.AbstractClient - PDClient connect to 10.158.189.231:8686 exception DEADLINE_EXCEEDED: deadline exceeded after 59.999031342s. [closed=[], open=[[buffered_nanos=3888823, remote_addr=10.158.189.231/10.158.189.231:8686]]], 2025-07-25 17:53:41 [main] [ERROR] o.a.h.p.c.AbstractClient - PDClient connect to 10.159.113.63:8686 exception UNAVAILABLE: io exception, finishConnect(..) failed: Connection refused: /10.159.113.63:8686 Exception in thread "main" org.apache.hugegraph.HugeException: Failed to get 'HUGEGRAPH/hg/GRAPHSPACE//hugegraph/SCHEMA/VERTEX_LABEL/NAME/~user' from pd at org.apache.hugegraph.meta.PdMetaDriver.get(PdMetaDriver.java:75) at org.apache.hugegraph.meta.managers.SchemaMetaManager.getVertexLabel(SchemaMetaManager.java:163) at org.apache.hugegraph.backend.tx.SchemaTransactionV2.getSchema(SchemaTransactionV2.java:506) at org.apache.hugegraph.backend.cache.CachedSchemaTransactionV2.getSchema(CachedSchemaTransactionV2.java:293) at org.apache.hugegraph.backend.tx.SchemaTransactionV2.getVertexLabel(SchemaTransactionV2.java:248) at org.apache.hugegraph.StandardHugeGraph.vertexLabel(StandardHugeGraph.java:856) at org.apache.hugegraph.auth.EntityManager.queryEntity(EntityManager.java:152) at org.apache.hugegraph.auth.EntityManager.query(EntityManager.java:134) at org.apache.hugegraph.auth.StandardAuthManager.findUser(StandardAuthManager.java:183) at org.apache.hugegraph.auth.StandardAuthenticator.requireInitAdminUser(StandardAuthenticator.java:83) at org.apache.hugegraph.auth.StandardAuthenticator.initAdminUser(StandardAuthenticator.java:52) at org.apache.hugegraph.auth.StandardAuthenticator.initAdminUserIfNeeded(StandardAuthenticator.java:223) at org.apache.hugegraph.cmd.InitStore.main(InitStore.java:89) Caused by: org.apache.hugegraph.pd.common.PDException: PD unreachable, pd.peers=10.156.90.54:8686,10.158.189.231:8686,10.159.113.63:8686 at org.apache.hugegraph.pd.client.AbstractClient.getBlockingStub(AbstractClient.java:92) at org.apache.hugegraph.pd.client.AbstractClient.blockingUnaryCall(AbstractClient.java:157) at org.apache.hugegraph.pd.client.AbstractClient.blockingUnaryCall(AbstractClient.java:152) at org.apache.hugegraph.pd.client.KvClient.get(KvClient.java:83) at org.apache.hugegraph.meta.PdMetaDriver.get(PdMetaDriver.java:72) ... 12 more Initialization finished.

hexuxu110 avatar Jul 25 '25 09:07 hexuxu110

首先检查一下多台机器的网络是否通畅,互相ping一下试试是否可以访问,以及查看防火墙对应端口是否打开

koi2000 avatar Jul 26 '25 02:07 koi2000

When there are multiple store instances, the first time the init-store.sh script is run, the multiple stores need to complete data synchronization. Potential issues:

  1. pd cannot access the other store instances, thus failing to complete synchronization. It is advisable to check network issues.
  2. Deploy pd first, and then run the init-store.sh script after all store instances have been deployed.

在有多个store实例的情况下,首次运行init-store.sh脚本多个store需要完成数据的同步,可能的问题:

  1. pd无法访问到其余的store实例,从而无法完成同步,考虑检查网络问题
  2. 优先部署pd,再将所有的store实例部署完成后,运行init-store.sh脚本

Soyaazz avatar Jul 26 '25 04:07 Soyaazz