CentOS配置multipath
可以通过2种方式查看HBA的WWN信息:
1. 查看sys文件系统
查看HBA卡型号:
[root@localhost ~]# lspci | grep -i fibre
13:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
13:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
查看HBA卡WWN信息:
[root@localhost ~]# ls -l /sys/class/fc_host/
total
drwxr-xr-x root root Jun : host3
drwxr-xr-x root root Jun : host4
[root@localhost ~]# cat /sys/class/fc_host/host3/port_name
0x21000024ff462814
2. 采用systool
systool所在软件包:
yum -y install sysfsutils
systool -c fc_host -v
-c <class_name> / -b <bus_name> / -m <module_name>
[root@localhost ~]# systool -v -c fc_host
Class = "fc_host"
Class Device = "host3"
Class Device path = "/sys/class/fc_host/host3"
fabric_name = "0x1000000533746b8f"
issue_lip = <store method only>
node_name = "0x20000024ff462814"
port_id = "0x011300"
port_name = "0x21000024ff462814"
port_state = "Online"
port_type = "NPort (fabric via point-to-point)"
speed = "8 Gbit"
supported_classes = "Class 3"
supported_speeds = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
symbolic_name = "QLE2562 FW:v5.03.16 DVR:v8.03.07.03.05.07-k"
system_hostname = ""
tgtid_bind_type = "wwpn (World Wide Port Name)"
uevent = <store method only>
Device = "host3"
Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:13:00.0/host3"
ct =
edc = <store method only>
els =
fw_dump =
nvram = "ISP "
optrom_ctl = <store method only>
optrom =
reset = <store method only>
sfp = ""
uevent = <store method only>
vpd = "‚(" Class Device = "host4"
Class Device path = "/sys/class/fc_host/host4"
fabric_name = "0x10000005337638b9"
issue_lip = <store method only>
node_name = "0x20000024ff462815"
port_id = "0x021300"
port_name = "0x21000024ff462815"
port_state = "Online"
port_type = "NPort (fabric via point-to-point)"
speed = "8 Gbit"
supported_classes = "Class 3"
supported_speeds = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
symbolic_name = "QLE2562 FW:v5.03.16 DVR:v8.03.07.03.05.07-k"
system_hostname = ""
tgtid_bind_type = "wwpn (World Wide Port Name)"
uevent = <store method only>
Device = "host4"
Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:13:00.1/host4"
ct =
edc = <store method only>
els =
fw_dump =
nvram = "ISP "
optrom_ctl = <store method only>
optrom =
reset = <store method only>
sfp = ""
uevent = <store method only>
vpd = "‚("
Multipath相关软件介绍
1. device-mapper-multipath
即multipath-tools,主要提供multipathd和multipath等工具和 multipath.conf等配置文件。这些工具通过device mapper的ioctr的接口创建和配置multipath,设备创建的多路径设备映射会在/dev /mapper中。
2. device-mapper
主要包括两大部分:内核部分和用户部分。内核部分主要由device mapper核心(dm.ko)和一些target driver(md-multipath.ko)。核心完成设备的映射,而target根据映射关系和自身特点具体处理从mappered device 下来的i/o。同时,在核心部分,提供了一个接口,用户通过ioctr可和内核部分通信,以指导内核驱动的行为,比如如何创建mappered device,这些divece的属性等。linux device mapper的用户空间部分主要包括device-mapper这个包。其中包括dmsetup工具和一些帮助创建和配置mappered device的库。这些库主要抽象,封装了与ioctr通信的接口,以便方便创建和配置mappered device。multipath-tool的程序中就需要调用这些库
3. dm-multipath.ko和dm.ko:dm.ko是device mapper驱动。它是实现multipath的基础。dm-multipath其实是dm的一个target驱动。
https://www.cnblogs.com/jianqiang2010/archive/2011/09/01/2162574.html
AIX
http://blog.163.com/herod_xiao/blog/static/871883992011819112227689/
1. 检查multipath模块,如果没有相关模块就说明没有安装相关软件包
lsmod | grep dm_multipath
yum -y install device-mapper device-mapper-multipath
2. 加载相关模块
modprobe dm-multipath
modprobe dm-round-robin
3. 生成multipath配置文件,并配置
/sbin/mpathconf --enable
配置multipath.conf文件
4. 启动multipath服务
service multipathd start
chkcofig multipathd on
[root@tyhr ~]# multipath -ll
mpathc (36005076801820709e000000000000087) dm- IBM,
size=300G features='1 queue_if_no_path' hwhandler='' wp=rw
`-+- policy='round-robin 0' prio= status=active
|- ::: sdc : active ready running
|- ::: sde : active ready running
|- ::: sdg : active ready running
`- ::: sdi : active ready running
mpathb (36005076801820709e000000000000086) dm- IBM,
size=100G features='1 queue_if_no_path' hwhandler='' wp=rw
`-+- policy='round-robin 0' prio= status=active
|- ::: sdb : active ready running
|- ::: sdd : active ready running
|- ::: sdf : active ready running
`- ::: sdh : active ready running
如果完成配置后,不能使用multipath -ll查看到任何多路径信息,就需要手工重新扫描HBA信息
一般新增LUN映射给主机后,系统无法直接更新挂载的存储盘,需要重新扫描。
# cd /sys/class/scsi_host/host4/
# echo '- - - ' > scan
或
echo "" > /sys/class/fc_host/host/issue_lip //某些存储或系统没有scan文件,可以通issue_lip文件识别
RHEL5.x 操作系统,新增multipath后,能够识别磁盘,但是通过fdisk分区后,不能显示分区信息(/dev/mapper/dm-app 磁盘不显示/dev/mapper/dm-appp1)。partprob无报错但是没有效果。fdisk w保存后有报错:
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
Run "kpartx -a" after FDISK is completed to add all partition mappings on the
newly-created multipath device [root@TYEDI1 host4]# ls -l /dev/mapper/dm-*
brw-rw---- 1 root disk 253, 0 Jan 21 22:59 /dev/mapper/dm-app
brw-rw---- 1 root disk 253, 2 Jan 21 22:35 /dev/mapper/dm-arch
brw-rw---- 1 root disk 253, 1 Jan 21 22:52 /dev/mapper/dm-db [root@TYEDI1 host4]# kpartx -a /dev/mapper/dm-app [root@TYEDI1 host4]# ls -l /dev/mapper/dm-*
brw-rw---- 1 root disk 253, 0 Jan 21 22:59 /dev/mapper/dm-app
brw-rw---- 1 root disk 253, 3 Jan 21 23:01 /dev/mapper/dm-app1
brw-rw---- 1 root disk 253, 2 Jan 21 22:35 /dev/mapper/dm-arch
brw-rw---- 1 root disk 253, 1 Jan 21 22:52 /dev/mapper/dm-db
其他配置:
1. udev绑定权限
RHEL6.5,对于multipath的权限,手工去修改几秒后会变回root。所以需要使用udev去绑定好权限。
1)搜索对应的配置文件模板:
[root@jyrac1 ~]# find / -name -*
/usr/share/doc/device-mapper-1.02./-dm-permissions.rules\
2)根据模板新增12-dm-permissions.rules文件在/etc/udev/rules.d/下面:
vi /etc/udev/rules.d/-dm-permissions.rules
# MULTIPATH DEVICES
#
# Set permissions for all multipath devices
ENV{DM_UUID}=="mpath-?*", OWNER:="grid", GROUP:="asmadmin", MODE:="" # Set permissions for first two partitions created on a multipath device (and detected by kpartx)
# ENV{DM_UUID}=="part[1-2]-mpath-?*", OWNER:="root", GROUP:="root", MODE:=""
3)查看多路径对应的底层dm设备:
[root@jyrac2 rules.d]# ls -lh /dev/dm*
brw-rw---- root disk , Jul : /dev/dm-
brw-rw---- root disk , Jul : /dev/dm-
brw-rw---- root disk , Jul : /dev/dm-
brw-rw---- root disk , Jul : /dev/dm- 4)启动start_udev
[root@jyrac2 rules.d]# start_udev
Starting udev: [ OK ] 5)查看权限:
[root@jyrac2 rules.d]# ls -lh /dev/dm*
brw-rw---- root disk , Jul : /dev/dm-
brw-rw---- root disk , Jul : /dev/dm-
brw-rw---- grid asmadmin , Jul : /dev/dm-
brw-rw---- grid asmadmin , Jul : /dev/dm- 6)等30s后再查,权限固定:
[root@jyrac2 rules.d]# ls -lh /dev/dm*
brw-rw---- root disk , Jul : /dev/dm-
brw-rw---- root disk , Jul : /dev/dm-
brw-rw---- grid asmadmin , Jul : /dev/dm-
brw-rw---- grid asmadmin , Jul : /dev/dm-
可以使用lsscsi查看识别的磁盘信息:
[root@tyhr ~]# lsscsi
[:::] cd/dvd TSSTcorp DVD-ROM TS-L333H ID03 /dev/sr0
[:::] cd/dvd IMM Virtual CD/DVD /dev/sr1
[:::] disk IBM-ESXS MBF2300RC SB27 -
[:::] disk IBM-ESXS MBF2300RC SB27 -
[:::] disk LSILOGIC Logical Volume /dev/sda
[:::] disk IBM /dev/sdb
[:::] disk IBM /dev/sdc
[:::] disk IBM /dev/sdd
[:::] disk IBM /dev/sde
[:::] disk IBM /dev/sdf
[:::] disk IBM /dev/sdg
[:::] disk IBM /dev/sdh
[:::] disk IBM /dev/sdi
1. multipath常用操作:
multipath -r (修改multipath.conf配置文件之后重新加载)
multipath -ll (查看多路径状态)
multipath -v2 (格式化路径,检测路径,合并路径)
multipath -v3 (查看多路径详情blacklist、whitelist和设备wwid)
multipath -F (删除现有链路)
2. multipath文件详细介绍
接下来的工作就是要编辑/etc/multipath.conf的配置文件
相关参数的标准文档的介绍:
Attribute |
Description |
|||||||||
wwid |
Specifies the WWID of the multipath device to which the multipath attributes apply. This parameter is mandatory for this section of themultipath.conf file. |
|||||||||
alias |
Specifies the symbolic name for the multipath device to which themultipath attributes apply. If you are using user_friendly_names, do not set this value tompathn; this may conflict with an automatically assigned user friendly name and give you incorrect device node names. |
|||||||||
path_grouping_policy |
|
|||||||||
path_selector |
|
|||||||||
failback |
|
|||||||||
prio |
|
|||||||||
no_path_retry |
|
|||||||||
rr_min_io |
Specifies the number of I/O requests to route to a path before switching to the next path in the current path group. This setting is only for systems running kernels older that 2.6.31. Newer systems should userr_min_io_rq. The default value is 1000. |
|||||||||
rr_min_io_rq |
Specifies the number of I/O requests to route to a path before switching to the next path in the current path group, using request-based device-mapper-multipath. This setting should be used on systems running current kernels. On systems running kernels older than 2.6.31, use rr_min_io. The default value is 1. |
|||||||||
rr_weight |
If set to priorities, then instead of sending rr_min_io requests to a path before callingpath_selector to choose the next path, the number of requests to send is determined byrr_min_io times the path's priority, as determined by the prio function. If set touniform, all path weights are equal. |
|||||||||
flush_on_last_del |
If set to yes, then multipath will disable queueing when the last path to a device has been deleted. |
multipath与oracle ASM结合
https://www.cnblogs.com/jyzhao/p/7208620.html
已有配置文件:
defaults {
polling_interval
failback immediate
no_path_retry
rr_min_io
path_checker tur
user_friendly_names yes
}
devnode_blacklist {
devnode "sda"
}
devices {
device {
vendor "IBM"
product ""
path_grouping_policy group_by_prio
prio_callout "/sbin/mpath_prio_alua /dev/%n"
}
device {
vendor "IBM"
product ""
path_grouping_policy group_by_prio
prio_callout "/sbin/mpath_prio_alua /dev/%n"
}
device {
vendor "IBM"
product ""
path_grouping_policy group_by_serial
}
device {
vendor "IBM"
product ""
path_grouping_policy group_by_serial
}
}
multipaths {
multipath {
wwid 36005076801820709e000000000000043
alias dm-vote01
}
}
CentOS配置multipath的更多相关文章
- Linux CentOS 配置Tomcat环境
一.下载Tomcat 下载Tomcat方式也有两种,可以参考我的前一篇博文Linux CentOS配置JDK环境,这边就不再赘述. 二.在Linux处理Tomcat包 1.创建tomcat文件夹 mk ...
- CentOS 配置防火墙操作实例(启、停、开、闭端口):
CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作命令: 查询防火墙状态: [root@localhost ~]# service iptables status< ...
- CentOS配置SSH免密码登录后,仍提示输入密码
CentOS配置SSH无密码登录需要3步: 生成公钥和私钥 导入公钥到认证文件,更改权限 测试 1.生成公钥和私钥 ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 默 ...
- CentOS配置ssh无密码登录
CentOS配置ssh无密码登录的注意点 前提配置:使用root登录修改配置文件:/etc/ssh/sshd_config,将其中三行的注释去掉,如下: 然后重启ssh服务:service s ...
- 在VMware中为CentOS配置静态ip并可访问网络-Windows下的VMware
在VMware中为CentOS配置静态ip并可访问网络-Windows下的VMware 首先确保虚拟网卡(VMware Network Adapter VMnet8)是开启的,然后在windows的命 ...
- CentOS 配置防火墙操作实例(启、停、开、闭端口)CentOS Linux-FTP/对外开放端口(接口)TomCat相关
链接地址:http://blog.csdn.net/jemlee2002/article/details/7042991 CentOS 配置防火墙操作实例(启.停.开.闭端口): 注:防火墙的基本操作 ...
- Linux工具XFTP、Xshell(centos配置java环境 工具篇 总结一)
♣Xmanager5是什么? ♣安装XFTP ♣安装Xshell 1.Xmanager5(官网:https://www.netsarang.com/download/software.html)是全新 ...
- Linux配置mysql (centos配置java环境 mysql配置篇 总结四)
♣安装的几种方法和比较 ♣配置yum源 ♣安装mysql ♣启动mysql ♣修改密码 ♣导入.sql文件 ♣缓存设置 ♣允许远程登录(navicat) ♣配置编码为utf8 1.关于Linux系统 ...
- Linux配置tomcat (centos配置java环境 tomcat配置篇 总结三)
♣下载安装tomcat7 ♣设置启动和关闭 ♣设置用户名和密码 ♣发布java web项目 声明:这篇教程是建立在前两篇教程的基础上的,所以,还没安装工具和jdk,可以先看这个系列的前面两篇(去到文末 ...
随机推荐
- STM32-增量式旋转编码器测量
Development kit:MDK5.14 IDE:UV4 MCU:STM32F103C8T6 一.增量式旋转编码器 1.简介 编码器(encoder)是将信号(如比特流)或数据进行编制.转换为可 ...
- Objective-C Associated Objects 的实现原理
我们知道,在 Objective-C 中可以通过 Category 给一个现有的类添加属性,但是却不能添加实例变量,这似乎成为了 Objective-C 的一个明显短板.然而值得庆幸的是,我们可以通过 ...
- Mac OS 10.12使用SecureCRT 8.1.4无法保存密码的问题解决
参考上图取消Use Keychain即可. 参考: https://jingyan.baidu.com/article/915fc414fda5fb51394b20bd.html
- Mac下的SSH插件(默认自带)
Mac下默认自带,直接通过终端输入ssh获取更多的参数帮助.
- Mac OS 10.12后Caps lock(大写键)无法使用的解决办法
▲打开设置中的键盘选项,并切换至输入源选项标签, ▲取消勾选“使用大写锁定键来回切换“美国英文””, ▲这时再按下Caps lock即可正常使用大小写切换. ▲Update:目前macOS 10.12 ...
- @using (Html.BeginForm())和@{Html.BeginForm();}@{Html.EndForm();}对比
这样写报错 <body> @using (Html.BeginForm()) { form主体1 } @{Html.BeginForm();} ...
- 浅谈js中的垃圾两种回收机制
一.标记清除 标记清除的主要思想是先建立各个对象的关联,然后从根节点出发,使用广度优先搜索依次标记所有对象,那些不能被标记的对象就应该作为垃圾回收. 这种方式的主要缺点就是如果某些对象被清理后,内存是 ...
- ok6410 android driver(2)
I will paste and anlaysis a small character device driver in this paragraph. #include <linux/modu ...
- Office 的下载、安装和激活(图文详细)
不多说,直接上干货! 在这里,推荐一个很好的网址,http://www.itellyou.cn/ 销售渠道不同,激活通道也不同.有零售版,有大客户版.零售的用零售密钥激活,一对一. SW开头或在中间有 ...
- Comet事件分析
简介[ Introduction ] 使用APR或者NIO API作为连接器的基础,Tomcat能够提供一些在阻塞IO之上的有效扩展,用于支持Servlet API. [ With usage of ...