【问题标题】:Spring boot and elastic search unsupported version minimal compatible versionSpring Boot 和 Elastic Search 不支持版本 最小兼容版本
【发布时间】:2018-05-29 16:45:10
【问题描述】:

这是我的 pom.xml

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 it.test 搜索测试 0.0.1-快照

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.M5</version>
</parent>

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <!-- Runtime, for Embedded Elasticsearch,
        comment this if connect to external elastic search server-->

    <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>transport</artifactId>

    </dependency>
</dependencies>

<build>
    <plugins>
        <!-- Package as an executable jar/war -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

当我开始我的项目时,我返回了这个堆栈跟踪:

    [2017-12-15T13:36:15,670][WARN ][o.e.t.n.Netty4Transport  ] [node1] exception caught on transport layer [org.elasticsearch.transport.netty4.NettyTcpChannel@7c08d374], closing connection
java.lang.IllegalStateException: Received message from unsupported version: [5.5.3] minimal compatible version is: [5.6.0]
        at org.elasticsearch.transport.TcpTransport.ensureVersionCompatibility(TcpTransport.java:1428) ~[elasticsearch-6.1.0.jar:6.1.0]
        at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:1375) ~[elasticsearch-6.1.0.jar:6.1.0]
        at org.elasticsearch.transport.netty4.Netty4MessageChannelHandler.channelRead(Netty4MessageChannelHandler.java:64) ~[transport-netty4-6.1.0.jar:6.1.0]

我必须在我的 pom 中进行哪些更改才能解决这种不兼容问题?

谢谢

【问题讨论】:

    标签: java elasticsearch elasticsearch-plugin spring-data-elasticsearch


    【解决方案1】:

    将传输版本更改为与您的 elasticsearch 实例相同

    【讨论】:

      【解决方案2】:

      你的 ElasticSearch 是什么版本,也许你可以尝试在你的 pom 中添加这个属性。

      <properties>
          <elasticsearch.version>6.1.0</elasticsearch.version>
      </properties>
      

      【讨论】:

        【解决方案3】:

        我总是发现Spring data elasticsearch matrix 表对于确定要使用的兼容版本很有用。

        要将 ES 从版本更改为兼容版本,请使用 Spring Boot 专用模块来指定依赖版本。将elasticsearch.version 添加到您的 pom 属性中

        <properties>
            ...
            <elasticsearch.version>1.7.2</elasticsearch.version>
            ...
        </properties>
        

        【讨论】:

          【解决方案4】:

          我也遇到了类似的错误但得到了解决,在此之前我想突出显示我的 spring boot starter 父版本是 1.5.9.RELEASE,其次我在 spring 中单独使用 spring-boot-starter-data-elasticsearch artifact可以删除启动弹性搜索和其他工件,最后是您使用已安装的弹性搜索应用程序收到的现象问题,尝试下载此版本https://www.elastic.co/downloads/past-releases/elasticsearch-2-4-0 并重试....

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2022-11-09
            • 1970-01-01
            • 2021-12-16
            • 2015-05-29
            • 2019-11-12
            • 2021-06-29
            • 2019-08-27
            • 2019-08-19
            相关资源
            最近更新 更多