elasticsearch5.4.3异常解决

首先说明一下,刚开始学习时我本地jdk版本是1.7,Java客户端maven配置如下


                org.elasticsearch.client
                transport
                5.4.1
            
            
                org.elasticsearch
                elasticsearch
                5.4.1
            
这样会报错,提示版本兼容方面的错误。

于是把elasticsearch.client版本换到2.几,还是会报错。

最终的解决方案是jdk升级到1.8,elasticsearch.client版本使用5.4.1。我看网上的资料有的说是elasticsearch5在jdk1.7环境下也能运行,不知道是怎么配置的,看官网的文档描述如下(https://www.elastic.co/guide/en/elasticsearch/reference/5.4/setup.html)

Java (JVM) Versionedit

Elasticsearch is built using Java, and requires at least Java 8 in order to run. Only Oracle’s Java and the OpenJDK are supported. The same JVM version should be used on all Elasticsearch nodes and clients.

We recommend installing Java version 1.8.0_131 or later. Elasticsearch will refuse to start if a known-bad version of Java is used.

也就是说jdk1.8是必须的。


出错场景1:

使用字段进行聚合操作;


eclipse控制台错误信息:

java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [result] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.


解决方法:

 PUT /your_index/_mapping/your_type?update_all_types
    {
      "properties": {
        "your_fields": {
          "type": "text",
          "fielddata": true
        }
      }
    }
返回

{
  "acknowledged": true
}

出错场景2:删除索引超时

DELETE /my_store
返回504 timeout

以为是命令错了或者版本的问题,各种试,最后发现是老爷机的内存被吃光了 =_=!

elasticsearch5.4.3异常解决_第1张图片


你可能感兴趣的:(elasticsearch)