Docker 如何在不同的主机或容器上使用FoundationDB启动JanusGraph服务器?
我正在尝试使用-JanusGraph服务器、ElasticSearch服务器和FoundationDB服务器创建docker compose项目。我正在使用以下docker图像: 对于ElasticSearch-Docker 如何在不同的主机或容器上使用FoundationDB启动JanusGraph服务器?,docker,
elasticsearch,docker-compose,janusgraph,foundationdb,Docker,
elasticsearch,Docker Compose,Janusgraph,Foundationdb,我正在尝试使用-JanusGraph服务器、ElasticSearch服务器和FoundationDB服务器创建docker compose项目。我正在使用以下docker图像: 对于ElasticSearch-docker.elastic.co/ElasticSearch/ElasticSearch:6.3.2& 对于FoundationDB-FoundationDB/FoundationDB:6.0.15 以下是我的JanusGraph Dockerfile FROM opensuse #
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适配器初始化图形实现,出现以下错误:
[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)
我发现这里的问题是,FoundationDB服务器运行在不同的主机上,无法与其StoreManager API通信
但是,在主机内设置中同样可以很好地工作。我在同一台主机上运行了FoundationDB服务器和JanusGraph服务器,ElasticSearch服务器仍然作为docker容器运行
如果需要,我可以提供更多细节
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)