索引的读写限制
- 根据官方文档
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),导致添加的副本分片不能正常分配·_·!)