遷移iSCSI target(集群版適用)
更新時間 2025-09-29 17:49:30
最近更新時間: 2025-09-29 17:49:30
分享文章
本節主要介紹遷移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允許訪問列表配置,確保符合訪問控制要求。
參數
| 參數 | 描述 |
|---|---|
| -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_3.10.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]
y
Target target03 migrated successfully from server hblock_2 to server 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.65:3260,Active) |
| 2. | lun03b | 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.65:3260,Active) |
+-----+----------+------------------------------------------------------------------------+說明
卷關聯的target處于ColdStandby狀態,表示target正在從一個服務器遷移到集群其他服務器上,遷移過程,該Target處于ColdStandby狀態。遷移完成后,target將變為Active或者Standby狀態。