将 Elastic 搜索数据从 5.6.4 迁移到 6.6.0

Migrate Elastic search data from 5.6.4 to 6.6.0

我是 运行 Janusgraph(0.3.1) 与 Cassandra(3.11.1) 和 Elastic search(5.6.4) 使用 Docker。但是,现在我迁移到最新版本,即(janusgraph:最新,Cassandra:3,elastic search:6.6.0),而且我是 运行 多个图。这工作正常,但我无法使用旧数据。当我尝试装载 Cassandra 和 Elastic search 的旧卷时,我遇到了 Elastic search 的一些问题。但是,当我 运行 具有最新版本和旧卷的单个图表时,它工作正常。当我尝试使用多个图表时,Janusgraph 无法使用弹性搜索进行配置。

为此,我尝试使用陀螺仪格式(我已经从旧服务器导出)从图表中导入旧数据,而不是安装旧数据卷。但我也面临着这个 issue.

我尝试了两种方法,但在这两种方法中,我都面临一些问题。任何帮助将不胜感激

这是我的docker-compose.yml文件

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:

这是我的 janusgraph 日志:

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.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[=11=](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.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[=11=](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.run(CloseableHttpAsyncClientBase.java:64)
        at java.lang.Thread.run(Thread.java:748)

我们可以通过以 gryo/json/graphml 格式导入图形数据来实现这一点。 Practical Gremlin 书中有很多使用 Gremlin 的 io() 步骤的示例 - kelvinlawrence.net/book/… Gryo specific usage with io() step can be found here: tinkerpop.apache.org/docs/current/reference/#gryo