elasticsearch 6索引更改为仅在几秒钟后读取

sad*_*pro 15 elasticsearch

我想在mac os上使用elasticsearch 6,但是当我通过将文档添加到无存在索引来创建索引后,几秒钟索引更改为只读,如果添加文档或更新文档会出现此错误

"error" : {
    "root_cause" : [
      {
        "type" : "cluster_block_exception",
        "reason" : "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
      }
    ],
    "type" : "cluster_block_exception",
    "reason" : "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
  },
  "status" : 403
}
Run Code Online (Sandbox Code Playgroud)

我测试禁用只读

curl -H'Content-Type: application/json' -XPUT localhost:9200/test/_settings?pretty -d'
{
    "index": {
        "blocks.read_only": false
    }
}'
{
  "acknowledged" : true
}
Run Code Online (Sandbox Code Playgroud)

但没有变化

我用ubuntu测试另一个系统上的弹性6是没关系然后没有错误我想我的系统可能有问题但弹性搜索5.6.2没有任何错误

弹性日志是

[2018-01-05T21:56:52,254][WARN ][o.e.c.r.a.DiskThresholdMonitor] [gCjouly] flood stage disk watermark [95%] exceeded on [gCjoulysTFy1DDU7f7dOWQ][gCjouly][/Users/peter/Downloads/elasticsearch-6.1.1/data/nodes/0] free: 15.7gb[3.3%], all indices on this node will marked read-only
Run Code Online (Sandbox Code Playgroud)

小智 33

我有这个问题我认为在弹性6中添加新的设置来关闭索引当空硬小于5%时你可以在elasticsearch.yml下面的行中禁用它

 cluster.routing.allocation.disk.threshold_enabled: false
Run Code Online (Sandbox Code Playgroud)

然后重启elasticsearch.我希望这对你有用

  • 对于Mac上的用户,`/ usr/local/etc/elasticsearch/elasticsearch.yml` (5认同)

wil*_*747 9

复制/粘贴到Kibana控制台的便利

# disable threshold alert
PUT /_cluster/settings
{
  "persistent" : {
        "cluster.routing.allocation.disk.threshold_enabled" : false
    }
}

# unlock indices from read-only state
PUT /_all/_settings
{
  "index.blocks.read_only_allow_delete": null
}
Run Code Online (Sandbox Code Playgroud)


Noa*_*pak 6

如果您正在Docker中进行弹性搜索,则Docker可能空间不足。docker volume prune在Docker Preferences中运行以删除未使用的本地卷或增加磁盘映像大小。