背景
最近客户新上NetApp存储项目,需要把其他存储的NFS数据迁移至NetApp存储中,正好Netapp提供了非常方便NFS迁移工具NetApp XCP,借此正好写下此软件的使用指南。
实验环境介绍
信息 | IP地址 | 路径 |
---|---|---|
NetApp XCP 服务器(Centos7.7) | 192.168.0.99 | |
源NFS共享服务器 | 192.168.0.98 | /srvol1 |
目的存储(NetApp) | 192.168.0.97 | /dsvol1 |
XCP catalog位置 | 192.168.0.97 | /catalog |
许可
NetApp提供90天的试用许可,需要自行登录 https://xcp.netapp.com 根据不同的环境申请许可。
NetApp XCP系统要求
NFS | |
---|---|
System | 64-bit Intel or AMD server, minimum 4 cores and 32GB RAM |
Operating System & Software | • Recent Linux distribution (RHEL 5.11 or later or kernel 2.6.18-404 or later) |
Special Requirements | • Network connectivity and Troot level access to source and destination NFSv3 exports • No other active applications • Access to log in as root or to run sudo commands |
Storage | • 20MB of disk space for the XCP binary and at least 50MB of disk space for the logs that are stored in the /opt/NetApp/xFiles/xcp/ directory. |
Supported Protocol Version | • NFSv3 and NFSv4 (over TCP only) |
NetApp XCP 系统优化设置
vi /etc/sysctl.conf 末尾添加如下参数,运行 sysctl -p 或者重启服务器应用配置
net.core.rmem_max = 16777216
net.core.rmem_max = 16777216
net.core.wmem_default = 1342177
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 1342177 16777216
net.ipv4.tcp_wmem = 4096 1342177 16777216
net.core.netdev_max_backlog = 300000
net.ipv4.tcp_fin_timeout = 10
NetApp XCP Storage
NetApp XCP服务器对源卷和目的卷需要有root的访问权限
- XCP服务器访问源卷的策略为只读,避免XCP服务器对源卷数据的修改。
- XCP服务器访问目卷的策略为读写。
- 如果源数据在DAS或SAN上,通过NFS共享服务器共享的,参考以下导出策略
# echo ‘/export 10.45.45.100(ro,no_root_squash)’ >> /etc/exports
# sudo service nfs restart
- 如果目的数据系统为NetApp LUN (FAS, E-Series, NetApp FlashRay® system)通过NFS服务器共享的,参考以下导出策略
# echo ‘/export 10.45.45.100(rw,no_root_squash, async)’ >> /etc/exports
# sudo service nfs restart
NetApp XCP 软件安装
- 复制下载好的xcp安装包NETAPP_XCP_1.6.1.tgz 至linux服务器(我们这里是根目录)
- 解压安装包
[root@XCP /]# tar zxvf NETAPP_XCP_1.6.1.tgz
- 转到安装目录
[root@XCP /]# cd xcp/linux/ [root@XCP linux]#
- 运行 xcp show 或xcp help 会显示许可为激活
[root@XCP linux]# ./xcp show localhost (c) 2020 NetApp, Inc. xcp: Host config file not found. Creating sample at '/opt/NetApp/xFiles/xcp/xcp.ini' xcp: ERROR: License file /opt/NetApp/xFiles/xcp/license not found. Register for a license at https://xcp.netapp.com Xcp command : xcp show localhost 1 error STATUS : FAILED [root@XCP linux]#
- 复制申请好的license文件至
/opt/NetApp/xFiles/xcp/
目录。[root@XCP xcp]# ls -alt total 8 drwxr-xr-x 4 root root 68 Oct 23 10:33 . -rw-r--r-- 1 root root 71 Oct 23 10:28 xcp.ini drwxr-xr-x 2 root root 21 Oct 23 10:28 xcplogs drwxr-xr-x 3 root root 17 Oct 23 10:28 .. drwxr-xr-x 2 root root 6 Oct 23 10:28 xcpfalogs -rw-r--r-- 1 root root 352 Oct 22 09:33 license [root@XCP xcp]#
- 激活XCP许可
[root@XCP linux]# ./xcp activate XCP 1.6.1; (c) 2020 NetApp, Inc.; Licensed to lu.yinjun@flow-ever.com yinjun [Jiangsu Flow-Ever Infor Tech Co Ltd.] until Sun Jan 17 18:06:47 2021 XCP already activated
- 验证是否有其他错误
[root@XCP linux]# ./xcp show localhost XCP 1.6.1; (c) 2020 NetApp, Inc.; Licensed to lu.yinjun@flow-ever.com yinjun [Jiangsu Flow-Ever Infor Tech Co Ltd.] until Sun Jan 17 18:06:47 2021 xcp: ERROR: Catalog inaccessible: Cannot mount nfs_server:/export[:subdirectory] Failed with 'socket connect to 'nfs_server tcp 111 pmap2 c0': [Errno -2] Name or service not known' xcp: HINT: Verify the settings in the host config file /opt/NetApp/xFiles/xcp.
- 配置catalog路径
[root@XCP linux]# cat /opt/NetApp/xFiles/xcp/xcp.ini # Sample xcp config [xcp] catalog = 192.168.0.97:/catalog
- 再次运行
```无任何报错
[root@XCP linux]# ./xcp show localhost
XCP 1.6.1; (c) 2020 NetApp, Inc.; Licensed to lu.yinjun@flow-ever.com yinjun [Jiangsu Flow-Ever Infor Tech Co Ltd.] until Sun Jan 17 18:06:47 2021getting pmap dump from localhost port 111…
getting export list from localhost…
sending 0 mounts and 0 nfs requests to localhost…== RPC Services ==
‘localhost’: TCP rpc services: MNT v1/2/3, NFS v3/4, NFSACL v3, NLM v1/3/4, PMAP v2/3/4, STATUS v1
‘localhost’: UDP rpc services: MNT v1/2/3, NFS v3/4, NFSACL v3, NLM v1/3/4, PMAP v2/3/4, STATUS v1== NFS Exports ==
Mounts Errors Server
0 0 localhostXcp command : xcp show localhost
Stats :
Speed : 1.24 KiB in (1.88 KiB/s), 1.38 KiB out (2.10 KiB/s)
Total Time : 0s.
STATUS : PASSED
迁移NFS数据
- 扫描源卷信息源卷路径为:192.168.0.98:/srvol1 、ID号:flow-ever-scan-001
[root@XCP linux]# ./xcp scan -newid flow-ever-scan-001 192.168.0.98:/srvol1 XCP 1.6.1; (c) 2020 NetApp, Inc.; Licensed to lu.yinjun@flow-ever.com yinjun [Jiangsu Flow-Ever Infor Tech Co Ltd.] until Sun Jan 17 18:06:47 2021 xcp: open or create catalog 'xcp': Creating new catalog in '192.168.0.97:/catalog/catalog' Xcp command : xcp scan -newid flow-ever-scan-001 192.168.0.98:/srvol1 Stats : 7 scanned, 7 indexed Speed : 12.4 KiB in (8.67 KiB/s), 52.8 KiB out (36.9 KiB/s) Total Time : 1s. STATUS : PASSED [root@XCP linux]#
- 首次复制源数卷至目的数据卷
[root@XCP linux]# ./xcp copy -newid flow-ever-copy-001 192.168.0.98:/srvol1 192.168.0.98:/dsvol1 XCP 1.6.1; (c) 2020 NetApp, Inc.; Licensed to lu.yinjun@flow-ever.com yinjun [Jiangsu Flow-Ever Infor Tech Co Ltd.] until Sun Jan 17 18:06:47 2021 Xcp command : xcp copy -newid flow-ever-copy-001 192.168.0.98:/srvol1 192.168.0.98:/dsvol1 Stats : 7 scanned, 6 copied, 7 indexed Speed : 19.1 MiB in (5.56 MiB/s), 19.2 MiB out (5.57 MiB/s) Total Time : 3s. STATUS : PASSED [root@XCP linux]#
- 同步复制数据(需要指定copy时使用的ID号)
[root@XCP linux]# ./xcp sync -id flow-ever-copy-001 XCP 1.6.1; (c) 2020 NetApp, Inc.; Licensed to lu.yinjun@flow-ever.com yinjun [Jiangsu Flow-Ever Infor Tech Co Ltd.] until Sun Jan 17 18:06:47 2021 xcp: Index: {source: 192.168.0.98:/srvol1, target: 192.168.0.98:/dsvol1} xcp: diff 'flow-ever-copy-001': 7 reviewed, 7 checked at source, 7 reindexed, 24.5 KiB in (15.1 KiB/s), 18.8 KiB out (11.6 KiB/s), 1s. Xcp command : xcp sync -id flow-ever-copy-001 Stats : 7 reviewed, 7 checked at source, no changes, 7 reindexed Speed : 25.1 KiB in (15.4 KiB/s), 19.9 KiB out (12.2 KiB/s) Total Time : 1s. STATUS : PASSED [root@XCP linux]#
- 在Cutover前验证数据的一致性
[root@XCP linux]# ./xcp verify -newid flow-ever-verify-001 192.168.0.98:/srvol1 192.168.0.97:/dsvol1 XCP 1.6.1; (c) 2020 NetApp, Inc.; Licensed to lu.yinjun@flow-ever.com yinjun [Jiangsu Flow-Ever Infor Tech Co Ltd.] until Sun Jan 17 18:06:47 2021 Xcp command : xcp verify -newid flow-ever-verify-001 192.168.0.98:/srvol1 192.168.0.97:/dsvol1 Stats : 7 scanned, 7 indexed, 100% found (4 have data), 4 compared, 100% verified (data, attrs, mods) Speed : 38.1 MiB in (22.0 MiB/s), 138 KiB out (79.9 KiB/s) Total Time : 1s. STATUS : PASSED [root@XCP linux]#
- 切换数据
- 卸载源卷路径
- 挂在新的NetApp路径至源挂载点