elasticsearchcassandrajanusgraphgremlin-serverelasticsearch-6

Migrate Elastic search data from 5.6.4 to 6.6.0


I am running Janusgraph(0.3.1) with Cassandra(3.11.1) and Elastic search(5.6.4) using Docker. But, now I migrated to the latest versions i.e (janusgraph: latest, Cassandra: 3, elastic search: 6.6.0) and also I am running multiple graphs. This worked fine but, I am not able to use the old data. When I try to mount old volumes of Cassandra and Elastic search, I am facing some issues with the Elastic search. But, When I am running a single graph with the latest versions and old volumes, it is working fine. When I try to use multiple graphs Janusgraph is not able to configure with Elastic search.

For doing this, instead of mounting old volumes I tried to import the old data from a graph using gyro format(which I have already exported from the old server). But there also I am facing this issue.

I have tried in two ways but in both ways, I am facing some issues. Any help will be appreciated

Here is my docker-compose.yml file

version: "3"

services:      
  janusgraph:
    image: janusgraph/janusgraph:latest
    container_name: jce-janusgraph
    environment:
      JANUS_PROPS_TEMPLATE: cassandra-es
      janusgraph.storage.backend: cql
      janusgraph.storage.hostname: jce-cassandra
      janusgraph.index.search.hostname: jce-elastic
    volumes:
     - /mnt/janusvol/janus/scripts:/opt/janusgraph/tmp/scripts
     - /mnt/janusvol/janus/conf/gremlin-server.yaml:/opt/janusgraph/conf/gremlin-server/gremlin-server.yaml
     - /mnt/janusvol/janus/conf/empty-sample.groovy:/opt/janusgraph/scripts/empty-sample.groovy
     - /mnt/janusvol/janus/conf/janusgraph-cql-es-server-geniegraph.properties:/opt/janusgraph/conf/gremlin-server/janusgraph-cql-es-server-geniegraph.properties
     - /mnt/janusvol/janus/conf/janusgraph-cql-es-server-aagraph.properties:/opt/janusgraph/conf/gremlin-server/janusgraph-cql-es-server-aagraph.properties
    ports:
      - "8182:8182"
    networks:
      - jce-network
    healthcheck:
      test: ["CMD", "bin/gremlin.sh", "-e", "scripts/remote-connect.groovy"]
      interval: 10s
      timeout: 30s
      retries: 3
    entrypoint:
      - bin/gremlin-server.sh
      - conf/gremlin-server/gremlin-server.yaml
    links:
      - cassandra
      - elasticsearch
  cassandra:
    image: cassandra:3
    container_name: jce-cassandra
    volumes:
      - /mnt/janusvol/cassandra:/var/lib/cassandra
    environment:
      - "CASSANDRA_CLUSTER_NAME=GenieCass"
      - "HEAP_NEWSIZE=1024M"
      - "MAX_HEAP_SIZE=1024M"
    ports:
      - "7000:7000"
      - "9042:9042"
      - "9160:9160"
    networks:
      - jce-network
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.6.0
    container_name: jce-elastic
    environment:
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g -XX:HeapDumpPath=/var/lib/heapdump"
      - "http.host=0.0.0.0"
      - "network.host=0.0.0.0"
      - "transport.host=127.0.0.1"
      - "cluster.name=docker-cluster"
      - "xpack.security.enabled=false"
      - "discovery.zen.minimum_master_nodes=1"
        #      - "es.enforce.bootstrap.checks=true"
    volumes:
      - /mnt/janusvol/elas/data:/usr/share/elasticsearch/data
      - /mnt/janusvol/elas/heapdump:/var/lib/heapdump
    ports:
      - "9200:9200"
      - "9300:9300"
        # command: ['chown', '-R', '1000:1000', '/usr/share/elasticsearch/data']
    networks:
      - jce-network

networks:
  jce-network:

