elasticsearch设置分片数量

DevOps ELK评论3,682字数 137阅读0分27秒阅读模式

简述

今天发现es不能正常接入数据,查看Filebeat发现分片已超出默认的1000

Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"********-2021-
01-16", :routing=>nil, :_type=>"_doc"}, #<LogStash::Event:0x15df4cd0>], :response=>{"index"=>
{"_index"=>"********-2021-01-16", "_type"=>"_doc", "_id"=>nil, "status"=>400, "error"=>
{"type"=>"validation_exception", "reason"=>"Validation Failed: 1: this action would add [2] total shards, but 
this cluster currently has [999]/[1000] maximum shards open;"}}}}

配置es

配置文件中加一行

cluster.max_shards_per_node: 10000

[centos@us-prod-sre-eslog-node-1 ~]$ vim /data/elasticsearch/config/elasticsearch.yml
cluster.max_shards_per_node: 10000

重启服务后生效

elasticsearch设置分片数量

 
DevOps
  • 本文由 DevOps 发表于 2022年9月1日 16:26:37
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
  • Elasticsearch
yum安装Logstash ELK

yum安装Logstash

下载rpm包 [root@ip-172-31-0-46 ~]# wget https://artifacts.elastic.co/downloads/logstash/logstash-7.17.0...
EFK集群[案例] ELK

EFK集群[案例]

Elasticsearch集群配置信息 硬件配置信息 机器名/节点名 IP 内存 cpu 磁盘 us-prod-sre-eslog-node-1 10.0.3.77 32GB 16vcpu 7T us...
python定时清理ES 索引 ELK

python定时清理ES 索引

只保留三天 #!/usr/bin/env python3 # -*- coding:utf-8 -*- import os import datetime # 时间转化为字符串 now_time = ...

发表评论