启动后查看日志报错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

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