ELK - Elasticsearch Validation Failed: this cluster currently has [1000][1000] maximum shards open

ELK - Elasticsearch Validation Failed: this cluster currently has [1000][1000] maximum shards open,第1张

ELK - Elasticsearch Validation Failed: this cluster currently has [1000]/[1000] maximum shards open

Elasticsearch突然就写不进去了,看日志,shards有1000的限制。

Dev Tool
{
  "error" : {
    "root_cause" : [
      {
        "type" : "runtime_exception",
        "reason" : "Failed to persist transform configuration"
      }
    ],
    "type" : "runtime_exception",
    "reason" : "Failed to persist transform configuration",
    "caused_by" : {
      "type" : "validation_exception",
      "reason" : "Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [1000]/[1000] maximum shards open;"
    }
  },
  "status" : 500
}
elasticsearch.log
Caused by: org.elasticsearch.common.ValidationException: Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [1000]/[1000] maximum shards open;
        at org.elasticsearch.indices.ShardLimitValidator.validateShardLimit(ShardLimitValidator.java:80) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.cluster.metadata.metadataCreateIndexService.aggregateIndexSettings(metadataCreateIndexService.java:694) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.cluster.metadata.metadataCreateIndexService.applyCreateIndexRequestWithV1Templates(metadataCreateIndexService.java:477) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.cluster.metadata.metadataCreateIndexService.applyCreateIndexRequest(metadataCreateIndexService.java:360) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.cluster.metadata.metadataCreateIndexService.applyCreateIndexRequest(metadataCreateIndexService.java:367) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.action.admin.indices.create.AutoCreateAction$TransportAction.execute(AutoCreateAction.java:137) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:47) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.cluster.service.MasterService.executeTasks(MasterService.java:702) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:324) ~[elasticsearch-7.9.0.jar:7.9.0]
        at org.elasticsearch.cluster.service.MasterService.runTasks(MasterService.java:219) ~[elasticsearch-7.9.0.jar:7.9.0]
        ... 10 more
解决办法

权宜之计,当然是改大了。

PUT /_cluster/settings
{
  "transient": {
    "cluster": {
      "max_shards_per_node":2000
    }
  }
}

碰巧一起重启时,Kibana可能会因为这个错启动不了。

[Failed to create internal index mappings[org.elasticsearch.common.ValidationException: Validation Failed: 1: this action would add [2] shards, but this cluster currently has [1000]/[1000] maximum normal shards open;]]

但其实Elasticsearch还是可以访问的,用命令行即可。

curl localhost:9200/_cluster/health?pretty -uelasticuser:changeme

curl -X PUT "localhost:9200/_cluster/settings?pretty" -uelasticuser:changeme -H 'Content-Type: application/json' -d'
{
  "transient": {
    "cluster": {
      "max_shards_per_node":2000
    }
  }
}
'

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5433441.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-11
下一篇 2022-12-11

发表评论

登录后才能评论

评论列表(0条)

保存