SFS容量型迁移至本地主机 前提条件 已在云上和本地分别创建一台Linux操作系统的服务器。 服务器已完成弹性IP的配置,保证两台服务器间可以相互访问。 已获取到SFS容量型文件系统的挂载地址。 操作步骤 1. 登录弹性云服务器管理控制台。 2. 登录已创建的本地服务器client1,创建/mnt/src(可替换为本地目录)目录 3. 登录已创建的Linux云服务器client2,创建/mnt/dst目录,执行以下命令,用于访问云上SFS容量型文件系统 mount t nfs o vers3,timeo600,noresvport,nolock /mnt/dst 4. 在本地服务器client1中执行以下命令安装rclone工具。 wget nocheckcertificate unzip rclonev1.53.4linuxamd64.zip chmod 0755 ./rclone/rclone cp ./rclone/rclone /usr/bin/ rm rf ./rclone 5. 在本地服务器client1中执行以下命令,进行环境配置。 rclone config No remotes found make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n name> remotename(新建名字) Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 24 / SSH/SFTP Connection "sftp" Storage> 24 (选择ssh/sftp号码) SSH host to connect to Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Connect to example.com "example.com" host> ip address (client2机器ip地址) SSH username, leave blank for current username, root Enter a string value. Press Enter for the default (""). user> user name(client2机器的用户名) SSH port, leave blank to use default (22) Enter a string value. Press Enter for the default (""). port> 22 SSH password, leave blank to use sshagent. 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:(client2机器的登录密码) Confirm the password: password:(确认client2机器的登录密码) Path to PEMencoded private key file, leave blank or set keyuseagent to use sshagent. Enter a string value. Press Enter for the default (""). keyfile> (默认Enter) The passphrase to decrypt the PEMencoded private key file. Only PEM encrypted key files (old OpenSSH format) are supported. Encrypted keys in the new OpenSSH format can't be used. y) Yes type in my own password g) Generate random password n) No leave this optional password blank y/g/n> n When set forces the usage of the sshagent. When keyfile is also set, the ".pub" file of the specified keyfile is read and only the associated key is requested from the sshagent. This allows to avoid Too many authentication failures for username errors when the sshagent contains many keys. Enter a boolean value (true or false). Press Enter for the default ("false"). keyuseagent> (默认Enter) Enable the use of the aes128cbc cipher. This cipher is insecure and may allow plaintext data to be recovered by an attacker. Enter a boolean value (true or false). Press Enter for the default ("false"). Choose a number from below, or type in your own value 1 / Use default Cipher list. "false" 2 / Enables the use of the aes128cbc cipher. "true" useinsecurecipher> (默认Enter) Disable the execution of SSH commands to determine if remote file hashing is available. Leave blank or set to false to enable hashing (recommended), set to true to disable hashing. Enter a boolean value (true or false). Press Enter for the default ("false"). disablehashcheck> Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config [remotename] type sftp host(client2 ip) user(client2 user name) port 22 pass ENCRYPTED keyfilepass ENCRYPTED y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y Current remotes: Name Type remotename sftp e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> q client2机器ip地址为公网地址。 6. 执行以下命令查看rclone.conf文件,路径为/root/.config/rclone/rclone.conf。 cat /root/.config/rclone/rclone.conf [remotename] type sftp host(client2 ip) user(client2 user name) port 22 pass keyfilepass 7. 在本地服务器client1执行以下命令,同步数据。 rclone copy remotename:/mnt/src /mnt/dst P transfers 32 checkers 64 1. 命令中的remotename需替换为实际的远端名称。 2. 参数说明如下,transfers和checkers数目可以根据系统规格自行配置: transfers:传输文件的并发数目。 checkers:扫描本地文件的并发数目。 P:数据拷贝进度。 等待数据完成同步后,查看本地/mnt/dst是否已成功迁移。