elasticsearch报错 all shards failed修复

启动后查看日志报错all shards failed
1.查看健康状态

[root@iZbp1bzugfiorbfrhd333aZ ~]# curl -XGET 'http://172.16.163.226:9200/_cluster/health?pretty=true'
{
  "cluster_name" : "es-1",
  "status" : "yellow",    ####未修复前为red
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 2041,
  "active_shards" : 2041,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 5,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 99.75562072336265  ######未修复前为百分之40左右
}

2.查看损坏索引

curl -XGET 'http://172.16.163.226:9200/_cat/indices?v&pretty'

基本都是red和yellow为主
3.进行第一次修复:

curl -H "Content-Type: application/json" -XPUT 'http://172.16.163.226:9200/_all/_settings' -d '
{
    "index" : {
       "number_of_replicas" : 0
    }
}'

基本都为green了
**4.第二次修复,**发现还有一些损坏无法修复的直接删除类似如下

curl -XDELETE  "http://127.0.0.1:9200/test*

在进行日志查看的是否都为green了,启动

5.kibana报错Request Timeout after 30000ms启动报错

查看报错内存不足引起,2g改成4g,正常启动恢复

vi /home/es/elasticsearch-6.8.4/config/jvm.options



# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

-Xms4g
-Xmx4g

5.总结
估计是内存不足导致索引损坏引起的本次无法启动

引用内容:
https://blog.csdn.net/qq_40907977/article/details/104499178
https://www.cnblogs.com/likecs/p/14983881.html
https://www.cnblogs.com/gooooodmorning/p/13611825.html
https://www.cnblogs.com/zhangb8042/articles/11346085.html

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值