首页 > 系统相关 >rac多路径下添加lun(centos 6)

rac多路径下添加lun(centos 6)

时间:2023-09-25 10:15:46浏览次数:37  
标签:dm 多路径 rac centos HARDDISK VBOX 1G 253 disk

环境:
OS:Centos 6.9
DB:11.2.0.4

 

1.虚拟机添加磁盘

 

2.每个登录查看磁盘情况

节点1:

[root@rac01 bin]# lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sr0                        11:0    1 1024M  0 rom   
sda                         8:0    0   35G  0 disk  
├─sda1                      8:1    0  500M  0 part  /boot
├─sda2                      8:2    0    4G  0 part  [SWAP]
└─sda3                      8:3    0 30.5G  0 part  
  └─vg_root-lvroot (dm-0) 253:0    0 30.5G  0 lvm   /
sdb                         8:16   0    1G  0 disk  
└─ocrdisk01 (dm-1)        253:1    0    1G  0 mpath 
sdc                         8:32   0    1G  0 disk  
└─ocrdisk02 (dm-2)        253:2    0    1G  0 mpath 
sdd                         8:48   0    1G  0 disk  
└─ocrdisk03 (dm-3)        253:3    0    1G  0 mpath 
sde                         8:64   0   10G  0 disk  
└─datadisk01 (dm-4)       253:4    0   10G  0 mpath 
sdf                         8:80   0   10G  0 disk  
└─redodisk01 (dm-5)       253:5    0   10G  0 mpath 
sdg                         8:96   0    1G  0 disk  
└─ocr01bakdisk (dm-6)     253:6    0    1G  0 mpath 
sdh                         8:112  0    1G  0 disk  
└─ocr02bakdisk (dm-7)     253:7    0    1G  0 mpath 
sdi                         8:128  0    1G  0 disk  
└─ocr03bakdisk (dm-8)     253:8    0    1G  0 mpath 
sdj                         8:144  0   30G  0 disk  
└─mpathd (dm-9)           253:9    0   30G  0 mpath 
sdk                         8:160  0   10G  0 disk  
└─mpathe (dm-10)          253:10   0   10G  0 mpath 

 

节点2:

[root@rac02 ~]# lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sr0                        11:0    1 1024M  0 rom   
sda                         8:0    0   35G  0 disk  
├─sda1                      8:1    0  500M  0 part  /boot
├─sda2                      8:2    0    4G  0 part  [SWAP]
└─sda3                      8:3    0 30.5G  0 part  
  └─vg_root-lvroot (dm-0) 253:0    0 30.5G  0 lvm   /
sdb                         8:16   0    1G  0 disk  
└─ocrdisk01 (dm-1)        253:1    0    1G  0 mpath 
sdc                         8:32   0    1G  0 disk  
└─ocrdisk02 (dm-2)        253:2    0    1G  0 mpath 
sdd                         8:48   0    1G  0 disk  
└─ocrdisk03 (dm-3)        253:3    0    1G  0 mpath 
sde                         8:64   0   10G  0 disk  
└─datadisk01 (dm-4)       253:4    0   10G  0 mpath 
sdf                         8:80   0   10G  0 disk  
└─redodisk01 (dm-5)       253:5    0   10G  0 mpath 
sdg                         8:96   0    1G  0 disk  
└─ocr01bakdisk (dm-6)     253:6    0    1G  0 mpath 
sdh                         8:112  0    1G  0 disk  
└─ocr02bakdisk (dm-7)     253:7    0    1G  0 mpath 
sdi                         8:128  0    1G  0 disk  
└─ocr03bakdisk (dm-8)     253:8    0    1G  0 mpath 
sdj                         8:144  0   30G  0 disk  
└─mpathi (dm-9)           253:9    0   30G  0 mpath 
sdk                         8:160  0   10G  0 disk  
└─mpathj (dm-10)          253:10   0   10G  0 mpath 

 

节点3:

[root@rac03 ~]# lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sr0                        11:0    1 1024M  0 rom   
sda                         8:0    0   35G  0 disk  
├─sda1                      8:1    0  300M  0 part  /boot
├─sda2                      8:2    0  3.9G  0 part  [SWAP]
└─sda3                      8:3    0 30.8G  0 part  
  └─vg_root-lvroot (dm-0) 253:0    0 30.8G  0 lvm   /
