ITPub博客

首页 > 数据库 > Oracle > RAC-rac+dg step2--设置共享磁盘-udev

RAC-rac+dg step2--设置共享磁盘-udev

Oracle 作者:peng163fj 时间:2015-04-15 11:16:18 1 删除 编辑
  1. 设置共享磁盘

这里可以采用asmlib也可以采用udev来管理,我安装的时候asmlib没有通过一直报错,最后采用了udev来管理,推荐采用udev来管理,asmlib最高支持到rhel5.9,所以这里只演示采用udev来管理,当然使用raw也可以的,有兴趣的可以联系我,,,

 

 

  1. 可以使用udev来 共享存储规划

 

 

  1. 配置 udev 绑定的 scsi_id

注意以下两点:

首先切换到root用户下:

5.1. 不同的操作系统,scsi_id 命令的位置不同。

[root@localhost ~]# cat /etc/issue

Oracle Linux Server release 6.5

Kernel \r on an \m

 

注意:rhel 6 之后只支持 --whitelisted --replace-whitespace 参数,之前的 -g -u -s 参数已经不支持了。

 

[root@localhost ~]# which scsi_id

/sbin/scsi_id

[root@localhost ~]#

5.2. 编辑 /etc/scsi_id.config 文件,如果该文件不存在,则创建该文件并添加如下行:

 

[root@localhost ~]# vi /etc/scsi_id.config

options=--whitelisted --replace-whitespace

[root@localhost ~]#

5.3. 如果是使用 VMware 虚拟机,直接输入 scsi_id 命令可能无法获取 id,需修改 VMware 文件参数,这一步如果在添加磁盘的时候做过这一步的话就可以跳过了,直接获取uuid即可

[root@RMSDB01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/emcpowera
360000970000498700140533030373937
[root@RMSDB01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/emcpowerb
360000970000498700140533030343837
[root@RMSDB01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/emcpowerc
360000970000498700140533030343838

  1. 创建并配置 udev rules 文件

[root@localhost ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="360000970000498700140533030373937", NAME="asm-diska", OWNER="grid",GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="360000970000498700140533030343837", NAME="asm-diskb", OWNER="grid",GROUP="oinstall", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="360000970000498700140533030343838", NAME="asm-diskc", OWNER="grid",GROUP="oinstall", MODE="0660"

 

 

根据步骤 5 获取的 ID 修改 RESULT 值

这里需要注意,一个KERNEL就是一行,不能换行的,我之前就是犯了这个错误的

 

 

  1. 发送到rac2

scp /etc/udev/rules.d/99-oracle-asmdevices.rules rac2:/etc/udev/rules.d

 123.asd

 

  1. 添加完成后,重启 udev,不同 Linux 发行版本重启方式不一样。

该步骤慢一点,大约可能需要30秒左右吧,等等等等。。。。。。

[root@localhost ~]# start_udev

Starting udev: [ OK ]

[root@localhost ~]#

  1. 查看绑定的 asm,如果此时还是看不到 asm disk,请重启操作系统后再查看。

[root@localhost ~]# ll /dev/asm*

brw-rw---- 1 grid asmadmin 8, 17 Oct 17 14:26 /dev/asm-diskb

brw-rw---- 1 grid asmadmin 8, 33 Oct 17 14:26 /dev/asm-diskc

  1. 对硬盘进行分区

[root@localhost share]# fdisk -l | grep "Disk /dev/sd"

 

 

 

以下操作在节点1完成:

[root@rac01 ~]# fdisk /dev/sdb

Command (m for help): p

 

Disk /dev/sdb: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

Device Boot Start End Blocks Id System

 

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1044, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044):

Using default value 1044

 

Command (m for help): p

 

Disk /dev/sdb: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

Device Boot Start End Blocks Id System

/dev/sdb1 1 1044 8385898+ 83 Linux

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

...

 

fdisk /dev/sdc

fdisk /dev/sdd

 

 

 

  1. 共享磁盘设置不正确报错

执行root脚本报错:

 

第一种:

DiskGroup CRS creation failed with the following message:

ORA-15018: diskgroup cannot be created

ORA-15080: synchronous I/O operation to a disk failed

 

第二种:

Configuration of ASM failed, see logs for details

Did not succssfully configure and start ASM

CRS-2500: Cannot stop resource 'ora.crsd' as it is not running

CRS-4000: Command Stop failed, or completed with errors.

Command return code of 1 (256) from command: /u01/app/grid/11.2.0/bin/crsctl stop resource ora.crsd -init

Stop of resource "ora.crsd -init" failed

Failed to stop CRSD

 

 

第三种:

2014-06-05 06:39:01: Did not succssfully configure and start ASM

2014-06-05 06:39:01: Exiting exclusive mode

2014-06-05 06:39:01: Command return code of 1 (256) from command: /u01/app/grid/11.2.0/bin/crsctl stop resource ora.crsd -init

2014-06-05 06:39:01: Stop of resource "ora.crsd -init" failed

2014-06-05 06:39:01: Failed to stop CRSD

2014-06-05 06:39:32: Initial cluster configuration failed. See /u01/app/grid/11.2.0/cfgtoollogs/crsconfig/rootcrs_rac1.log for details

 

 

2013-01-21 11:19:25.396: [ CRSOCR][1] OCR context init failure. Error: PROC-26: Error while accessing the physical storage ASM error [SLOS: cat=8, opn=kgfoOpenFile01, dep=15056, loc=kgfokge

ORA-17503: ksfdopnGOpenFile05 Failed to open file +OCR.255.4294967295

ORA-17503: ksfdopn:2 Failed to open file +OCR.255.4294967295

ORA-15001: diskgroup "OCR"

] [8]

2013-01-21 11:19:25.396: [ CRSD][1][PANIC] CRSD exiting: Could not init OCR, code: 26

2013-01-21 11:19:25.396: [ CRSD][1] Done.

 

 

 

2014-06-06 23:20:23.442: [ OCRRAW][2849145568]propriogid:1_2: INVALID FORMAT

2014-06-06 23:20:23.442: [ OCRRAW][2849145568]proprioini: all disks are not OCR/OLR formatted

2014-06-06 23:20:23.442: [ OCRRAW][2849145568]proprinit: Could not open raw device

2014-06-06 23:20:23.445: [ OCRAPI][2849145568]a_init:16!: Backend init unsuccessful : [26]

2014-06-06 23:20:23.445: [ CRSOCR][2849145568] OCR context init failure. Error: PROC-26: Error while accessing the physical storage

2014-06-06 23:20:23.445: [ CRSD][2849145568][PANIC] CRSD exiting: Could not init OCR, code: 26

2014-06-06 23:20:23.446: [ CRSD][2849145568] Done.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21302630/viewspace-1577565/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-20

  • 博文量
    155
  • 访问量
    440178