多路径下使用ASMLIB创建ASM磁盘

摘要:
使用ASMLIB在多路径中创建ASM磁盘。Asmlib以默认顺序扫描磁盘,通常是/dev/sd*。用于多路径配置的磁盘目录通常映射到/dev/mapper,因此#egrp-v“^#”/etc/sysconfig/oracleasmORACLEASM_ENABLED=trueORACLEASM_UID=gridORACLEASM_GID=asmadminORACLEASM_SCANBOOT=trueO

多路径下使用ASMLIB创建ASM磁盘

Asmlib有扫描磁盘有默认的顺序,通常为/dev/sd*,而多路径配置磁盘目录往往映射在/dev/mapper

因此

#  egrep -v "^#" /etc/sysconfig/oracleasm

ORACLEASM_ENABLED=true

ORACLEASM_UID=grid

ORACLEASM_GID=asmadmin

ORACLEASM_SCANBOOT=true

ORACLEASM_SCANORDER="multipath dm"   #先扫描多路径的盘符

ORACLEASM_SCANEXCLUDE="sd"          #排除sd开头的磁盘

ORACLEASM_SCAN_DIRECTORIES=""

ORACLEASM_USE_LOGICAL_BLOCK_SIZE=false

现配置示例

$ egrep -v "^#" /etc/sysconfig/oracleasm

ORACLEASM_ENABLED=true

ORACLEASM_UID=oracle

ORACLEASM_GID=asmadmin

ORACLEASM_SCANBOOT=true

ORACLEASM_SCANORDER="dm"

ORACLEASM_SCANEXCLUDE="sd"

ORACLEASM_USE_LOGICAL_BLOCK_SIZE=true

参考

Configuring Oracle ASMLib on Multipath Disks 
ASMLib is a support library for the Automatic Storage Management feature of Oracle Database 10g. Oracle provides a Linux specific implementation of this library. This document is a set of tips for configuring this ASMLib to access multipath devices. The full installation guide is part of the Oracle Database 10g Documentation .

Configuring Oracle ASMLib on Multipath Disks

This document describes the steps required to configure the Linux specific ASM library provided by Oracle (herin "ASMLib") to access multipath disks. It assumes that the multipath disks are already configured with whatever tools are provided by the storage. This document gives multipath disks the name " multipatha", so as to be storage vendor agnostic.

 

Issues Involving Multipath Disks

There are two issues with using multipath disks in ASM. ASM cannot handle seeing the same disk twice. If it does, it will cause an error. A single disk can appear three times in a multipath configuration:

  1. The first path to the disk
  2. The second path to the disk
  3. The multipath access point

Here's an example: say a system has one local disk, /dev/sda, and one disk attached via external storage. The machine has two connections, or paths, to that external storage. The Linux SCSI driver will see both paths. They will appear as /dev/sdb and /dev/sdc. The system may access sdb or sdc, the access ends up in the same place.

If multipathing is enabled, there will be a multipath disk, for example /dev/multipatha, that can access both paths. That is, any I/O to multipatha can use either path. If a system were using the sdb path, and that cable is unplugged, the system will get an error. But the multipath disk will know to switch to the sdc path.

Most system software will be unaware of the multipath configuration. It can use any of the paths,sdb, sdc, or multipatha, and it won't know the difference. ASMLib is the same way. The default configuration does not care which path it uses.

ASMLib will choose only one of the paths, because ASM cannot handle seeing the same disk twice. This solves the first issue. ASM only sees one path, and it is happy. Here is the second issue: which path does ASM see? In its default configuration, ASMLib will choose the first path it finds. This is the first path as reported by Linux. Depending on your storage driver, it could be the multipath, or it could be one of the single paths.

The system administrator wants ASMLib to always use the multipath disk. What's the point of having it if Oracle is not using it? There is no way, however, for ASMLib to know what a multipath looks like. It must be told via its configuration.

 

Disk Scan Ordering

Disks are marked for ASMLib using a process described in ASMLib Installation. ASMLib learns what disk are marked during a process called disk scanning. ASMLib runs this scan every time it starts up. The system administrator can also force a scan via the /etc/init.d/oracleasm scandisks command.

ASMLib examines each disk in the system. It checks if the disk has been marked for ASMLib. Any disk that has been marked will be made available to ASMLib. Normally, ASMLib checks each disk in the exact order the OS lists them. This is fine for most systems.

In the last section, we described a case where the OS order isn't good enough. The system administrator wants ASMLib to see multipath disks before it sees single path disks. This allows ASMLib to choose the multipath disk and make it available to Oracle.

ASMLib allows two modifications to the disk scan order. First, it allows exclusion of certain disks. In other words, ASMLib will ignore those disks completely. Second, the system administrator can specify disks that are to be scanned first. Disks in this list are scanned before the rest of the disks in the system.

A multipath configuration can use either facility. The system administrator could choose to exclude all the single path disks. ASMLib will then ignore them, only scanning the multipath disks. Conversely, the administrator could specify that the multipath disks are scanned first. ASMLib will see them first, and prefer them over the single paths.

 

Configuring the Scan Order

The Oracle ASMLib configuration file is located at /etc/sysconfig/oracleasm. It is a link to file /etc/sysconfig/oracleasm-_dev_oracleasm and tools actually read the later file. It contains all the startup configuration that the system administrator specified via the/etc/init.d/oracleasm configure command. That command cannot configure scan ordering.

