ES的操作命令
ES启动命令(后台)
./bin/elasticsearch -d
ES复制索引到另一个索引
post _reindex
{
"source": {
"index": "kg.controller"
},
"dest": {
"index": "kg.controllerback",
"op_type": "create"
}
}
查询快照仓库和快照
curl -XGET 'http://192.168.68.128:9201/_snapshot/_all/?pretty'
创建本地仓库
curl -H "Content-Type: application/json" -XPUT 'http://192.168.68.128:9201/_snapshot/group' -d '{
"type": "fs",
"settings": {
"location": "/usr/local/modules/es/bh_backup/group",
"compress": true
}
}'
查询备份仓库有哪些
curl -H "Content-Type: application/json" -XGET 'http://192.168.68.128:9201/_snapshot?pretty'
从镜像中恢复快照
curl -H "Content-Type: application/json" -XPOST 'http://10.225.9.37:9202/_snapshot/group/es_snapshot/_restore'
查看所有备份全索引的信息
curl -XGET "http://192.168.68.128:9201/_snapshot/bh_backup/_all?pretty"
查看单个备份全索引的信息
curl -XGET "http://192.168.68.128:9201/_snapshot/bh_backup/es_snapshot?pretty"
查询未分片的原因
curl -XGET '10.225.9.37:9202/_cluster/allocation/explain?pretty'
删除索引的别名
curl -H "Content-Type: application/json" -XDELETE http://$host:$port/kg.search_node*/_alias/glp_search_node_pro