3

I am trying to create a docker-compose project with - JanusGraph server, ElasticSearch server and FoundationDB server. I am using following docker images:

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

Following is my 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"]

Here is my entrypoint script:

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

tailf ./log/gremlin-server.log

Here is 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

Now, when I create these services, JanusGraph server(gremlin server) starts with ElasticSearch instance. But it fails to initialize a Graph implementation from FoundationDB adapter with following error:

[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)

The problem here I find is, FoundationDB server is running on different host and it's not able to communicate with it's StoreManager API.

However, the same works very well in an in-host setup. There I have FoundationDB server and JanusGraph server running in a same host machine with ElasticSearch server still running as a docker container.

I can provide more details if required.

Jaydeep Ranipa
  • 421
  • 5
  • 16

1 Answers1

1

I reuse your Dockerfile and docker-compose.yml without any changes. It seem ok to me.

enter image description here

Lewis Chan
  • 695
  • 6
  • 18