-
vePFS容量和性能统计
-
性能指标
查看近2周的实例监控指标,假设峰值读带宽为12GB,如vePFS购买的带宽为200TB,那么获得的实例最大读带宽为20GB,可供迁移的读带宽则为:20-12=8GB。
-
迁移时间预估
- 假设待迁移的数据量为:200TB(容量全部写满)。
- 迁移最大带宽受限于vePFS的业务闲时带宽与购买的迁移ECS的网络带宽中的最小值,Min(vePFS迁移可用带宽,ECS网卡带宽)。
- 假设 Min(vePFS迁移可用带宽,ECS网卡带宽) = 2 GB
迁移时间预估:2001024/(23600)=28.45小时
-
VPC智算版fileset配置(按需)
需要提前规划好VPC 智算版的fileset,为后续基于AML权限控制做好准备工作。
fileset不支持嵌套。
- 创建fileset,挂载目录会自动生成对应的子目录
- fileset配置容量配额和性能上限
-
迁移方案
-
迁移示意图
假设vePFS挂载的ECS节点规格选择:ecs.g3ine.2xlarge 网络带宽12-32Gbps。
性能版版挂目录:/mnt/vepfs
VPC智算版挂载目录:/mnt/vepfs
暂时无法在飞书文档外展示此内容
-
迁移准备
-
rclone配置
-
rclone安装配置(在挂载vePFS性能版的ECS服务器安装rclone)
- 下载rclone软件:https://rclone.org/downloads/, 建议下载最新版本:
-
#以CENTOS为例: wget https://downloads.rclone.org/v1.62.2/rclone-v1.62.2-linux-amd64.rpm --no-check-certificate rpm -ivh rclone-v1.60.0-linux-amd64.rpm #以ubuntu为例: wget https://downloads.rclone.org/v1.62.2/rclone-v1.62.2-linux-amd64.deb --no-check-certificate dpkg -i rclone-v1.60.0-linux-amd64.deb
- Rclone ssh配置:
- 执行rclone config
-
No remotes found, make a new one? n) New remote s) Set configuration password q) Quit config n/s/q> n name> destStorage (给对端的vpc智算版起个名字,重要!) Type of storage to configure. Choose a number from below, or type in your own value [snip] 39 / SSH/SFTP \ "sftp" [snip] Storage> 22 (ssh/sftp端口) SSH host to connect to Choose a number from below, or type in your own value 1 / Connect to example.com \ "example.com" host> 172.16.0.49 (挂载vePFS 智算版的ECS IP) SSH username Enter a string value. Press Enter for the default ("$USER"). user> root (挂载vePFS 智算版的ECS的用户名) SSH port number Enter a signed integer. Press Enter for the default (22). port> 22 SSH password, leave blank to use ssh-agent. y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> y Enter the password: password:(挂载vePFS 智算版的ECS PW) Confirm the password: password:(挂载vePFS 智算版的ECS PW) key_file> Remote config -------------------- [ssh1] host = 172.16.0.120 user = root port = pass = key_file = -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y
- rclone config show 查看配置:
-
也可以直接查看配置文件:/root/.config/rclone/rclone.conf
-
cat /root/.config/rclone/rclone.conf [ssh1] type = sftp host = 172.16.0.49 pass = ****** shell_type = unix md5sum_command = md5sum sha1sum_command = sha1sum
-
tmux配置
ECS安装tmux,避免异常中断
- 安装tmux
yum install tmux -y
- tmux常用命令
新建tmux窗口,sessioname是变量,用户自定义的会话名称
# tmux new -s sessioname
退出tmux窗口
# tmux detach
查看tmux窗口
# tmux ls
进入已经创建的tmux窗口,sessioname是"tmux ls"查询到的会话名称
# tmux a -t sessioname
-
两台ECS 分别挂载vePFS标准版和VPC智算版
参考文档:https://www.volcengine.com/docs/6645/144386
-
rclone迁移实施步骤
- 使用tmux新创建一个会话窗口
tmux new -s rclone
- 全量数据迁移命令
根据业务的闲时带宽及ECS规格的网络带宽,调整并发数,控制迁移带宽
检查是否做了软链接,如果有则需要加上:--copy-links
rclone copy --transfers=64 --checkers=64 --bwlimit 1000M -P --log-file /root/rclone.log --log-level ERROR /mnt/vepfs/sourcedir destStorage:/mnt/vepfs/fileset
#参数说明:
-- transfers=32代表并发迁移的文件个数,并发高传输速率快占用主机资源也会越多
-- checkers=32代表并发校验的文件个数,并发高校验速率快占用主机资源也会越多
-- bwlimit 1000M 代表迁移限速1000MB/s
-- destStorage 是rclone建立的远端ECS的名称,在rclone.conf文件中配置
-- -P代表将迁移进度打印到屏幕上
-- --log-file:打印日志路径,需要检查路径的容量,避免日志把容量写满。
-- --log-level:打印日志级别
- 全量迁移完成后,增量数据迁移,增量迁移和全量迁移命令一致,rclone会自动校验数据,并同步差异数据。
rclone copy --transfers=64 --checkers=64 --bwlimit 1000M -P --log-file /root/rclone.log --log-level ERROR /mnt/vepfs/sourcedir destStorage:/mnt/vepfs/fileset
- 数据校验命令:
rclone check source:path dest:path [flags]
可选参数如下:
--size-only:只比较文件大小。
--download:下载远程文件并对比。
--one-way,根据源端的数据列表对比;
--checksum ,进行size, checksum校验;默认,进行大小和修改时间校验。