OpenSPG / openspg

OpenSPG is a Knowledge Graph Engine developed by Ant Group in collaboration with OpenKG, based on the SPG (Semantic-enhanced Programmable Graph) framework. Core Capabilities: 1) domain model constrained knowledge modeling, 2) facts and logic fused representation, 3) KAG will be natively supported soon, so please stay tuned...
https://spg.openkg.cn/en-US
Apache License 2.0
618 stars 73 forks source link

TuGraphDbRpcException: Timeout while compiling plugin. #307

Closed SwordfallYeung closed 2 months ago

SwordfallYeung commented 2 months ago

docker-compose.yml内容

version: "3.7"
services:
  server:
    restart: always
    image: openspg/openspg-server:latest
    container_name: release-openspg-server
    ports:
      - "8887:8887"
    depends_on:
      - mysql
      - tugraph
      - elasticsearch
    command: [
      '--server.repository.impl.jdbc.host=mysql',
      '--server.repository.impl.jdbc.password=openspg',
      '--cloudext.graphstore.url=tugraph://tugraph:9090?graphName=default&timeout=50000&accessId=admin&accessKey=73@TuGraph',
      '--cloudext.searchengine.url=elasticsearch://elasticsearch:9200?scheme=http'
    ]

  mysql:
    restart: always
    image: openspg/openspg-mysql:latest
    container_name: release-openspg-mysql
    environment:
      TZ: Asia/Shanghai
      LANG: C.UTF-8
      MYSQL_ROOT_PASSWORD: openspg
      MYSQL_DATABASE: openspg
    ports:
      - "3306:3306"
    command: [
      '--character-set-server=utf8mb4',
      '--collation-server=utf8mb4_general_ci'
    ]

  tugraph:
    image: tugraph/tugraph-runtime-centos7:4.0.1
    container_name: release-openspg-tugraph
    # default username is admin and default password is 73@TuGraph
    ports:
      - "7070:7070"
      - "9090:9090"
    command: lgraph_server

  elasticsearch:
    image: elasticsearch:8.5.3
    container_name: release-openspg-elasticsearch
    ports:
      - "9200:9200"
      - "9300:9300"
    volumes:
      - /data/elasticsearch/data:/usr/share/elasticsearch/data
    environment:
      - discovery.type=single-node
      - xpack.security.enabled=false
      - ES_JAVA_OPTS=-Xms1g -Xmx1g

docker ps -a 状态

CONTAINER ID   IMAGE                                                                                                             COMMAND                   CREATED             STATUS                     PORTS                                                                                  NAMES
cb86645defeb   openspg/openspg-server:latest                                                                                     "java -jar arks-sofa…"   55 minutes ago      Up 55 minutes              0.0.0.0:8887->8887/tcp, :::8887->8887/tcp                                              release-openspg-server
14bf67d7d48c   openspg/openspg-python:latest                                                                                     "/bin/bash"               About an hour ago   Up About an hour                                                                                                  sweet_euler
eba0748b6eba   tugraph/tugraph-runtime-centos7:4.0.1                                                                             "lgraph_server"           About an hour ago   Up About an hour           0.0.0.0:7070->7070/tcp, :::7070->7070/tcp, 0.0.0.0:9090->9090/tcp, :::9090->9090/tcp   release-openspg-tugraph
cb470bcc0575   openspg/openspg-mysql:latest                                                                                      "docker-entrypoint.s…"   About an hour ago   Up About an hour           0.0.0.0:3306->3306/tcp, :::3306->3306/tcp                                              release-openspg-mysql
ea0467aed5ee   elasticsearch:8.5.3                                                                                               "/bin/tini -- /usr/l…"   About an hour ago   Up About an hour           0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp   release-openspg-elasticsearch

进入openspg/openspg-python容器内部执行如下命令:

knext config set --global graph_store_url="tugraph://127.0.0.1:9090?graphName=default&timeout=50000&accessId=admin&accessKey=73@TuGraph"73@TuGraph73@TuGraph
knext config set --global search_engine_url="elasticsearch://127.0.0.1:9200?scheme=http"
knext config set --global host_addr=http://127.0.0.1:8887
knext schema commit

knext schema commit报错:

