2

我正在尝试使用 JanusGraph 服务器、ElasticSearch 服务器和 FoundationDB 服务器创建一个 docker-compose 项目。我正在使用以下泊坞窗图像:

对于 ElasticSearch - docker.elastic.co/elasticsearch/elasticsearch:6.3.2&
对于 FoundationDB - foundationdb/foundationdb:6.0.15

以下是我的 JanusGraph Dockerfile

FROM opensuse

# JanugGraphDB version
ENV JANUSGRAPH_VERSION 0.3.0
# FoundationDB Adapter version
ENV JANUS_FDB_VERSION 0.1.0

# Install pre-requisite packages
RUN zypper up; \
    zypper --no-refresh -n in java-1_8_0-openjdk wget unzip iproute2 java-1_8_0-openjdk-devel which

# Download JanusGraphDB & FoundationDB Adapter
RUN mkdir -p /root/downloads; \
    cd /root/downloads; \
    wget -q "https://github.com/JanusGraph/janusgraph/releases/download/v$JANUSGRAPH_VERSION/janusgraph-$JANUSGRAPH_VERSION-hadoop2.zip" -O "janusgraph.zip"; \
    wget -q "https://github.com/experoinc/janusgraph-foundationdb/releases/download/v$JANUS_FDB_VERSION/janusgraph-foundationdb-$JANUS_FDB_VERSION-distribution.zip" -O "janusgraph-foundationdb.zip";

# Extract JanusGraphDB and FoundationDB Adapter
RUN mkdir -p /root/install; \
    cd /root/install; \
    unzip -q "/root/downloads/janusgraph.zip"; \
    unzip -q "/root/downloads/janusgraph-foundationdb.zip";

# Remove downloaded archives to save disk space
#RUN    rm "/root/downloads/janusgraph.zip" "/root/downloads/janusgraph-foundationdb.zip";

# Install FoundationDB storage adapter in JanusGraph Installation
RUN cd /root/install; \
    cd "janusgraph-foundationdb-$JANUS_FDB_VERSION"; \
    ./install.sh "/root/install/janusgraph-$JANUSGRAPH_VERSION-hadoop2";

COPY "start.sh" /root/install/

ENTRYPOINT ["/root/install/start.sh"]

这是我的入口点脚本:

#!/bin/sh
cd /root/install/janusgraph*
: ${ELASTICSEARCH_IP:=127.0.0.1}
: ${ELASTICSEARCH_PORT:=9200}
./bin/janusgraph.sh start

tailf ./log/gremlin-server.log

这是 docker-compose.yml

version: '3'

services:
   fdb1:
     image: foundationdb/foundationdb:6.0.15
     ports:
     - 4500:4500
   els1:
     image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2
     ports:
     - 9300:9300
     - 9200:9200
     environment:
     - discovery.type=single-node
     depends_on:
     - fdb1
   janus1:
    #image: 164.99.163.225/gshalabh/janusgraph:latest
     image: janusgraph-on-fdb:latest
     depends_on:
     - els1
     - fdb1
     links:
     - fdb1:foundationdb
     ports:
     - 8182:8182
     environment:
     - ELASTICSEARCH_IP=els1
     - ELASTICSEARCH_PORT=9200

现在,当我创建这些服务时,JanusGraph 服务器(gremlin 服务器)从 ElasticSearch 实例开始。但它无法从 FoundationDB 适配器初始化 Graph 实现,并出现以下错误:

[main] WARN  org.apache.tinkerpop.gremlin.server.GremlinServer  - Graph [graph] configured at [conf/gremlin-server/janusgraph-foundationdb-es-server.properties] could not be instantiated and will not be available in Gremlin Server.  GraphFactory message: GraphFactory could not instantiate this Graph implementation [class org.janusgraph.core.JanusGraphFactory]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class org.janusgraph.core.JanusGraphFactory]
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70)
Caused by: java.lang.IllegalArgumentException: Could not instantiate implementation: com.experoinc.janusgraph.diskstorage.foundationdb.FoundationDBStoreManager
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:64)
        at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:476)
        at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:408)

我发现这里的问题是,FoundationDB 服务器在不同的主机上运行,​​它无法与它的 StoreManager API 通信。

但是,在主机内设置中同样可以很好地工作。我有 FoundationDB 服务器和 JanusGraph 服务器在同一台主机上运行,​​而 ElasticSearch 服务器仍然作为 docker 容器运行。

如果需要,我可以提供更多详细信息。

4

1 回答 1

1

我重用您的 Dockerfile 和 docker-compose.yml 而不做任何更改。我觉得没问题。

在此处输入图像描述

于 2021-10-12T09:47:05.740 回答