說明: 對於有兩個或多個控制器的iscsi存放裝置,或採用openfiler有兩塊網卡提供伺服器的系統。需要配置多重路徑功能提高可用性。
本文採用openfiler來實現iscsi裝置的安裝與測試。
本文NAS採用openfiler 2.99.1 X64做為實驗環境,為近期的一個備份環境部署做準備。
1. 並安裝iSCSI啟動器軟體包
rpm -ivh iscsi-initiator-utils-6.2.0.871-0.10.el5.i386.rpm
chkconfig --level 2345 iscsi on
chkconfig --level 2345 iscsid on
service iscsi start
service iscsid start
2. 多重路徑軟體安裝準備
# rpm -qa |grep mapper
device-mapper-event-1.02.55-2.el5
device-mapper-1.02.55-2.el5
device-mapper-multipath-0.4.7-42.el5
#
設定成開機自啟動multipathd
# chkconfig --level 2345 multipathd on
來檢查安裝是否正常
# lsmod |grep dm_multipath
dm_multipath 25421 0
scsi_dh 12097 1 dm_multipath
dm_mod 63097 11 dm_multipath,dm_raid45,dm_snapshot,dm_zero,dm_mirror,dm_log
3. 發現存放裝置
# iscsiadm -m discovery -t st -p 192.168.100.238
192.168.100.238:3260,1 iqn.2006-01.com.openfiler:tsn.f9d59aaffe9c
192.168.100.239:3260,1 iqn.2006-01.com.openfiler:tsn.f9d59aaffe9c
4. 串連兩個節點,通過兩個IP分別進行串連
(1) 串連登陸第一個IP
# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.f9d59aaffe9c -p 192.168.100.238 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.f9d59aaffe9c, portal: 192.168.100.238,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.f9d59aaffe9c, portal: 192.168.100.238,3260] successful.
(2) 串連登入第二個IP
# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.f9d59aaffe9c -p 192.168.100.239 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.f9d59aaffe9c, portal: 192.168.100.239,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.f9d59aaffe9c, portal: 192.168.100.239,3260] successful.
5. 查看串連狀態
(1) 查看串連狀態1
# iscsiadm -m session
tcp: [1] 192.168.14.180:3260,1 iqn.2006-01.com.openfiler:tsn.355d1613342d
tcp: [2] 192.168.14.181:3260,1 iqn.2006-01.com.openfiler:tsn.355d1613342d