Caused by: java.lang.RuntimeException: init TuGraph Client failed
    at com.antgroup.openspg.cloudext.impl.graphstore.tugraph.TuGraphStoreClient.initTuGraphClient(TuGraphStoreClient.java:142)
    at com.antgroup.openspg.cloudext.impl.graphstore.tugraph.TuGraphStoreClient.<init>(TuGraphStoreClient.java:84)
    at com.antgroup.openspg.cloudext.impl.graphstore.tugraph.TuGraphStoreClientDriver.innerConnect(TuGraphStoreClientDriver.java:36)
    at com.antgroup.openspg.cloudext.impl.graphstore.tugraph.TuGraphStoreClientDriver.innerConnect(TuGraphStoreClientDriver.java:22)
    at com.antgroup.openspg.common.util.cloudext.CachedCloudExtClientDriver.connect(CachedCloudExtClientDriver.java:29)
    at com.antgroup.openspg.cloudext.interfaces.graphstore.GraphStoreClientDriverManager.getClient(GraphStoreClientDriverManager.java:49)
    at com.antgroup.openspg.server.core.schema.service.alter.sync.GraphStorageSyncer.syncSchema(GraphStorageSyncer.java:31)
    at com.antgroup.openspg.server.core.schema.service.alter.stage.PostProcessStage.syncSchema(PostProcessStage.java:64)
    at com.antgroup.openspg.server.core.schema.service.alter.stage.PostProcessStage.execute(PostProcessStage.java:51)
    at com.antgroup.openspg.server.core.schema.service.alter.SchemaAlterPipeline.run(SchemaAlterPipeline.java:40)
    at com.antgroup.openspg.server.biz.schema.impl.SchemaManagerImpl.alterSchema(SchemaManagerImpl.java:76)
    ... 73 common frames omitted
Caused by: com.antgroup.tugraph.TuGraphDbRpcException: Timeout while compiling plugin. 

请问可以帮忙查下原因么

andylau-55 commented 2 months ago

容器间相互访问请设置为tugraph://release-openspg-tugraph:9090?graphName=default&timeout=50000&accessId=admin&accessKey=73@TuGraph elasticsearch://release-openspg-elasticsearch:9200?scheme=http

SwordfallYeung commented 2 months ago

容器间相互访问请设置为tugraph://release-openspg-tugraph:9090?graphName=default&timeout=50000&accessId=admin&accessKey=73@TuGraph elasticsearch://release-openspg-elasticsearch:9200?scheme=http

这个好像不是容器间相互访问的问题 我把docker-compose.yml改成如下内容:

'--cloudext.graphstore.url=tugraph://release-openspg-tugraph:9090?graphName=default&timeout=50000&accessId=admin&accessKey=73@TuGraph',
 '--cloudext.searchengine.url=elasticsearch://release-openspg-elasticsearch:9200?scheme=http'

重新启动openspg-server,openspg-server日志还是报一样的错

Caused by: com.antgroup.tugraph.TuGraphDbRpcException: Timeout while compiling plugin. 
Stdout:----

Stderr:----

    at com.antgroup.tugraph.TuGraphDbRpcClient$TuGraphSingleRpcClient.loadProcedure(TuGraphDbRpcClient.java:725)
    at com.antgroup.tugraph.TuGraphDbRpcClient.loadProcedure(TuGraphDbRpcClient.java:175)
    at com.antgroup.openspg.cloudext.impl.graphstore.tugraph.TuGraphStoreClient.loadCppPlugin(TuGraphStoreClient.java:175)
    at com.antgroup.openspg.cloudext.impl.graphstore.tugraph.TuGraphStoreClient.initTuGraphClient(TuGraphStoreClient.java:140)
    ... 83 common frames omitted

然后进入openspg-server容器内容使用telnet测试,是能访问到tugraph和elasticsearch的 image

能麻烦再帮忙看看么

SwordfallYeung commented 2 months ago

问题找到啦,发现是openeuler系统对docker tugraph/tugraph-runtime-centos7:4.0.1不是很支持,导致openspg-server一直无法正常加载upsert_edges.cpp和upsert_vertices.cpp这两个存储过程,后面换成centos系统就可以啦