1.增加一个已存在的index的副本分片数量,锁定索引权限
put log-2018-01-01/_settings
{
"number_of_replicas": 2 #设置副本分片数量为主分片2倍
"blocks.read_only:true" #只读权限,不允许更新 ,恢复的话只要改成false
"blocks.read:true" #禁止读取
"blocks.write:true" # 禁止写操作
}
2.查看索引设置
get index1,index2/_settings
3,增删改查
delete index
put index
update index
get index
4.关闭/打开打开索引
post index1,index2,index3/_open
post index1,index2,index3/_close # 已关闭索引不能进行读写
5.复制索引(从一个索引复制到新的索引,新索引不会继承旧的配置,这里是否可以用来改变mapping~mark),
post _reindex
{
"source":{"index":"index1"},
"dest":{"index":"index2"}
}
同时也可以限制复制的fields
post _reindex
{
"source":{"index":"index1",
"type": "doc",
"query":{
"term": {"title":"abc"}
}
}
"dest":{"index":"index2"}
}
网友评论