Here is my janusgraph logs:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/janusgraph/lib/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/janusgraph/lib/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
0    [main] INFO  com.jcabi.manifests.Manifests  - 110 attributes loaded from 282 stream(s) in 2s, 110 saved, 3788 ignored: ["Agent-Class", "Ant-Version", "Archiver-Version", "Automatic-Module-Name", "Bnd-LastModified", "Boot-Class-Path", "Branch", "Build-Date", "Build-Host", "Build-Id", "Build-Java-Version", "Build-Jdk", "Build-Job", "Build-Number", "Build-Timestamp", "Build-Version", "Built-At", "Built-By", "Built-Date", "Built-OS", "Built-On", "Built-Status", "Bundle-ActivationPolicy", "Bundle-Activator", "Bundle-BuddyPolicy", "Bundle-Category", "Bundle-ClassPath", "Bundle-ContactAddress", "Bundle-Description", "Bundle-DocURL", "Bundle-License", "Bundle-ManifestVersion", "Bundle-Name", "Bundle-NativeCode", "Bundle-RequiredExecutionEnvironment", "Bundle-SymbolicName", "Bundle-Vendor", "Bundle-Version", "Can-Redefine-Classes", "Change", "Class-Path", "Created-By", "DSTAMP", "DynamicImport-Package", "Eclipse-BuddyPolicy", "Eclipse-ExtensibleAPI", "Embed-Dependency", "Embed-Transitive", "Export-Package", "Extension-Name", "Extension-name", "Fragment-Host", "Gradle-Version", "Gremlin-Lib-Paths", "Gremlin-Plugin-Dependencies", "Gremlin-Plugin-Paths", "Ignore-Package", "Implementation-Build", "Implementation-Build-Date", "Implementation-Title", "Implementation-URL", "Implementation-Vendor", "Implementation-Vendor-Id", "Implementation-Version", "Import-Package", "Include-Resource", "JCabi-Build", "JCabi-Date", "JCabi-Version", "Java-Vendor", "Java-Version", "Main-Class", "Manifest-Version", "Maven-Version", "Module-Email", "Module-Origin", "Module-Owner", "Module-Source", "Originally-Created-By", "Os-Arch", "Os-Name", "Os-Version", "Package", "Premain-Class", "Private-Package", "Provide-Capability", "Require-Bundle", "Require-Capability", "Scm-Connection", "Scm-Revision", "Scm-Url", "Specification-Title", "Specification-Vendor", "Specification-Version", "TODAY", "TSTAMP", "Time-Zone-Database-Version", "Tool", "X-Compile-Elasticsearch-Snapshot", "X-Compile-Elasticsearch-Version", "X-Compile-Lucene-Version", "X-Compile-Source-JDK", "X-Compile-Target-JDK", "hash", "implementation-version", "mode", "package", "service", "url", "version"]
57   [main] INFO  org.apache.tinkerpop.gremlin.server.GremlinServer  - 3.4.4
         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----

