elasticsearch7.5 索引状态yellow问题解决

我的服务是windows单机服务并没有做集群。查看下目前索引的状态

GET _cluster/health

执行结果

{
  "cluster_name" : "dev",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 36,
  "active_shards" : 36,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 60,
  "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" : 37.5
}

状态为yellow,副本分片数2

GET /index/_settings
{
  "index" : {
    "settings" : {
      "index" : {
        "number_of_shards" : "30",
        "provided_name" : "product_dev",
        "max_result_window" : "2147483647",
        "creation_date" : "1611582359306",
        "number_of_replicas" : "2",
        "uuid" : "l7eYTZHsQkCF0Z4iquGG7w",
        "version" : {
          "created" : "7050299"
        }
      }
    }
  }
}

在单机情况下是不需要设置副本分区数。调整副本分区数为0,就🆗

PUT  /index/_settings
{ "number_of_replicas":0 }
{
  "acknowledged" : true
}

查看下状态,status已经为green

{
  "cluster_name" : "dev",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 36,
  "active_shards" : 36,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "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" : 100.0
}

 

  • 7
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值