迁移iSCSI target(集群版适用)
更新时间 2026-06-26 09:34:10
最近更新时间: 2026-06-26 09:34:10
本节主要介绍迁移iSCSI target命令。
./stor target set { -i | --item } server { -n | --name } TARGET_NAME { -m | --migrate } { SOURCE_SERVER_ID:DEST_SERVER_ID }&<1-n> { -f | --force }
此命令用来迁移iSCSI target,修改target对应的服务器。
说明
可以只迁移iSCSI target对应的一个服务器,也可以同时迁移对应的多个服务器。
注意
- 执行迁移iSCSI target之前,需要保证集群处于working状态,同时目的服务器需要处于正常已连接状态。
- 目前仅支持强制迁移iSCSI target,强制迁移iSCSI target可能造成数据丢失。
- 如果被迁移的iSCSI target已被卷连接,且该卷已经被客户端挂载,迁移iSCSI target前,需要客户端与原iSCSI target IQN断开;迁移后,确保原iSCSI target IQN不能被发现,客户端重新连接迁移后的iSCSI target IQN。
迁移完成后,请检查并调整target允许访问列表配置,确保符合访问控制要求。
迁移iSCSI target时:
如果提示内存不足:由于内存不足可能会引起HBlock服务异常,建议随时观察服务器上的内存使用情况,内存使用率过高时,及时增加系统总内存,或单独提高服务器中HBlock可使用的内存。提高服务器中HBlock可使用的内存详见设置服务器中HBlock可使用的内存。
如果提示需要重启服务:您可以等此类操作全部执行完毕后,立即重启提示信息中对应服务器上的HBlock服务。
参数
| 参数 | 描述 |
|---|---|
| -i server 或 --item server | 设置iSCSI target迁移。 |
| -n TARGET_NAME 或 --name TARGET_NAME | iSCSI target名称。 |
| -m { SOURCE_SERVER_ID:DEST_SERVER_ID }&<1-n> 或 --migrate { SOURCE_SERVER_ID:DEST_SERVER_ID }&<1-n> | 指定target对应的源服务器ID和目标服务器ID。 说明 可以指定多组源服务器ID和目标服务器ID,以英文逗号隔开。 |
| -f 或 --force | 强制迁移iSCSI target。 注意 目前仅支持强制迁移iSCSI target,强制迁移iSCSI target可能造成数据丢失。 |
示例
迁移target03的一个服务器。
[root@hblockserver CTYUN_HBlock_Plus_4.0.0_x64]# ./stor target set -i server -n target03 -m hblock_2:hblock_3 --force
When migrating the target from server forcibly, the connections on this target will be immediately disconnected.
If there are connections on the target, you should disconnect the connections first.
After migrating is complete, the LUN(s) on the target should be reconnected.
After migration, please verify and adjust the target IQN access restrictions to ensure compliance with access control requirements.
Are you sure want to migrate the target? [Yes/No]
yes
Target target03 migrated successfully from server hblock_2 to server hblock_3
Insufficient memory, please increase the total system memory or separately raise the memory allocation for the services on the following servers:
hblock_3
You can reconnect the following iSCSI LUN(s):
+-----+----------+------------------------------------------------------------------------+
| No. | LUN Name | iSCSI Target |
+-----+----------+------------------------------------------------------------------------+
| 1. | lun03a | iqn.2012-08.cn.ctyunapi.oos:target03.5 (192.168.0.67:3260,ColdStandby) |
| | | iqn.2012-08.cn.ctyunapi.oos:target03.6 (192.168.0.68:3260,ColdStandby) |
| 2. | lun03c | iqn.2012-08.cn.ctyunapi.oos:target03.5 (192.168.0.67:3260,ColdStandby) |
| | | iqn.2012-08.cn.ctyunapi.oos:target03.6 (192.168.0.68:3260,ColdStandby) |
+-----+----------+------------------------------------------------------------------------+说明
卷关联的target处于ColdStandby状态,表示target正在从一个服务器迁移到集群其他服务器上,迁移过程,该Target处于ColdStandby状态。迁移完成后,target将变为Active或者Standby状态。