1334 [main] INFO  org.apache.tinkerpop.gremlin.server.GremlinServer  - Configuring Gremlin Server from conf/gremlin-server/gremlin-server.yaml
1804 [main] INFO  org.apache.tinkerpop.gremlin.server.util.MetricManager  - Configured Metrics ConsoleReporter configured with report interval=180000ms
1818 [main] INFO  org.apache.tinkerpop.gremlin.server.util.MetricManager  - Configured Metrics CsvReporter configured with report interval=180000ms to fileName=/tmp/gremlin-server-metrics.csv
2186 [main] INFO  org.apache.tinkerpop.gremlin.server.util.MetricManager  - Configured Metrics JmxReporter configured with domain= and agentId=
2237 [main] INFO  org.apache.tinkerpop.gremlin.server.util.MetricManager  - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
4663 [main] INFO  com.datastax.driver.core  - DataStax Java driver 3.7.2 for Apache Cassandra
4758 [main] INFO  com.datastax.driver.core.GuavaCompatibility  - Detected Guava < 19 in the classpath, using legacy compatibility layer
5244 [main] INFO  com.datastax.driver.core.Native  - Could not load JNR C Library, native system calls through this library will not be available (set this logger level to DEBUG to see the full stack trace).
5248 [main] INFO  com.datastax.driver.core.ClockFactory  - Using java.lang.System clock to generate timestamps.
6088 [main] INFO  com.datastax.driver.core.NettyUtil  - Found Netty's native epoll transport in the classpath, using it
10922 [main] INFO  com.datastax.driver.core.policies.DCAwareRoundRobinPolicy  - Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)
10949 [main] INFO  com.datastax.driver.core.Cluster  - New Cassandra host jce-cassandra/172.20.0.3:9042 added
14634 [main] INFO  org.janusgraph.core.util.ReflectiveConfigOptionLoader  - Loaded and initialized config classes: 13 OK out of 13 attempts in PT1.079S
15522 [main] INFO  org.reflections.Reflections  - Reflections took 346 ms to scan 2 urls, producing 0 keys and 0 values
18513 [main] INFO  org.janusgraph.graphdb.idmanagement.UniqueInstanceIdRetriever  - Generated unique-instance-id=ac14000431-7e0aa97456d61
18661 [main] INFO  com.datastax.driver.core.ClockFactory  - Using java.lang.System clock to generate timestamps.
19701 [main] INFO  com.datastax.driver.core.policies.DCAwareRoundRobinPolicy  - Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)
19707 [main] INFO  com.datastax.driver.core.Cluster  - New Cassandra host jce-cassandra/172.20.0.3:9042 added
19899 [main] INFO  org.janusgraph.diskstorage.Backend  - Configuring index [search]
24417 [main] WARN  org.janusgraph.diskstorage.es.rest.RestElasticSearchClient  - Unable to determine Elasticsearch server version. Default to FIVE.
java.net.ConnectException: Connection refused
        at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:952)
        at org.elasticsearch.client.RestClient.performRequest(RestClient.java:229)
        at org.elasticsearch.client.RestClient.performRequest(RestClient.java:274)
        at org.janusgraph.diskstorage.es.rest.RestElasticSearchClient.getMajorVersion(RestElasticSearchClient.java:118)
        at org.janusgraph.diskstorage.es.rest.RestElasticSearchClient.<init>(RestElasticSearchClient.java:101)
        at org.janusgraph.diskstorage.es.rest.RestClientSetup.getElasticSearchClient(RestClientSetup.java:107)
        at org.janusgraph.diskstorage.es.rest.RestClientSetup.connect(RestClientSetup.java:74)
        at org.janusgraph.diskstorage.es.ElasticSearchSetup$1.connect(ElasticSearchSetup.java:50)
        at org.janusgraph.diskstorage.es.ElasticSearchIndex.interfaceConfiguration(ElasticSearchIndex.java:379)
        at org.janusgraph.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:295)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
        at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:440)
        at org.janusgraph.diskstorage.Backend.getIndexes(Backend.java:427)
        at org.janusgraph.diskstorage.Backend.<init>(Backend.java:150)
        at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1352)
        at org.janusgraph.graphdb.database.StandardJanusGraph.<init>(StandardJanusGraph.java:142)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:161)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:132)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:104)
        at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.lambda$new$0(DefaultGraphManager.java:57)
        at java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:671)
        at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.<init>(DefaultGraphManager.java:55)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:80)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:122)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:86)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:345)
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:714)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:171)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:145)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:192)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.lang.Thread.run(Thread.java:748)
24582 [main] WARN  org.apache.tinkerpop.gremlin.server.GremlinServer  - Graph [graph] configured at [conf/gremlin-server/janusgraph-cql-es-server-geniegraph.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)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:104)
        at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.lambda$new$0(DefaultGraphManager.java:57)
        at java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:671)
        at org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.<init>(DefaultGraphManager.java:55)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:80)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:122)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:86)
        at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:345)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78)
        ... 13 more
Caused by: java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.es.ElasticSearchIndex
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:64)
        at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:440)
        at org.janusgraph.diskstorage.Backend.getIndexes(Backend.java:427)
        at org.janusgraph.diskstorage.Backend.<init>(Backend.java:150)
        at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.getBackend(GraphDatabaseConfiguration.java:1352)
        at org.janusgraph.graphdb.database.StandardJanusGraph.<init>(StandardJanusGraph.java:142)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:161)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:132)
        at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:112)
        ... 18 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
        ... 26 more
Caused by: org.janusgraph.diskstorage.PermanentBackendException: Connection refused
        at org.janusgraph.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:315)
        ... 31 more
Caused by: java.net.ConnectException: Connection refused
        at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:952)
        at org.elasticsearch.client.RestClient.performRequest(RestClient.java:229)
        at org.elasticsearch.client.RestClient.performRequest(RestClient.java:296)
        at org.janusgraph.diskstorage.es.rest.RestElasticSearchClient.clusterHealthRequest(RestElasticSearchClient.java:133)
        at org.janusgraph.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:313)
        ... 31 more
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:714)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:171)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:145)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:192)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.lang.Thread.run(Thread.java:748)

Solution

  • We can achieve this by importing the graph data in gryo/json/graphml format. The Practical Gremlin book has lots of examples of using Gremlin's io() step for example - kelvinlawrence.net/book/… Gryo specific usage with io() step can be found here: tinkerpop.apache.org/docs/current/reference/#gryo