Openfiler iSCSI和Linux多路径
使用openfiler对oracle主机提供iscsi服务,并解决多路径问题
环境搭建
虚拟机安装好Openfiler后,新添加5块盘环境
https://ip:446 用户名openfiler 密码password
添加授权访问存储的客户端地址
System--Network Access Configuration,Type选择为Share
创建RAID
Volumes--Block Devices--Create a new volume group,点击刚添加的5块硬盘sdb、sdc、sdd、sde、sdf
分别将5块盘Partition Type改为RAID array member后,点击Create
Volumes--Software RAID--Create a new RAID array
创建RAID6,select RAID array type选择RAID-6(extra-parity),勾选5块盘,Add array
创建好后,可以看到RAID组信息
创建VG
Volumes--Volume Groups,命名VG,勾选PV后Add volume group
创建LV
Volumes-Add Volume,命名LV,选取空间大小,Filesystem/volume type改为block(iSCSI,FC,etc)
创建了3个LV
配置iSCSI
Service--Manage Services--将iSCSI Target服务Enable,并且置位Running
Volumes--iSCSI Targets--Target Configuration,修改Target IQN后,点击Add
LUN Mapping,将三个LV改为Map LUN,点击Map按钮
Network ACL中,Access改为Allow,然后点击Update按钮
多路径
存储服务器地址:172.19.44.55 172.19.44.155
Linux主机地址:172.19.44.199 172.19.44.200
在Openfiler中添加两块网卡
允许接入网段配置
iSCSI允许接入网段配置
Linux主机中添加两块网卡,网卡配置信息/etc/sysconfig/network-scripts下vi新建eth1
如果service network restart出现错误
chkconfig NetworkManager off chkconfig network on service NetworkManager stop service network start
Linux查看是否安装多路径
rpm -qa|grep multipath
安装multipath
yum install device-mapper-multipath
安装iSCSI initiator
yum install iscsi-initiator-utils*
查看iscsi target存储上有哪些target
iscsiadm --mode discovery --type sendtargets --portal 172.19.44.55
ps -ef|grep iscsi
查看本地分区
fdisk -l | grep dev
登录target
iscsiadm --mode node --targetname iqn.2018-03.com.openfiler:tsn.7991f128d07f –portal 172.19.44.55:3260 --login
再次查看本地分区
fdisk -l | grep dev
存储有双网卡,设置里只MAP出了3个块设备,系统多识别了3个
存储服务器因为有两个网卡,每个网卡上有一个地址,Linux主机通过两个不同的地址连接到openfiler中后,产生多路径问题。在存储服务器上划分出N个LUN,并且这N个LUN都映射给了Linux主机,在Linux主机端就会看到2*N个LUN
将多路径软件写入内核
modprobe dm-multipath modprobe dm-round-robin
检查内核添加情况
lsmod |grep multipath
设置自启
chkconfig --level 2345 multipathd on chkconfig --list|grep multipathd
重启服务
service multipathd restart
生成多路径配置文件
mpathconf --enable
查看WWID号
cat /etc/multipath/wwids
cat /etc/multipath/bindings
multipath -ll
修改配置文件
mv /etc/multipath.conf /etc/multipath.conf.bak grep -v '^#' /etc/multipath.conf.bak > /etc/multipath.conf vi /etc/multipath.conf
将合法的wwn号添加进配置文件
service multipathd start multipath -ll
将重复盘已经绑定到一起
ll /dev/mapper/
新建分区
pvcreate /dev/mapper/LUN1
硬盘分区
fdisk /dev/mapper/LUN1
格式化分区
mkfs.ext4 /dev/mapper/LUN1
挂载
mkdir /mnt/lun1 mount /dev/mapper/LUN1 /mnt/lun1
永久挂载
vi /etc/fstab 添加/dev/mapper/LUN1 /mnt/lun1 ext4 _netdev 0 0
自动挂载
mount -a
本站所有文章均可随意转载,转载时请保留原文链接及作者。