前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Elasticsearch 健康状态处理

Elasticsearch 健康状态处理

作者头像
潘成涛
发布2018-01-18 11:57:05
6540
发布2018-01-18 11:57:05
举报
文章被收录于专栏:程序员与猫程序员与猫

笔者在自己的 ubuntu 服务器上使用 GET /_cat/health?v 命令时,返回值如下所示

此处输入图片的描述
此处输入图片的描述

可以看到集群状态为 yellow,这是什么意思呢?原来在 es 的集群状态中,有三种情况,官网描述如下。

  • RED: Some or all of (primary) shards are not ready.
  • YELLOW: Elasticsearch has allocated all of the primary shards, but some/all of the replicas have not been allocated.
  • GREEN: Great. Your cluster is fully operational. Elasticsearch is able to allocate all shards and replicas to machines within the cluster.

由此可知,我们的分片副本还没有被分配到某个节点上。这是因为笔者目前的 es 集群由单节点组成,副本集没有足够的节点容纳它。解决办法也非常简单,由于笔者最近都是单机演示,这里也给出单机的解决方案(然并卵)。

笔者的 es 实例文件夹放在 elasticsearch\elasticsearch-5.2.2 文件夹下,将其复制一份为 elasticsearch\elasticsearch-5.2.2_node 放在同个文件夹下,然后按照正常步骤启动即可。再次使用 GET /_cat/health?v 查看时,便会返回一下内容

代码语言:javascript
复制
{
  "cluster_name": "elasticsearch",
  "status": "green",
  "timed_out": false,
  "number_of_nodes": 2,
  "number_of_data_nodes": 2,
  "active_primary_shards": 6,
  "active_shards": 12,
  "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
}
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017-03-26 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档