linux iscsi multipath多路徑及名稱持久化配置
環境:
iscsi server : openfiler eth0/eth1 bind->192.108.26.100
iqn.2006-01.com.openfiler:tsn.b45ae024d498
iqn.2006-01.com.openfiler:tsn.67571ed98f10
iscsi client : centos 6.6 eth1->192.108.26.117 eth2->192.108.26.118
1.安裝iscsi-initiator
[root@ct6601 ~]# yum install -y iscsi-initiator-utils
2.安裝device-mapper-multipath
[root@ct6601 ~]# yum install -y device-mapper-multipath
3.設定multipathd服務開機自啟動
[root@ct6601 etc]# chkconfig multipathd on
4.測試網路卡eth1,eth2能否ping通iscsi server
[root@ct6601 ~]# ping -I eth1 192.108.26.100
[root@ct6601 ~]# ping -I eth2 192.108.26.100
5.在/etc/sysctl.conf新增以下,否則在第8步可能一直timeout
[root@ct6601 ~]# cat >> /etc/sysctl.conf << EOF
net.ipv4.conf.eth1.rp_filter=2
net.ipv4.conf.eth2.rp_filter=2
EOF
[root@ct6601 ~]# sysctl -p
6.修改/etc/iscsi/iscsid.conf中的timeout時間
[root@ct6601 ~]# cat /etc/iscsi/iscsid.conf |grep timeout|grep -v ^#
node.session.timeo.replacement_timeout = 2
node.conn[0].timeo.login_timeout = 2
node.conn[0].timeo.logout_timeout = 2
node.conn[0].timeo.noop_out_timeout = 2
node.session.err_timeo.abort_timeout = 2
node.session.err_timeo.lu_reset_timeout = 2
node.session.err_timeo.tgt_reset_timeout = 2
7.建iscsi iface
[root@ct6601 ~]# iscsiadm -m iface -I iface1 -o new
[root@ct6601 ~]# iscsiadm -m iface -I iface2 -o new
#檢視/var/lib/iscsi/下的檔案
[root@ct6601 ~]# cd /var/lib/iscsi/
[root@ct6601 iscsi]# du -sh *
12K ifaces
4.0K isns
4.0K nodes
4.0K send_targets
4.0K slp
4.0K static
#繫結iscsi iface到網路卡
[root@ct6601 iscsi]# iscsiadm -m iface -I iface1 -o update -n iface.net_ifacename -v eth1
[root@ct6601 iscsi]# iscsiadm -m iface -I iface2 -o update -n iface.net_ifacename -v eth2
8.發現iscsi target
[root@ct6601 iscsi]# iscsiadm -m discovery -t st -p 192.108.26.100 -I iface1 -I iface2
Starting iscsid: [ OK ]
192.108.26.100:3260,1 iqn.2006-01.com.openfiler:tsn.b45ae024d498
192.108.26.100:3260,1 iqn.2006-01.com.openfiler:tsn.67571ed98f10
192.108.26.100:3260,1 iqn.2006-01.com.openfiler:tsn.b45ae024d498
192.108.26.100:3260,1 iqn.2006-01.com.openfiler:tsn.67571ed98f10
#發現後相關檔案已經生成
[root@ct6601 iscsi]# du -sh *
12K ifaces
4.0K isns
36K nodes
28K send_targets
4.0K slp
4.0K static
9.啟動iscsi服務,建立連線
[root@ct6601 iscsi]# service iscsi start
10.檢視連線資訊及iscsi盤
[root@ct6601 ~]# iscsiadm -m session -P 1
Target: iqn.2006-01.com.openfiler:tsn.b45ae024d498 (non-flash)
Current Portal: 192.108.26.100:3260,1
Persistent Portal: 192.108.26.100:3260,1
**********
Interface:
**********
Iface Name: iface1
Iface Transport: tcp
Iface Initiatorname: iqn.1994-05.com.redhat:bfec8c6a9151
Iface IPaddress: 192.108.26.117
Iface HWaddress: <empty>
Iface Netdev: eth1
SID: 5
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
**********
Interface:
**********
Iface Name: iface2
Iface Transport: tcp
Iface Initiatorname: iqn.1994-05.com.redhat:bfec8c6a9151
Iface IPaddress: 192.108.26.118
Iface HWaddress: <empty>
Iface Netdev: eth2
SID: 6
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
Target: iqn.2006-01.com.openfiler:tsn.67571ed98f10 (non-flash)
Current Portal: 192.108.26.100:3260,1
Persistent Portal: 192.108.26.100:3260,1
**********
Interface:
**********
Iface Name: iface1
Iface Transport: tcp
Iface Initiatorname: iqn.1994-05.com.redhat:bfec8c6a9151
Iface IPaddress: 192.108.26.117
Iface HWaddress: <empty>
Iface Netdev: eth1
SID: 7
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
**********
Interface:
**********
Iface Name: iface2
Iface Transport: tcp
Iface Initiatorname: iqn.1994-05.com.redhat:bfec8c6a9151
Iface IPaddress: 192.108.26.118
Iface HWaddress: <empty>
Iface Netdev: eth2
SID: 8
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
#檢視iscsi盤
[root@ct6601 iscsi]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001e517
Device Boot Start End Blocks Id System
/dev/sda1 1 523 4194304 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2 * 523 3917 27261952 83 Linux
Disk /dev/sdb: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfef2bf25
Disk /dev/sdc: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfef2bf25
Disk /dev/sdd: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xab210de1
Disk /dev/sde: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xab210de1
11.檢視wwid
[root@ct6601 ~]# scsi_id -gu /dev/sdb
14f504e46494c45527646546462502d716247302d7a61554b
[root@ct6601 ~]# scsi_id -gu /dev/sdc
14f504e46494c45527646546462502d716247302d7a61554b
[root@ct6601 ~]# scsi_id -gu /dev/sdd
14f504e46494c45524b61654859532d47436c612d30625046
[root@ct6601 ~]# scsi_id -gu /dev/sde
14f504e46494c45524b61654859532d47436c612d30625046
12.配置 /etc/multipath.conf
[root@ct6601 etc]# cat /etc/multipath.conf
defaults {
user_friendly_names yes
}
multipaths {
multipath {
wwid 14f504e46494c45527646546462502d716247302d7a61554b
alias dm1
path_grouping_policy multibus
failback manual
rr_weight priorities
no_path_retry 5
}
multipath {
wwid 14f504e46494c45524b61654859532d47436c612d30625046
alias dm2
path_grouping_policy multibus
failback manual
rr_weight priorities
no_path_retry 5
}
}
13.啟動multipathd
[root@ct6601 etc]# service multipathd restart
14.檢視multipath資訊及mapper盤
[root@ct6601 ~]# multipath -ll
dm2 (14f504e46494c45524b61654859532d47436c612d30625046) dm-1 OPNFILER,VIRTUAL-DISK
size=40G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 6:0:0:0 sdd 8:48 active ready running
`- 5:0:0:0 sde 8:64 active ready running
dm1 (14f504e46494c45527646546462502d716247302d7a61554b) dm-0 OPNFILER,VIRTUAL-DISK
size=40G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 3:0:0:0 sdb 8:16 active ready running
`- 4:0:0:0 sdc 8:32 active ready running
[root@ct6601 etc]# ll /dev/mapper/
total 0
crw-rw---- 1 root root 10, 58 May 11 08:28 control
lrwxrwxrwx 1 root root 7 May 11 09:27 dm1 -> ../dm-0
lrwxrwxrwx 1 root root 7 May 11 09:27 dm2 -> ../dm-1
15.驗證可用性
略.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28539951/viewspace-2098051/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- linux多路徑multipath配置Linux
- multipath多路徑配置
- centos上iscsi+multipath多路徑儲存配置手冊CentOS
- Linux Multipath多路徑配置與使用案例Linux
- Linux環境iSCSI儲存及多路徑功能配置Linux
- linux之 multipath 多路徑Linux
- rhel 6 對映多路徑(DM Multipath)配置及管理
- Multipath實現LUN裝置名稱的持久化持久化
- Linux配置和管理裝置對映多路徑multipathLinux
- RedHat 5.4上iscsi+multipath多路徑儲存配置獲取裝置的wwidRedhat
- redhat multipath多路徑 DMRedhat
- Oracle Linux 7.8 多路徑(Multipath)+Udev繫結磁碟OracleLinuxdev
- LINUX 多路徑對映Multipath與正規表示式Linux
- Linux 下配置多路徑Linux
- Linux平臺的多路徑軟體multipath的使用案例Linux
- linux redhat 6.5 多路徑配置LinuxRedhat
- 使用OpenFiler來模擬儲存配置RAC中ASM共享盤及多路徑(multipath)的測試ASM
- iscsi與multipath搭建
- 【多路徑】EMC儲存多路徑軟體配置
- Redhat5.4 Linux多路徑dm-multipath之multi-path詳解RedhatLinux
- Redhat7 Udev繫結(DM multipath)多路徑裝置Redhatdev
- NVMe1.4的:IO Determinism及多路徑(Multipathing)訪問共享名稱空間
- 儲存-配置多路徑
- LINUX所有配置檔案的路徑和檔名稱(收藏)Linux
- LINUX LOG(多路徑)Linux
- linux_unix_aix_hp_solaris multi path多路徑配置LinuxAI
- 網路卡配置及對應名稱
- Linux平臺上配置Oracle ASMLib和磁碟多路徑LinuxOracleASM
- linux iscsi配置網摘Linux
- linux 儲存多路徑軟體Linux
- linux多路徑下線上新增磁碟Linux
- Openfiler配置ISCSI Target及FC Target
- linux配置multipath 並安裝racLinux
- 多路徑時99-oracle-asmdevices.rules的配置OracleASMdev
- 多路徑格式化,對磁碟操作提示要分割槽,對別名操作正常格式化
- 記錄下物理機bond配置及物理機多路徑配置
- Linux必備工具及軟體包名稱Linux
- linux iscsi initiator 安裝配置薦Linux