如何在其他主机或容器上使用FoundationDB启动JanusGraph Server?

时间:2019-05-14 10:53:54

标签: docker elasticsearch docker-compose janusgraph foundationdb

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

对于ElasticSearch-docker.elastic.co/elasticsearch/elasticsearch:6.3.2
for 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容器运行。

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

0 个答案:

没有答案