elasticsearch health yellow

elasticsearch 状态查看:health为 yellow的解决办法

[elasticsearch@test01 logstash-6.3.1]$ curl 'localhost:9202/_cat/indices?v'

结果:

healthstatusindexprirepdocs.countdocs.deletedstore.sizepri.store.size
yellowopen.kibana11103.1kb3.1kb
yellowopeninfo5119485087.2mb87.2mb
[elasticsearch@test01 config]$ curl -XGET http://localhost:9202/_cluster/health?pretty=true

结果:

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

使用命令调整

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

更改后,再查询

[elasticsearch@test01 config]$ curl -XGET http://localhost:9202/_cluster/health?pretty=true

结果:

{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 6,
  "active_shards" : 6,
  "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
}
[elasticsearch@test01 config]$ curl 'localhost:9202/_cat/indices?v'
healthstatusindexprirepdocs.countdocs.deletedstore.sizepri.store.size
greenopen.kibana10103.1kb3.1kb
greenopeninfo5019485087.2mb87.2mb

如果

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


{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}% 

$ curl -H "Content-Type: application/json" -XPUT 'http://localhost:9200/_settings' -d '
{
    "index" : {
        "blocks": {"read_only_allow_delete": "false"}
    }
}
'
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值