我的服务是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
}

 

Logo

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

更多推荐