索引的读写限制

索引的读写限制

  • 根据官方文档

https://www.elastic.co/guide/en/elasticsearch/reference/5.5/index-modules.html

  • 禁用对索引的写入操作
PUT 索引名/_settings
{
  "blocks.write": true
}
  • 禁用对索引的读取操作
PUT 索引名/_settings
{
  "blocks.read": true
}
  • 索引和索引元数据只读,false设置为允许写入和元数据更改。(Set to true to make the index and index metadata read only, false to allow writes and metadata changes.)
PUT 索引名/_settings
{
  "blocks.read_only": true
}
  • 禁用索引元数据读取和写入
PUT 索引名/_settings
{
  "blocks.metadata": true
}
  • 不用不知道,一用踩进坑,用这个’ “blocks.read”: true’,索引关闭read后,会影响其他索引添加副本(我这边添加副本的索引读写正常,但是主节点会显示index read (api),导致添加的副本分片不能正常分配·_·!)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值