美文网首页
elasticsearch报错处理

elasticsearch报错处理

作者: 陈文瑜 | 来源:发表于2019-07-20 14:21 被阅读0次
查询时报错
  • es aggs Fielddata is disabled on text fields by default. Set fielddata=true
    PUT megacorp/_mapping/employee/
    {
      "properties": {
        "interests": { 
          "type":     "text",
          "fielddata": true
        }
      }
    }
    GET /megacorp/employee/_search
    {
        "aggs" : {
            "all_interests" : {
                "terms" : { "field" : "interests" },
                "aggs" : {
                    "avg_age" : {
                        "avg" : { "field" : "age" }
                    }
                }
            }
        }
    }
    

安装启动时报错

  • max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
    ulimit -Hn
    ulimit -Sn
    vim /etc/security/limits.conf
    # 添加
    *               soft    nproc           4096
    *               hard    nproc           4096
    
  • max number of threads [3818] for user [es] is too low, increase to at least [4096]
    ulimit -Hu
    ulimit -Su
    vim /etc/security/limits.conf
    # 添加
    *               soft    nproc           4096
    *               hard    nproc           4096
    
  • max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    vim /etc/sysctl.conf
    # 添加
    vm.max_map_count=262144
    sysctl -p
    
  • Exception in thread "main" java.nio.file.AccessDeniedException: /usr/local/elasticsearch/elasticsearch-6.2.2-1/config/jvm.options
    chown -R vagrant:vagrant /usr/local/lib/elasticsearch/
    

相关文章

网友评论

      本文标题:elasticsearch报错处理

      本文链接:https://www.haomeiwen.com/subject/kgxulctx.html