博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Elasticsearch 健康状态处理
阅读量:4693 次
发布时间:2019-06-09

本文共 1159 字,大约阅读时间需要 3 分钟。

笔者在自己的 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 查看时,便会返回一下内容

{  "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}

转载于:https://www.cnblogs.com/Wddpct/p/6623208.html

你可能感兴趣的文章
gnome2 恢复默认 panel
查看>>
Python 爬虫的集中简单方式
查看>>
数据库MySQL/mariadb知识点——触发器
查看>>
Adaboost算法结合Haar-like特征
查看>>
Ubuntu做Tomcat服务:insserv: warning: script 'tomcat' missing LSB tags and overrides
查看>>
Binary Agents
查看>>
入门Webpack,看这篇就够了
查看>>
短信拦截马”黑色产业链与溯源取证研究
查看>>
Mac Xdebug安装时遇到了Zend Engine API 不一致的问题
查看>>
最小公倍数
查看>>
asp.net如何定时执行任务
查看>>
在github上实现页面托管预览功能
查看>>
css选择器
查看>>
prim
查看>>
给陌生人写一封信
查看>>
noip2013花匠
查看>>
[CF]Equalize Them All
查看>>
React Ant design table表单与pagination分页配置
查看>>
重大发现: windows下C++ UI库 UI神器-SOUI(转载)
查看>>
linux 压缩文件的命令总结
查看>>