sdb                         8:16   0    1G  0 disk  
└─ocrdisk01 (dm-1)        253:1    0    1G  0 mpath 
sdc                         8:32   0    1G  0 disk  
└─ocrdisk02 (dm-2)        253:2    0    1G  0 mpath 
sdd                         8:48   0    1G  0 disk  
└─ocrdisk03 (dm-3)        253:3    0    1G  0 mpath 
sde                         8:64   0    1G  0 disk  
└─ocr01bakdisk (dm-4)     253:4    0    1G  0 mpath 
sdf                         8:80   0    1G  0 disk  
└─ocr02bakdisk (dm-5)     253:5    0    1G  0 mpath 
sdg                         8:96   0    1G  0 disk  
└─ocr03bakdisk (dm-6)     253:6    0    1G  0 mpath 
sdi                         8:128  0   10G  0 disk  
└─redodisk01 (dm-7)       253:7    0   10G  0 mpath 
sdj                         8:144  0   30G  0 disk  
└─mpatha (dm-8)           253:8    0   30G  0 mpath 
sdk                         8:160  0   10G  0 disk  
└─mpathb (dm-9)           253:9    0   10G  0 mpath 
sdh                         8:112  0   10G  0 disk  
└─datadisk01 (dm-10)      253:10   0   10G  0 mpath 

 

可以看到,共享磁盘挂载到每个机器后,盘符是不同的,下面找到新增磁盘的uuid.

 

3.找到新增磁盘的uuid

节点1:
[root@rac01 bin]# /lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/mapper/mpathd
1ATA_VBOX_HARDDISK_VB6d153909-ef011b58
[root@rac01 bin]# /lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/mapper/mpathe
1ATA_VBOX_HARDDISK_VBc3cdb83e-e09020b3

节点2:
[root@rac02 ~]# /lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/mapper/mpathi
1ATA_VBOX_HARDDISK_VB6d153909-ef011b58

[root@rac02 ~]# /lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/mapper/mpathj
1ATA_VBOX_HARDDISK_VBc3cdb83e-e09020b3

节点3:
[root@rac03 ~]# /lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/mapper/mpatha
1ATA_VBOX_HARDDISK_VB6d153909-ef011b58
[root@rac03 ~]# /lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/mapper/mpathb
1ATA_VBOX_HARDDISK_VBc3cdb83e-e09020b3

 

可以看到,共享磁盘虽然挂载到每个机器后,盘符是不同的,但是磁盘的uuid是相同的.

这里也可以从每个节点上部署的multipath下的bindings文件和wwids查看盘符与uuid的对应关系,下面以节点1为列

[root@rac01 multipath]# more 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
#
mpathf 1ATA_VBOX_HARDDISK_VB779b9035-39d44b9d
mpathg 1ATA_VBOX_HARDDISK_VBeebe1a1e-4d165a69
mpathh 1ATA_VBOX_HARDDISK_VB700c874b-4eda5d88
mpathi 1ATA_VBOX_HARDDISK_VB23597643-632b8a33
mpathj 1ATA_VBOX_HARDDISK_VBbbb16347-1c5fe609
mpatha 1ATA_VBOX_HARDDISK_VBa3c4a5e0-94bb5ab8
mpathb 1ATA_VBOX_HARDDISK_VBb0ea4d92-91689dbe
mpathc 1ATA_VBOX_HARDDISK_VB1c359161-37143588
mpathd 1ATA_VBOX_HARDDISK_VB6d153909-ef011b58
mpathe 1ATA_VBOX_HARDDISK_VBc3cdb83e-e09020b3
[root@rac01 multipath]# ls
bak_bindings  bindings  wwids

[root@rac01 multipath]# more wwids 
# Multipath wwids, Version : 1.0
# NOTE: This file is automatically maintained by multipath and multipathd.
# You should not need to edit this file in normal circumstances.
#
# Valid WWIDs:
/1ATA_VBOX_HARDDISK_VB779b9035-39d44b9d/
/1ATA_VBOX_HARDDISK_VBeebe1a1e-4d165a69/
/1ATA_VBOX_HARDDISK_VB700c874b-4eda5d88/
/1ATA_VBOX_HARDDISK_VB23597643-632b8a33/
/1ATA_VBOX_HARDDISK_VBbbb16347-1c5fe609/
/1ATA_VBOX_HARDDISK_VBa3c4a5e0-94bb5ab8/
/1ATA_VBOX_HARDDISK_VBb0ea4d92-91689dbe/
/1ATA_VBOX_HARDDISK_VB1c359161-37143588/
/1ATA_VBOX_HARDDISK_VB6d153909-ef011b58/
/1ATA_VBOX_HARDDISK_VBc3cdb83e-e09020b3/

 

