RAC_多路径配置
多路径配置
http://blog.itpub.net/31397003/viewspace-2143390/
- 挂盘/配置好yum源
2.程序包的安装
device-mapper-1.02.95-2.el6.x86_64.rpm
device-mapper-event-1.02.95-2.el6.x86_64.rpm
device-mapper-event-libs-1.02.95-2.el6.x86_64.rpm
device-mapper-libs-1.02.95-2.el6.x86_64.rpm
device-mapper-multipath-0.4.9-87.el6.x86_64.rpm
device-mapper-multipath-libs-0.4.9-87.el6.x86_64.rpm
device-mapper-persistent-data-0.3.2-1.el6.x86_64.rpm
yum install -y device-mapper*
3.启动multipath,并修改为自启动。
/etc/init.d/multipathd
start,执行这个命令,启动multipath。
chkconfig
--level 345 multipathd on,执行这个命令修为自启动。
4.配置/etc/multipath.conf文件。
该文件的模板,我们可以在/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf这里找到,然后把这个文件复制到/etc目录下,可以执行如下命令,
cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf
/etc/multipath.conf
然后编辑/etc/mulitpath.conf文件,进行如下的修改:
[root@dbrac1 etc]# vi multipath.conf
# This
is a basic configuration file with some examples, for device mapper
#
multipath.
# For a
complete list of the default configuration values, see
#
/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults
# For a
list of configuration options with descriptions, see
#
/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated
#
#
REMEMBER: After updating multipath.conf, you must run
#
#
service multipathd reload
#
# for
the changes to take effect in multipathd## By
default, devices with vendor = "IBM" and product =
"S/390.*" are
##
blacklisted. To enable mulitpathing on these devies, uncomment the
##
following lines.
#blacklist_exceptions
{
#
device {
#
vendor "IBM"
#
product "S/390.*"
#
}
#}## Use
user friendly names, instead of using WWIDs as names.
#defaults {
#
user_friendly_names yes
#}
##
## Here
is an example of how to configure some standard options.
##
#
defaults {
udev_dir
/dev
polling_interval 10
path_selector
"round-robin 0"
path_grouping_policy multibus
getuid_callout
"/lib/udev/scsi_id --whitelisted --device=/dev/%n"
prio
alua
path_checker
readsector0
rr_min_io
100
max_fds
8192
rr_weight
priorities
failback
immediate
no_path_retry fail
user_friendly_names yes
}
##
## The
wwid line in the following blacklist section is shown as an example
## of
how to blacklist devices by wwid. The 2 devnode lines are the
##
compiled in default blacklist. If you want to blacklist entire types
## of
devices, such as all scsi devices, you should use a devnode line.
##
However, if you want to blacklist specific devices, you should use
## a
wwid line. Since there is no guarantee that a specific device will
## not
change names on reboot (from /dev/sda to /dev/sdb for example)
##
devnode lines are not recommended for blacklisting specific devices.
##
blacklist {
wwid
26353900f02796769
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
}
#multipaths
{
#
multipath {
#
wwid
3600508b4000156d700012000000b0000
#
alias
yellow
#
path_grouping_policy multibus
#
path_checker
readsector0
#
path_selector
"round-robin 0"
#
failback
manual
#
rr_weight
priorities
#
no_path_retry 5
#
}
#
multipath {
#
wwid
1DEC_____321816758474
#
alias
red
#
}
#}
#devices
{
#
device {
#
vendor
"COMPAQ "
#
product
"HSV110 (C)COMPAQ"
#
path_grouping_policy multibus
#
getuid_callout
"/lib/udev/scsi_id --whitelisted --device=/dev/%n"
#
path_checker
readsector0
#
path_selector
"round-robin 0"
#
hardware_handler "0"
#
failback
15
#
rr_weight
priorities
#
no_path_retry queue
#
}
#
device {
#
vendor
"COMPAQ "
#
product
"MSA1000 "
#
path_grouping_policy multibus
#
}
#}
"multipath.conf"
96L, 2722C written其中,blacklist用来添加设备的黑名单,也就是说,设置某些设备,不让它多路径化。比如,我们可以把某些设备的wwid加入在这里
5.执行如下命令
modprobe dm-multipath
multipath
-F
multipath dm-multipath
multipath dm-round-robin
/etc/init.d/multipathd
restart执行完成上述命令之后,会在/etc/multipath目录下生成一个bindings这的一个文件,如下:
[root@dbrac1 etc]#
modprobe dm-multipath
WARNING:
Deprecated config file /etc/modprobe.conf, all config files belong into
/etc/modprobe.d/.
[root@dbrac1
etc]# multipath -F
[root@dbrac1
etc]# multipath dm-multipath
Aug 10
22:39:40 | sda: alua not supported
Aug 10
22:39:40 | sdb: alua not supported
Aug 10
22:39:40 | sdc: alua not supported
Aug 10
22:39:40 | sdd: alua not supported
Aug 10
22:39:40 | sde: alua not supported
Aug 10
22:39:40 | sdf: alua not supported
Aug 10
22:39:40 | sdg: alua not supported
Aug 10
22:39:40 | sdh: alua not supported
[root@dbrac1
etc]#
[root@dbrac1
etc]# multipath dm-round-robin
Aug 10
22:39:49 | sda: alua not supported
Aug 10
22:39:49 | sdb: alua not supported
Aug 10
22:39:49 | sdc: alua not supported
Aug 10
22:39:49 | sdd: alua not supported
Aug 10
22:39:49 | sde: alua not supported
Aug 10
22:39:49 | sdf: alua not supported
Aug 10
22:39:49 | sdg: alua not supported
Aug 10
22:39:49 | sdh: alua not supported
[root@dbrac1
etc]# /etc/init.d/multipathd restart
ok
Stopping
multipathd daemon: [ OK ]
Starting
multipathd daemon: [ OK ]
[root@dbrac1
etc]#
[root@dbrac1 etc]# cd /etc/multipath
[root@dbrac1 multipath]# ls
bindings
[root@dbrac1 multipath]# cat bindings
#
Multipath bindings, Version : 1.0
# NOTE:
this file is automatically maintained by the multipath program.
# You
should not need to edit this file in normal circumstances.
#
#
Format:
# alias
wwid
#
mpatha
1ATA VBOX
HARDDISK
VBebc3bf35-371818d2
mpathb
1ATA VBOX
HARDDISK
VB403dd68a-b8a5a8be
mpathc
1ATA VBOX
HARDDISK
VBcb1b0d8b-1ee73ac2
mpathd
1ATA VBOX
HARDDISK
VB5eb6b908-65677cda
mpathe
1ATA VBOX
HARDDISK
VBb020940b-4a482e15
mpathf
1ATA VBOX
HARDDISK
VBd60d065d-37d1710d
mpathg
1ATA VBOX
HARDDISK
VBf71eae83-8c806c3b
mpathh
1ATA VBOX
HARDDISK
VBd46e23c6-7ece6a6e
[root@dbrac1
multipath]#
这里存放的是多路径的磁盘名称和对应的ID。这时,我们可以使用fdisk -l这个命令查看到这些设备,比如/dev/mapper/mpatha。6.再次修改 vi
/etc/multipath.conf 文件,对应ID对应设备的别名。
由于上述的设备名称的可读性不是很好,所以我们要加入方便我们快速读的名称。修改/etc/multipath.conf文件,内容如下:multipaths {
multipath {
wwid
VB403dd68a-b8a5a8be
alias
ocrvotedisk1
path_grouping_policy multibus
}
multipath {
wwid
VBcb1b0d8b-1ee73ac2
alias
ocrvotedisk2
path_grouping_policy multibus
}
multipath {
wwid
VB5eb6b908-65677cda
alias
ocrvotedisk3
path_grouping_policy multibus
}
multipath {
wwid
VBb020940b-4a482e15
alias
fra1
path_grouping_policy multibus
}
multipath {
wwid
VBd60d065d-37d1710d
alias
fra2
path_grouping_policy multibus
}
multipath {
wwid
VBf71eae83-8c806c3b
alias
data1
path_grouping_policy multibus
}
multipath {
wwid
VBd46e23c6-7ece6a6e
alias
data2
path_grouping_policy multibus
}
}[root@dbrac1
multipath]# cat /etc/multipath.conf
# This
is a basic configuration file with some examples, for device mapper
#
multipath.
# For a
complete list of the default configuration values, see
#
/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults
# For a
list of configuration options with descriptions, see
#
/usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated
#
#
REMEMBER: After updating multipath.conf, you must run
#
#
service multipathd reload
#
# for
the changes to take effect in multipathd## By
default, devices with vendor = "IBM" and product =
"S/390.*" are
##
blacklisted. To enable mulitpathing on these devies, uncomment the
##
following lines.
#blacklist_exceptions
{
#
device {
#
vendor "IBM"
#
product "S/390.*"
#
}
#}## Use
user friendly names, instead of using WWIDs as names.
#defaults
{
#
user_friendly_names yes
#}
##
## Here
is an example of how to configure some standard options.
##
#
defaults
{
udev_dir
/dev
polling_interval 10
path_selector
"round-robin 0"
path_grouping_policy multibus
getuid_callout
"/lib/udev/scsi_id --whitelisted --device=/dev/%n"
prio
alua
path_checker
readsector0
rr_min_io
100
max_fds
8192
rr_weight
priorities
failback
immediate
no_path_retry fail
user_friendly_names yes
}
##
## The
wwid line in the following blacklist section is shown as an example
## of
how to blacklist devices by wwid. The 2 devnode lines are the
##
compiled in default blacklist. If you want to blacklist entire types
## of
devices, such as all scsi devices, you should use a devnode line.
##
However, if you want to blacklist specific devices, you should use
## a
wwid line. Since there is no guarantee that a specific device will
## not
change names on reboot (from /dev/sda to /dev/sdb for example)
##
devnode lines are not recommended for blacklisting specific devices.
##
blacklist {
wwid
26353900f02796769
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
}multipaths {
multipath {
wwid
VB403dd68a-b8a5a8be
alias
ocrvotedisk1
path_grouping_policy multibus
}
multipath {
wwid
VBcb1b0d8b-1ee73ac2
alias
ocrvotedisk2
path_grouping_policy multibus
}
multipath {
wwid
VB5eb6b908-65677cda
alias
ocrvotedisk3
path_grouping_policy multibus
}
multipath {
wwid
VBb020940b-4a482e15
alias
fra1
path_grouping_policy multibus
}
multipath {
wwid
VBd60d065d-37d1710d
alias
fra2
path_grouping_policy multibus
}
multipath {
wwid
VBf71eae83-8c806c3b
alias
data1
path_grouping_policy multibus
}
multipath {
wwid
VBd46e23c6-7ece6a6e
alias
data2
path_grouping_policy multibus
}
}
#multipaths
{
#
multipath {
#
wwid
3600508b4000156d700012000000b0000
#
alias
yellow
#
path_grouping_policy multibus
#
path_checker
readsector0
#
path_selector
"round-robin 0"
#
failback
manual
#
rr_weight
priorities
#
no_path_retry 5
#
}
#
multipath {
#
wwid
1DEC_____321816758474
#
alias
red
#
}
#}
#devices
{
#
device {
#
vendor
"COMPAQ "
#
product
"HSV110 (C)COMPAQ"
#
path_grouping_policy multibus
#
getuid_callout
"/lib/udev/scsi_id --whitelisted --device=/dev/%n"
#
path_checker
readsector0
#
path_selector
"round-robin 0"
#
hardware_handler "0"
#
failback
15
#
rr_weight
priorities
#
no_path_retry queue
#
}
#
device {
#
vendor
"COMPAQ "
#
product
"MSA1000 "
#
path_grouping_policy multibus
#
}
#}
[root@dbrac1
multipath]#
修改完成以后,重启机器即可(注意,在FC存储环境下不需要重新启动机器,直接执行service multipathd reload命令即可)。7.重启完成以后查看对应的设备。
重启完成以后,使用fdisk -l命令再次查看,会看到如下的形式的设备。
fdisk
-l8.完成多路径的配置以后,我们还不能直接安装grid,因为多路径对应的设备的权限需要更改。这个时候,我们还需要借助udev来完成
下面,我们来修改多路径的权限,对于多路径操作的有两个位置,/dev/mapper目录对应的文件与/dev/dm-*开头对应的文件。我们只需要修改/dev/dm-*应对的权限就可以了.第一种方法:我们需要用root修改 disk为grid asmadmin。直接修改,grid还是无法识别,所以,可以通过udev来完成。
在/etc/udev/rules.d目录下,加入如下的文件与内容,
[root@dbrac1 rules.d]# cat 99-asm.rules
KERNEL=="dm-[0-6]",
OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@dbrac1 rules.d]#第二种方法:编辑另外一个udev的配置文件,为12-.rules这样的一个udev的配置文件,比如文件名为12-mulitpath-privs.rules,其内容如下:
[root@dbrac1 rules.d]# vi /etc/udev/rules.d/12-mulitpath-privs.rules
ENV{DM_NAME}=="ocr*",
OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="fra*",
OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="data*",
OWNER:="grid", GROUP:="asmadmin", MODE:="660"第三种方法:以上是使用name来进行的,也可以使用uuid,比如如下:
[root@dbrac1 rules.d]# cat 12-mulitpath-privs.rules
ENV{DM_UUID}=="mpath-?*", OWNER:="grid",
GROUP:="asmadmin", MODE:="660"
................................
[root@dbrac1 rules.d]#每个磁盘的uuid可以在/dev/disk/by-id目录下找到,用ls -l命令就可以详细看到。
该udev的配置文件,可以在/usr/share/doc/device-mapper-/12-dm-permissions.rules中找到,这里有详细的模板。
推荐使用第二种方法来修改多路径设备的权限。至此多路径配置完成了!
----------补充------------------------
#查看是否安装了multipath
rpm -qa
| grep device-mapper#查看本地存储wwid
/lib/udev/scsi_id
--whitelisted --device=/dev/sda
36141877030bcca001d9c4d52106b9d90#查看存储参数
cat
/sys/block/sdb/device/vendor
3PARdatacat
/sys/block/sdb/device/model
VV#清空已有的multipath记录
multipath
-F
#打印诊断信息
multipath
-v3
#启用多路径守护程序以在引导时启动
mpathconf
--enable
#启动多路径服务
service multipathd start
#如果在启动 multipath 守护程序后更改多路径配置文件,请运行以下命令以使更改生效。
service multipathd reload
systemctl reload multipath
#重启系统测试
init 6
#查看多路径当前状态
multipath -ll
ls -l /dev/dm-*
cd /dev/mapper
ll
RAC_多路径配置的更多相关文章
- java 错误 classes路径配置错误
1. 错误显示页 2. 解决步骤 2.1. 查看 root cause 信息 org.springframework.beans.factory.BeanCreationException: Erro ...
- Spring扫面路径配置不全导致异常 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 的原因
运行Junit测试类 package cn.bgodata.x.zero.service; import org.junit.Test; import org.junit.runner.RunWith ...
- webpack插件配置(一) webpack-dev-server 路径配置
本文的路径配置主要涉及到webpack.config.js文件中devServer与output两个选项的配置 webpack-dev-server定义 webpack-dev-server主要是启动 ...
- nodejs安装及npm模块插件安装路径配置
在学习完js后,我们就要进入nodejs的学习,因此就必须配置nodejs和npm的属性了. 我相信,个别人在安装时会遇到这样那样的问题,看着同学都已装好,难免会焦虑起来.于是就开始上网查找解决方案, ...
- Java虚拟机性能管理神器 - VisualVM(3) 插件安装与更新路径配置
Java虚拟机性能管理神器 - VisualVM(3) 插件安装与更新路径配置 插件路径地址配置方法: VisualVM打开后,会发现功能比较单一,只有概述.监视.线程.抽样器.Profiler五个 ...
- vue-cli 3.0之跨域请求代理配置及axios路径配置
vue-cli 3.0之跨域请求代理配置及axios路径配置 问题:在前后端分离的跨域请求中,报跨域问题 配置: vue.config.js: module.exports = { runtimeCo ...
- jmeter安装部署、maven路径配置
jmeter下载地址: https://jmeter.apache.org/download_jmeter.cgi 解压文件 配置jmeter环境变量 (1)设置jmeter解压目录的JMETER_H ...
- JD路径配置及myeclipse主题和提示设置
1. JDKAN安装及环境变量配置 安装jdk,注意记住安装路径(F:\Java\jdk1.8.0_121 )(个人爱好) 系统变量→新建 JAVA_HOME 变量 . 变量值填写jdk的安装目录(F ...
- weblogic虚拟路径配置
首发地址 https://blog.leapmie.com/archives/344/ 前言 weblogic的虚拟路径配置有两种: 一种是在项目下配置,即在weblogic.xml中配置,该方法配置 ...
随机推荐
- linux 动态链接库查找方法;查找动态链接库位置; LIBRARY_PATH 和 LD_LIBRARY_PATH 的区别;LD_LIBRARY_PATH and LD_RUN_PATH的区别;
今天配置之前项目的时候,发现有些动态链接库变了,想看看现在应用在使用哪些动态链接库的时候,进一步查了点资料: 下面针对linux动态链接库查找方法和动态链接库位置配置的过程进行记录: LIBRARY_ ...
- 基于JS的ajax的实现,JSON和JSONP,基于JQuery的ajax的实现
基于JS的ajax的实现,JSON和JSONP,基于JQuery的ajax的实现1.基于JS的ajax的实现 step1: var xmlhttp = XMLHttprequest() #实例化一个对 ...
- [洛谷P1967][题解]货车运输
题目 这道题让我们求最小限重的最大值 显然可以先求出最大生成树,然后在树上进行操作 因为如果两点之间有多条路径的话一定会走最大的,而其他小的路径是不会被走的 然后考虑求最小权值 可以采用倍增求LCA, ...
- JCC 指令
JCC跳转指令 JCC指条件跳转指令,CC就是指条件码. JCC指令 中文含义 英文原意 检查符号位 典型C应用 JZ/JE 若为0则跳转:若相等则跳转 jump if zero;jump if eq ...
- Often Misused:Spring Remote Service 经常被误用:Spring远程服务
- Markdown 使用误区
新手写 Markdown 容易犯这么个错: 为了美观,使用标记. 例如 为了让一句话显示粗体,使用标题. 嫌 3 级标题字体太大,2 级标题子标题使用 4 级. 强调一个词,使用行内代码. -- 每个 ...
- 使用vue脚手架快速创建vue项目(入门)
1.安装环境 为了方便,以下操作大多数中命令行中运行,window可以用cmd,powershell,gitbash等. 安装node.js 打开它的官网,或者中文网站,然后直接下载就可以了,然后跟安 ...
- antdesign的input增加自定义校验规则
rules: [ {required: true, message: '请输入姓名'}, {max: 16, message: '姓名过长'}, { validator: (rule, val, ca ...
- ASP.NET Core 2.x 到 3.1 迁移指南
一.前言 今日(2019/12/4).NET Core 3.1 正式发布了,ASP.NET Core 3.1 随之发布,这次 3.0 到 3.1经过了两个月的短周期,并没有增加重大的功能,主要是对 3 ...
- 一起学Spring之基础篇
本文主要讲解Spring的基础环境搭建以及演变由来,仅供学习分享使用,如有不足之处,还请指正. 什么是Spring ? Spring是一个开源框架,用来处理业务逻辑层和其他层之间的耦合问题.因此Spr ...