使用elasticsearch snapshot API可以备份您的集群,但是目前官方只支持 fs、azure、gcs、s3和hdfs5种仓库,该项目实现阿里OSS源
从release页面下载对应版本zip包,如:
$ wget https://github.com/wujjpp/repository-oss/releases/download/6.3.2/repository-oss-6.3.2.zip
$ elasticsearch-plugin install file:///<前面下载的zip包完整路径>
重启elasticsearch
在<elasticsearch安装目录>/plugins
下创建 repository-oss
目录,解开zip包,复制所有文件到repository-oss
目录
重启elasticsearch
注:调用之前请先确保bucket是存在的
PUT http://<Your elasticsearch endpoint>/_snapshot/my_backup
{
"type": "oss",
"settings": {
"endpoint": "http://oss-cn-hangzhou-internal.aliyuncs.com",
"access_key_id": "<yourAccessKeyId>",
"secret_access_key": "<yourAccessKeySecret>",
"bucket": "<yourBucketName>"
}
}
具体endpoint可参考
Made with ♥ by Wu Jian Ping
Feel free to contact me if you have any problem [email protected]