设为首页收藏本站

追梦Linux

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 538|回复: 0

Elasticsearch cluster health: yellow unassigned shards

[复制链接]

482

主题

485

帖子

16万

积分

CEO

Rank: 9Rank: 9Rank: 9

积分
168583

最佳新人活跃会员热心会员推广达人宣传达人灌水之王突出贡献优秀版主荣誉管理论坛元老

QQ
发表于 2017-3-11 00:13:27 | 显示全部楼层 |阅读模式
查看ES各个分片的状态
[Bash shell] 纯文本查看 复制代码
curl -XGET [url]http://127.0.0.1:9200/_cluster/health?pretty[/url]
{
  "cluster_name" : "elasticsearch",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 31,
  "active_shards" : 31,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 31,
  "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" : 50.0
}

Elasticsearch单台,增加kibana监控,集群状态总是黄色,索引kibana副本有问题,我ES里设置了一个
直接执行下列命令,删除多余副本
[Bash shell] 纯文本查看 复制代码
curl -XPUT "http://localhost:9200/_settings" -d'
{
  "number_of_replicas" : 0
}'

再次查看集群状态,返回正常

[Bash shell] 纯文本查看 复制代码
curl -XGET [url]http://127.0.0.1:9200/_cluster/health?pretty[/url]
{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 31,
  "active_shards" : 31,
  "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
}

小黑屋|手机版|Archiver|追梦Linux    点击这里给我发消息

GMT+8, 2020-2-26 04:48 , Processed in 2.220425 second(s), 34 queries .

Powered by 追梦Linux! X3.3 Licensed

© 2015-2017 追梦Linux!.

快速回复 返回顶部 返回列表