elasticsearch 常用命令

#查看所有的快照
curl -XGET localhost:9200/_snapshot/仓库名/_all
#查看快照信息
curl -XGET localhost:9200/_snapshot/仓库名/snapshot_name/_status
#删除快照
curl -XDELETE "localhost:9200/_snapshot/仓库名/snapshot_name"
#生成快照  
curl -XPUT -uelastic:2cyR8B9VTB2VvvaMhh http://127.0.0.1:9200/_snapshot/仓库名/snapshot_name?wait_for_completion=true -d '
{
"indices": "index_name",
"ignore_unavailable": "true",
"include_global_state": false
}'
#恢复快照
curl -XPOST http://127.0.0.1:9200/_snapshot/仓库名/snapshot_name/_restore?wait_for_completion=true -d '
{
"ignore_unavailable": "true",
"include_global_state": false ,
"index_settings": { "index.number_of_replicas": 0 }
}'

#关闭索引
curl -XPOST localhost:9200/index_name/_close
#查看索引数据
curl -XGET localhost:9200/index_name/_search

猜你喜欢

转载自www.cnblogs.com/imcati/p/10033566.html
今日推荐