Elasticsearch health red, unassigned shard
Elasticsearch 分多个node,在不同node上放shard,有primary shard,还有replica shard,数据放不同shard上为了保证高可用性。
最近接到一份elasticsearch的环境,打开就是无法使用。
1. 查看健康状态为red,unassigned_shards 是4
http://localhost:9200/_cluster/health?pretty
2. 查看都有哪些index,想着不行把index都删除了,发现也没啥index就是不可用。
http://127.0.0.1:9200/_cat/indices?v
删除命令:curl -XDELETE 'http://127.0.0.1:9200/index-name'
查看不同的shards,有没有unassigned,发现有
http://127.0.0.1:9200/_cat/shards
3. 尝试reroute,把shard给分配了,重试几次就结束,没成功
curl -XPOST 'localhost:9200/_cluster/reroute?retry_failed=true'
4. 查看其中的一个index,没发现问题
http://localhost:9200/index-name/_settings?pretty
5. 查看集群问题原因,发现是磁盘快没了超过watermark就不写数据了
curl -XGET 'localhost:9200/_cluster/allocation/explain?pretty'
6. 尝试把watermark调高
curl -H "Content-Type: application/json" -XPUT '127.0.0.1:9200/_cluster/settings' -d '{"transient": { "cluster.routing.allocation.disk.watermark.low": "95%", "cluster.routing.allocation.disk.watermark.high": "98%", "cluster.routing.allocation.disk.watermark.flood_stage": "99%", "cluster.info.update.interval": "1m"}}'
7. 因为只有一个node,es需要node数 > replica + 1,node是1,把replica设0
curl -XPUT 'http://localhost:9200/_settings' -H 'content-Type:application/json' -d'{"number_of_replicas": 0}'
curl -XPUT 'http://localhost:9200/index-name/_settings' -H 'content-Type:application/json' -d'
{"number_of_replicas": 0}'
8. 集群red变green
9. 把返回结果数调大:
curl -H "Content-Type: application/json" -XPUT http://127.0.0.1:9200/coupon-tweets/_settings -d '{ "index" : { "max_result_window" : 200000000}}'
Elasticsearch health red, unassigned shard相关推荐
- elasticsearch 索引 red 状态恢复 green
ES集群状态.节点.索引及基本查询 一.elasticsearch 索引 red 状态恢复 green 错误原因 由于CPU占用过高或者有部分节点的分片不可用,未被分配: 解决: 重新分配未被分配的分 ...
- elasticsearch副本分片UNASSIGNED
elasticsearch副本分片UNASSIGNED 通过命令查看 curl -XGET http://127.0.0.1:9200/_cat/shards?h=index,shard,prirep ...
- 【Elasticsearch】Elasticsearch底层系列之Shard Allocation机制
1.概述 转载:Elasticsearch底层系列之Shard Allocation机制 背景 Elasticsearch由一些Elasticsearch进程(Node)组成集群,用来存放索引(Ind ...
- Recovering unassigned shards on elasticsearch 2.x——副本shard可以设置replica为0在设置回来...
Recovering unassigned shards on elasticsearch 2.x 摘自:https://z0z0.me/recovering-unassigned-shards-on ...
- 解决elasticsearch集群Unassigned Shards无法reroute的问题
1.背景&问题描述 接上篇文章https://blog.csdn.net/dhaibo1986/article/details/107564968 在上一篇文章中,由于系统宕机,导致大量索引出 ...
- elasticsearch health yellow
csdn博客地址(已测试过):https://blog.csdn.net/yangyangrenren/article/details/81100836 官方地址:https://www.elasti ...
- Elasticsearch出现yellow,Unassigned节点的问题解决
最近公司新业务需要ES,最近在使用es的时候就出现了问题了,分布节点出现 Unassigned,纠结了半天,查阅官方和其他资料给出的几种情况作了下总结.这边用的kibana命令 一.可能存在未作分片的 ...
- 解决elasticsearch主分片unassigned的问题
[root@localhost ~]# sh -x /tmp/es.sh + curl -XPOST localhost:9500/_cluster/reroute -d '{ "comma ...
- 【Elasticsearch】 es primary shard 主分片 PrimaryOperationTransportHandler
1.概述 5.源码分析 Primary请求的入口是PrimaryOperationTransportHandler的MessageReceived, 当接收到请求时,执行的逻辑如下 判断操作类型 遍历 ...
最新文章
- 管理多供应商物联网项目的10个关键步骤
- python零基础怎么学-零基础的小白怎么学python?
- 巧用Mono.Cecil反射加载类型和方法信息
- python批量清除一个列表中的某个内容,filter和lambda结合使用的方法
- 质性研究工具_质性研究【001】
- 搞了个30天学习量化的数据资料,可以bt做全球。数据链接白送
- mysql public权限_MySQL · 引擎特性 · Binlog encryption 浅析
- 【送书活动】你真的了解Java多线程编程吗?
- 删除WPS 遗留的qingnse64XXX.dll
- Windows系统win10系统磁力种子文件下载软件推荐
- 讲座笔记 | 陆铭 城市、区域和国家发展:空间政治经济学的理论和实证研究
- jpg、jpeg、png、gif、bmp、tiff、ai、cdr、eps 图片格式的区别
- Kotlin之Set和Get
- 创建一个TCP流式套接字
- 阿里如何定义团队的研发效能?
- 【数据库技术】2PL(两阶段锁)下的死锁与饥饿处理手段
- 计算机桌面右下角的图标不见了,图标,详细教您怎么解决右下角图标不见了的问题...
- 3ds文件结构(一)
- 想做APP增长,这个基础手段让你事半功倍【黑盒研究内参第13期】
- IT 服务满意度调查