ossfs方式打snapshot做集群迁移

1.准备工作

需求:如阿里三台节点集群A 迁移到另外3台集群B,或者跨云服务迁移
注:所有节点均须安装ossfs
lsb_release -a 查询机器版本信息
根据系统版本选择ossfs版本 https://help.aliyun.com/document_detail/32196.html

2.下载、安装(centos7为例)

wget http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32196/cn_zh/1527232195135/ossfs_1.80.5_centos7.0_x86_64.rpm

yum localinstall ossfs_1.80.5_centos7.0_x86_64.rpm -y

3.配置访问密码、授权

echo test-es:AccessKeyID-xxx:AccessKeySecret-xxx > /etc/passwd-ossfs

chmod 640 /etc/passwd-ossfs

4.设置软连接

/usr/local/bin/ossfs test-es /data/elasticsearch/backup -ourl=oss-cn-beijing-internal.aliyuncs.com -ouid=1666 -ogid=1666 -o allow_other

说明:/data/elasticsearch/backup为elasticsearch.yml中path.repo: ["/data/elasticsearch/backup"]

5.查看挂载是否成功

df -h
ossfs方式打snapshot做集群迁移

6.创建仓库,两个集群A、B打同样的仓库

PUT _snapshot/test_data
{
“type”: “fs”,
“settings”: {
“location”: “/data/elasticsearch/backup/cluster_name”,
“compress”: true
}
}
说明:location路径规范可自行设置

7.通过cerebro操作实现,集群A打snapshot,然后集群B选择该仓库进行恢复

ossfs方式打snapshot做集群迁移
ossfs方式打snapshot做集群迁移