The configuration file contains many configuration variables. The ORACLEASM_SCANORDER variable specifies disks to be scanned first. The ORACLEASM_SCANEXCLUDE variable specifies the disks that are to be ignored.

The variables take a whitespace-seperated list of prefix strings to match. In other words, if a disk starts with one of the prefix strings, it matches. For example, the prefix string sd will match all SCSI devices. The disk sda starts with sd. Note that these are not globs. They do not use wildcards. They are simple prefixes. Also note that the /dev/ path is not part of the prefix.

NOTE: When scanning, only the device names known by the kernel are scanned. With device-mapper, the kernel sees the devices as /dev/dm-XX. The /dev/mapper/XXX names are created by udev for human readability. Any configuration of ORACLEASM_SCANORDER orORACLEASM_SCANEXCLUDE must use the dm prefix.

A couple examples:

NOTE: If you are hand editing file /etc/sysconfig/oracleasm, make sure the link to /etc/sysconfig/oracleasm-_dev_oracleasm is not broken.

Multipath Disks First

The system administrator configures ASMLib to scan the multipath disks first. In the ASMLib configuration file she edits the ORACLEASM_SCANORDER variable to look like so:

                                               
  ORACLEASM_SCANORDER="multipath sd"

                                            

During a scan, ASMLib first tries all disks that start with "multipath". The multipath device/dev/multipatha certainly matches. It is scanned first. Next, ASMLib tries all disks that start with "sd". This is all the SCSI disks. The local disk /dev/sda will be scanned, but it is not an ASM disk. The single path disks /dev/sdb and /dev/sdc are also scanned. They are ASM disks, but ASMLib will see that it already has a path to that disk. It will ignore them. Finally, ASMLib will scan any other disks that did not match either prefix.

 

Excluding Single Path Disks

The system administrator configures ASMLib to ignore the single path disks. In the ASMLib configuration, he edits the ORACLEASM_SCANEXCLUDE variable to look like so:

                                               
  ORACLEASM_SCANEXCLUDE="sdb sdc"

                                            

Here, the system administrator has been more specific. ASMLib should ignore exactly the disks/dev/sdb and /dev/sdc. It should not ignore other SCSI disks. While scanning, ASMLib will ignore those paths, only seeing the /dev/multipath disk. Once again, Oracle will use the multipath disk.

EMC PowerPath and ASMLib

A lot of administrators want to use EMC PowerPath for multipathing and ASMLib for disk access.

However, PowerPath and the 2.4 kernels are not supported by EMC. Systems with the Linux 2.6 kernel, such as RHEL 4 or SLES 9, and the 2.0 ASMLib kernel driver are supported. Please reference the EMC Support Matrix to verify that any/all interoperability requirements are met.

If you have ANY issue related to support for ASMLib and PowerPath on systems using the Linux 2.4 kernel, such as RHEL 3 or SLES 8, please contact EMC.

免责声明:文章转载自《多路径下使用ASMLIB创建ASM磁盘》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇getRemoteAddr()和getRemoteHost() 区别Mysql 命令行下建立存储过程下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

海思MPP视频处理平台流程简介

海思MPP视频处理平台流程简介 hisi芯片系统概述 首先先来了解一下海思芯片SOC,下图是hi3519A芯片设计图                                      图1 hi3519AV100 芯片设计图  芯片的设计图有助于我们对海思的图像处理有一个大致的了解,从上图中我们可以看到,芯片SOC里集成了众多控制芯片,比如负责深...

fio硬盘压力测试

fio测试工具支持同步(pread/pwrite)和异步(libaio)FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio 等等。  ...

webpack4.x最详细入门讲解

前言 本文主要从webpack4.x入手,会对平时常用的Webpack配置一一讲解,各个功能点都有对应的详细例子,所以本文也比较长,但如果你能动手跟着本文中的例子完整写一次,相信你会觉得Webpack也不过如此。 一、什么是webpack,为什么使用它? 1.1 什么是webpack? 简单来说,它其实就是一个模块打包器。 1.2 为什么使用它? 如果像...

[置顶] AAM算法简介

History 1.Snake (Active Contour Models) --1989 2.ASM (Active Shape Models) --1995 3. Combined Appearance Models 4.AAM (Active Appearance Models)[1] --1998 1.Snake (Active Cont...

【转】Android各大发布市场

前言  如果只有一个或者少许的两三个Android市场,本文也没用存在的必要性,本文谨献给同在Android奋战的同仁。 声明 欢迎转载,但请保留文章原始出处:) 博客园:http://www.cnblogs.com农民伯伯: http://over140.cnblogs.com  正文  一、应用市场  1、Google Play https://pl...

Debian初安装

由于Ubuntu在我的笔记本上运行太慢,而且与Debian相比,增加了许多东西,所以还是决定换到Debian做开发. 从网站上下载第一张ISO安装光盘镜像,600多M,其它镜像不需要下载. 安装时选的是英文,安装过程都还算顺利, 注意安装过程中问你要不要扫描其它光盘,要不要使用网络安装,都选不要,否则就很慢. 安装完成后,需要先做些基础动作,否则很难用....