0
点赞
收藏
分享

微信扫一扫

elastic索引管理

常用API

elastic索引管理_文件系统

2,索引压缩

实际上是压缩的分片,并非在原有索引上压缩,而是生成了一个新的索引,由于使用了 hash 路由算法以及索引
不可变的特性

elastic索引管理_硬链接_02

---操作步骤---

reindex不会把mapping和seting复制过去

elastic索引管理_工作原理_03

 删除副本

删除副本
"index.number of_replicas": 0
设置只读
"index.blocks.write": true

elastic索引管理_工作原理_04

elastic索引管理_硬链接_05

 

案例:

elastic索引管理_硬链接_06

 

allocation.requre.rack:rack1

elastic索引管理_硬链接_07

 

elastic索引管理_elasticsearch_08

 

-----------执行压缩时候所有分片必须都在同一个节点上---------------

elastic索引管理_硬链接_09

解决:

index.routing.allocation.require._name:null 

index.routing.allocation.require._name:node1

 

如果发现副本还是恢复失败可以通过命令查看错误原因

GET _cluster/allocation/explain

elastic索引管理_工作原理_10

 

elastic索引管理_文件系统_11

 

elastic索引管理_硬链接_12

 

工作原理和过程

1.创建一个新的目标索引,其定义与源索引相同,但分片数量较少。

2.将段从源索引硬链接到目标索引。如果文件系统不支持硬链接,则将所有segmenttfile都复制到新索引中复制过程很耗时。

3.shard recovery 操作,恢复目标索引。

 

举报

相关推荐

0 条评论