4.修改配置文件,配置别名与wwid的对应关系,添加红色部分
添加红色部分,每个节点都要进程操作
vi /etc/multipath.conf

multipaths {
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VB779b9035-39d44b9d
               alias                   ocrdisk01
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VBeebe1a1e-4d165a69
               alias                   ocrdisk02
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VB700c874b-4eda5d88
               alias                   ocrdisk03
               path_grouping_policy    multibus
       }       
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VB23597643-632b8a33
               alias                   datadisk01
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VBbbb16347-1c5fe609
               alias                   redodisk01
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VBa3c4a5e0-94bb5ab8
               alias                   ocr01bakdisk
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VBb0ea4d92-91689dbe
               alias                   ocr02bakdisk
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VB1c359161-37143588
               alias                   ocr03bakdisk
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VB6d153909-ef011b58
               alias                   databak_disk
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    1ATA_VBOX_HARDDISK_VBc3cdb83e-e09020b3
               alias                   redobak_disk
               path_grouping_policy    multibus
       }
}

 

5.重新reload
每个节点都进行同样的操作
[root@rac01 ~]# multipath -r
或是执行 multipath -v3
这个时候就出现别名了
[root@rac01 multipath]# multipath -ll
redobak_disk (1ATA_VBOX_HARDDISK_VBc3cdb83e-e09020b3) dm-10 ATA,VBOX HARDDISK
size=10G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 12:0:0:0 sdk 8:160 active ready running
databak_disk (1ATA_VBOX_HARDDISK_VB6d153909-ef011b58) dm-9 ATA,VBOX HARDDISK
size=30G features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 11:0:0:0 sdj 8:144 active ready running

 

6.重新加载udev
每个节点都需要进行修改
[root@rac01 ~]# cd /etc/udev/rules.d/
添加新增项,红色部分
[root@rac01 rules.d]# more 99-oracle-asmdevices.rules
ENV{DM_NAME}=="ocrdisk01", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="ocrdisk02", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="ocrdisk03", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="datadisk01", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="redodisk01", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="ocr01bakdisk", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="ocr02bakdisk", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="ocr03bakdisk", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="databak_disk", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="redobak_disk", OWNER:="grid", GROUP:="asmadmin", MODE:="660"

 

[root@rac01 rules.d]# ls -al /dev/dm*
brw-rw---- 1 root disk 253, 0 Sep 25 08:54 /dev/dm-0
brw-rw---- 1 grid asmadmin 253, 1 Sep 25 09:31 /dev/dm-1
brw-rw---- 1 root disk 253, 10 Sep 25 09:27 /dev/dm-10
brw-rw---- 1 grid asmadmin 253, 2 Sep 25 09:31 /dev/dm-2
brw-rw---- 1 grid asmadmin 253, 3 Sep 25 09:31 /dev/dm-3
brw-rw---- 1 grid asmadmin 253, 4 Sep 25 09:31 /dev/dm-4
brw-rw---- 1 grid asmadmin 253, 5 Sep 25 09:31 /dev/dm-5
brw-rw---- 1 grid asmadmin 253, 6 Sep 25 09:27 /dev/dm-6
brw-rw---- 1 grid asmadmin 253, 7 Sep 25 09:27 /dev/dm-7
brw-rw---- 1 grid asmadmin 253, 8 Sep 25 09:27 /dev/dm-8
brw-rw---- 1 root disk 253, 9 Sep 25 09:27 /dev/dm-9

 

前新设备的权限还是属于root,执行如下命令后,权限赋予grid
[root@rac01 rules.d]#udevadm trigger
[root@rac01 rules.d]# ls -al /dev/dm*
brw-rw---- 1 root disk 253, 0 Sep 25 09:32 /dev/dm-0
brw-rw---- 1 grid asmadmin 253, 1 Sep 25 09:32 /dev/dm-1
brw-rw---- 1 grid asmadmin 253, 10 Sep 25 09:32 /dev/dm-10
brw-rw---- 1 grid asmadmin 253, 2 Sep 25 09:32 /dev/dm-2
brw-rw---- 1 grid asmadmin 253, 3 Sep 25 09:32 /dev/dm-3
brw-rw---- 1 grid asmadmin 253, 4 Sep 25 09:32 /dev/dm-4
brw-rw---- 1 grid asmadmin 253, 5 Sep 25 09:32 /dev/dm-5
brw-rw---- 1 grid asmadmin 253, 6 Sep 25 09:32 /dev/dm-6
brw-rw---- 1 grid asmadmin 253, 7 Sep 25 09:32 /dev/dm-7
brw-rw---- 1 grid asmadmin 253, 8 Sep 25 09:32 /dev/dm-8
brw-rw---- 1 grid asmadmin 253, 9 Sep 25 09:32 /dev/dm-9

