Elasticsearch常见操作举例

版权声明:转载请注明出处! https://blog.csdn.net/ywd1992/article/details/88382287
1、创建仓储

单节点直接创建,多节点需要先挂载一个目录

sshfs [email protected]:/root/目录/ /data1/es/backups/ -o allow_other
PUT
http://192.168.0.102:9200/_snapshot/仓储名

参数
{
  "type": "fs",
  "settings": {
  "location": "/data1/es/backups/"
  }
}
2、查询仓储
GET
http://192.168.0.101:9200/_snapshot/_all
3、查询仓储中数据的snapshot名字
GET
http://192.168.0.101:9200/_snapshot/仓储名/_all
4、还原数据
POST
http://192.168.0.101:9200/_snapshot/仓储名/snapshot名字/_restore
5、查看还原进度
GET
http://192.168.0.101:9200/_snapshot/仓储名/snapshot名字/_status
6、备份数据
PUT
http://192.168.0.101:9200/_snapshot/仓储名/快照名字

参数
{
  "indices": "需要备份的索引名字"
}
7、查看备份
GET
http://192.168.0.101:9200/_snapshot/仓储名/快照名字
8、删除仓储
DELETE
http://192.168.0.101:9200/_snapshot/仓储名
9、增加减少副本
PUT
http://192.168.0.101:9200/索引名/_settings

参数
{
  "number_of_replicas": 1
}

猜你喜欢

转载自blog.csdn.net/ywd1992/article/details/88382287