• ElasticSearch使用注意


    1、代码中配置cluster-name和es中的cluster-name要统一,然后es中network-port要正确127.0.0.1。

    2、springboot中与es的版本要统一,在spring-data-elasticsearch中子包transport-netty4-client可以查找到。

    不统一可能遇见报错:无法连接到es、

    3、尽量不要用最新版,最新稳定版也不要用,容易和其他组件不兼容

    4、blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];

    说明此索引是只读的,原因:磁盘空间不足自动将索引设置为只读(磁盘占用95则会此状态)、或者索引状态为只读
    如果空间不足解决方法:
    1、释放磁盘空间,自己操作
    2、在es的config的elasticsearch.yml中加入:
    cluster.routing.allocation.disk.watermark.flood_stage: 99% # 设置空间阈值99%
    cluster.routing.allocation.disk.threshold_enabled: false # 设置不关心磁盘空间,就算满了
    3、设置索引read_only_allow_delete值为false
    4、重启es
    索引状态位只读:
    1、设置索引read_only_allow_delete值为false
    2、重启es
    设置索引read_only_allow_delete值为false的方法:

    注意item为你的索引名,然后返回样例:

    地址:http://127.0.0.1:9200/你的索引名/_settings
    参数:
    { "index.blocks.read_only_allow_delete": null }
    则代表成功

    分页从0开始

    Error creating bean with name 'elasticsearchClient' defined in class path resource [org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory method 'elasticsearchClient' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]

  • 相关阅读:
    在mac系统上安装Eclipse,编写java程序
    显示和隐藏Mac隐藏文件的终端命令
    iOS中UIKit——UIDataDetectors(数据检测器)它将电话、邮件、网址等变为链接
    C语言中的关键字
    IOS基础——静态方法(类方法)和实例方法
    IOS基础——alloc、init和new方法
    IOS基础——实例变量四种范围类型
    iOS中UIKit——UIFont得到iOS设备上的系统字体
    iOS中UIKit——UIButton设置边框
    IOS中获取屏幕尺寸
  • 原文地址:https://www.cnblogs.com/daihang2366/p/13772102.html
Copyright © 2020-2023  润新知