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中配置,该方法配置 ...
随机推荐
- Cookie与Session会话技术
Cookie与Session会话技术 一.什么是会话 会话:当用户打开浏览器,访问多个WEB资源,然后关闭浏览器的过程,称之为一个会话,选项卡,弹出页面都属于这个会话,且共享同一个session. 二 ...
- mysql事务隔离级别、脏读、幻读
Mysql事务隔离级别本身很重要,再加上可能是因为各大公司面试必问的缘故,在博客中出现的概率非常高,但不幸的是,中国的技术博客要么是转载,要么是照抄,质量参差不齐,好多结论都是错的,对于心怀好奇之心想 ...
- (八十一)c#Winform自定义控件-时间轴-HZHControls
官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...
- sklearn集成支持向量机svm.SVC参数说明
经常用到sklearn中的SVC函数,这里把文档中的参数翻译了一些,以备不时之需. 本身这个函数也是基于libsvm实现的,所以在参数设置上有很多相似的地方.(PS: libsvm中的二次规划问题的解 ...
- VMware安装vmtools实现宿主机和虚拟机共享粘贴板
打开VMware以Ubuntu14.04.6为例,保持网络畅通,在线下载工具包 下载完成后dvd下出现该压缩包 将其复制到桌面并在桌面进入终端 执行命令: tar -zxvf xxxx.tar.gz ...
- jquery仿淘宝购物车页面商品结算(附源码)
1.效果图如下: 2.源码如下: html部分: <!doctype html> <html lang="en"> <head> <met ...
- InnoDB On-Disk Structures(二)--Indexes (转载)
转载.节选于 https://dev.mysql.com/doc/refman/8.0/en/innodb-indexes.html This section covers topics relate ...
- diango运行流程
diango运行流程 Django处理一个请求的流程: 在浏览器的地址栏中输入地址,回车,发了一个GET请求 wsgi模块接收了请求,将请求的相关信息封装成request对象 根据地址找到对应函数 执 ...
- Linux系统学习 二十二、SAMBA服务—Samba基本使用—share权限访问、客户端的使用
share权限访问 配置文件修改 [global]全局设置 workgroup=MYGROUP server string=Samba Server Lamp log file=/var/log/sa ...
- jxl.jar下载
jxl.jar是通过java操作excel表格的工具类库,是由java语言开发而成的. 在网上找了很多,不是链接失效,就是csdn上要钱的,所以干脆上传个到自己的博客文件里,方便你们下载. 下载地址: ...