至此,添加新的lun完成.

 

标签:dm,多路径,rac,centos,HARDDISK,VBOX,1G,253,disk
From: https://www.cnblogs.com/hxlasky/p/17727255.html

相关文章

  • centos7中 组装软件 MaSuRCA 的安装
     001、下载最新安装包下载地址:https://github.com/alekseyzimin/masurca/releases 002、解压,进入安装目录tar-xzvfMaSuRCA-4.1.0.tar.gzcdMaSuRCA-4.1.0/ 003、安装依赖(base)[[email protected]]#yum-yinstallboostboost-develgcc-c++.x86_64gp......
  • 新装Linux系统必备操作(Ubuntu & CentOS 7)
    设置输入法、快捷键以CentOS7为例:设置输入法:Region&Language,设置输入法为“中文(拼音)”和“英语(美国)”设置切换输入法快捷键:设备-keyboard-打字,切换下一输入法快捷键为Ctrl+Space设置打开终端快捷键:设备-keyboard,点击底部'+'添加快捷键,名称“打开终端”,指令......
  • Linux Centos7 虚拟环境安装Mysql数据库(超详细图文讲解)
    1、进入Centos7虚拟机,使用wget下载Mysql相应的rpm包下载:wgethttp://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm如果没有wget命令,可以使用yum安装,yuminstallwget2、执行rpm命令,安装rpmrpm-ivhmysql57-community-release-el7-8.noarch.rpm 3、安装Mys......
  • linux教程:centos7安装svn 1.10客户端(subversion指定版本安装)
    repotee/etc/yum.repos.d/wandisco-svn.repo<<-'EOF'[WandiscoSVN]name=WandiscoSVNRepobaseurl=http://opensource.wandisco.com/centos/7/svn-1.10/RPMS/$basearch/enabled=1gpgcheck=0EOF在线安装yumcleanallyuminstall-ysubversion离线安装从如下地址......
  • tesseract-ocr下载安装与配置
    tesseract-ocr下载安装与配置 1:下载地址:https://digi.bib.uni-mannheim.de/tesseract/......
  • flask框架在Centos正常启动后到Windows浏览器访问(http://192.168.124.129:5550/)提示无
    1、flask在centos正常启动 2、然后复制链接到window访问,提示无法访问3、排查下,Linux和Windows互相ping下WindowpingLinuxIP LinuxpingWindowIP如上能够正常ping通,说明网段是正常的4、再排查下,Linux是不是防火墙没有关闭查看防火墙状态命令:systemctlstatusfir......
  • Oracle process/session/cursor/tx/tm的简单学习
    Oracleprocess/session/cursor/tx/tm的简单学习Oracle的部署模式Oracle安装时有专用模式和共享模式的区别共享模式(Sharedmode):在共享模式下,会话可以同时读取数据库的数据,多个会话可以并发地进行读取操作。这意味着多个会话可以共享相同的数据快照,并且彼此之间不会阻塞。......
  • 看雪ctf AliCrackme_2
    看雪ctfAliCrackme_2使用jadx打开,去IDA打开so,搜索check可以搜索到说明是静态注册的,看着就是一个简单的校验,但是填进去错误,看到题目的提示是有反调试,但用frida附加时没有反调试的,应该是针对IDA的反调试,网上查找了下,发现了几种反调试的方法反调试方法1.IDA调试端口检测在调......
  • Centos7 Git 安装
    Centos7Git安装最新git源码下载地址:https://github.com/git/git/releaseshttps://www.kernel.org/pub/software/scm/git/1移除旧版本gitcentos自带Git,7.x版本自带git1.8.3.1(应该是,也可能不是),安装新版本之前需要使用yumremovegit卸载(安装后卸载也可以)。建议:执行第5步......
  • CentOS轻松查看监听端口,实用技巧与案例
    在进行服务器安全设置时,了解当前系统的监听端口是非常重要的。CentOS作为一种流行的Linux操作系统,在查看监听端口方面也有其独特的方法。本文将详细介绍如何在CentOS上查看监听端口,并提供相关案例、数据和技巧centos查看监听端口,帮助读者轻松掌握服务器安全。一、什么是监听端口?......