Skip to content

wujjpp/repository-oss

Repository files navigation

repository-oss

使用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安装

$ 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可参考

具体snapshot API请参考官方文档

modules-snapshots

THANKS

Made with ♥ by Wu Jian Ping

Feel free to contact me if you have any problem 830390@qq.com