利用rclone迁移minio数据

本篇详细讲述如何利用rclone将minio从单节点的测试环境,迁移到生产环境的minio集群中,示例环境如下:

源minio单节点:192.168.3.111
目标minio集群:10.30.3.231、10.30.3.232、10.30.3.233、10.30.3.234
  • 第1步、安装 rclone 1.57.0
cd /opt/
wget -c http://iso.sqlfans.cn/linux/rclone-v1.57.0-linux-amd64.zip
unzip rclone-v1.57.0-linux-amd64.zip
chmod 0755 ./rclone-v1.57.0-linux-amd64/rclone
cp ./rclone-v1.57.0-linux-amd64/rclone /usr/bin/
rm -rf ./rclone-v1.56.0-linux-amd64.zip
  • 第2步、创建配置文件,默认使用 /root/.config/rclone/rclone.conf
rclone config file
  • 第3步、修改配置文件,以下示例的源minio为单节点(192.168.3.111),目标minio为集群4节点(只用配置任一节点ip即可,比如 10.30.3.231)。记得修改minio账号和minio密码
cat > /root/.config/rclone/rclone.conf <<EOF
[oldminio]
type = s3
provider = Minio
env_auth = false
access_key_id = {minio账号}
secret_access_key = {minio密码}
region = cn-east-1
endpoint = http://192.168.3.111:9000
location_constraint =
server_side_encryption =

[newminio]
type = s3
provider = Minio
env_auth = false
access_key_id = {minio账号}
secret_access_key = {minio密码}
region = cn-east-1
endpoint = http://10.30.3.231:9000
location_constraint =
server_side_encryption =
EOF
  • 第4步、显示配置文件信息,并执行迁移(添加 -P 查看进度)。记得修改 bucketname(注:目标minio不用提前创建该bucket
rclone config show

rclone sync -P oldminio:{bucketname} newminio:{bucketname}
Copyright © www.sqlfans.cn 2024 All Right Reserved更新时间: 2024-02-26 11:08:26

results matching ""

    No results matching ""