iscsi挂载存储
rpm -ivh iscsi-initiator-utils-6.2.0.873-10.el6.x86_64.rpm #安装iscsi包service iscsi startservice iscsid start
修改开机自动发现iscsi存储
vim /etc/iscsi/initiatorname.iscsi #修改iqnInitiatorName=iqn.2006-01.com.openfiler:tsn.6041375b138b #虚拟存储id
发现存储
iscsiadm -m discovery -t st -p 192.168.3.231:3260 #存储ip地址
登录多路径存储
iscsiadm -m node --loginall=all #全部登陆iscsiadm -m session #查看登陆路径tcp: [1] 192.168.3.231:3260,1 iqn.2006-01.com.openfiler:tsn.6041375b138btcp: [2] 192.168.3.232:3260,1 iqn.2006-01.com.openfiler:tsn.6041375b138btcp: [3] 192.168.3.233:3260,1 iqn.2006-01.com.openfiler:tsn.6041375b138btcp: [4] 192.168.3.234:3260,1 iqn.2006-01.com.openfiler:tsn.6041375b138b
过滤查看多路径磁盘
fdisk -lfdisk -l|grep "10.7 GB" #过滤10.7 GB容量磁盘Disk /dev/sdd: 10.7 GB, 10737418240 bytesDisk /dev/sde: 10.7 GB, 10737418240 bytesDisk /dev/sdg: 10.7 GB, 10737418240 bytesDisk /dev/sdj: 10.7 GB, 10737418240 bytes
multipath多路径安装配置
rpm -ivh device-mapper-1.02.79-8.el6.x86_64.rpmrpm -ivh device-mapper-multipath-libs-0.4.9-72.el6.x86_64.rpmrpm -ivh device-mapper-multipath-0.4.9-72.el6.x86_64.rpm
检查内核文件
modprobe -l |grep multipathmultipath -ll #查看多路径状态
过滤磁盘并记录多路径磁盘 盘符
fdisk -l|grep "10.7 GB"Disk /dev/sdd: 10.7 GB, 10737418240 bytesDisk /dev/sde: 10.7 GB, 10737418240 bytesDisk /dev/sdh: 10.7 GB, 10737418240 bytesDisk /dev/sdi: 10.7 GB, 10737418240 bytes
编辑配置文件
cp /etc/multipath.conf /etc/multipath.conf.bakecho > /etc/multipath.confvim /etc/multipath.conf
defaults { user_friendly_names yes find_multipaths yes}blacklist { wwid 36000c29cb6821173f0fc0f7a6142814d}multipaths { multipath { wwid 14f504e46494c4552496f626d72502d346a724c2d69774353 alias oracle-fs01 path_grouping_policy multibus path_selector "round-robin 0" failback immediate } multipath { wwid 14f504e46494c4552776f684d78732d6e444a702d306a6661 alias oracle-fs02 path_grouping_policy multibus path_selector "round-robin 0" failback immediate }}devices { device { vendor "openfiler" product "virtual disk" path_grouping_policy multibus path_checker readsector0 path_selector "round-robin 0" hardware_handler "0" }}
删除当前多路径并重建多路径
multipath -F #删除当前多路径multipath -v2 #重建当前多路径multipath -ll #查看当前多路径状态
格式化并分区多路径磁盘
分区多路径磁盘
fdisk -l|grep /dev/mapperfdisk -c /dev/mapper/oracle-fs01mkfs.ext4 /dev/mapper/oracle-fs01p1df -Th #查看磁盘
编辑开机文件并加入开机自动挂载磁盘
vim /etc/fstab/dev/mapper/oracle-fs01p1 /data01 ext4 defaults 0 0/dev/mapper/oracle-fs02p1 /data02 ext4 defaults 0 0
重启主机
reboot