设为首页 收藏本站
查看: 2085|回复: 0

[经验分享] 在Red Hat Linux Server 6上使用ASMLib-linux

[复制链接]

尚未签到

发表于 2018-10-22 08:26:50 | 显示全部楼层 |阅读模式
  从安装Oracle Database的角度来看,Oracle Linux要比Red Hat Linux更加适合,况且即使是Red Hat Linux 6,ASMLib也不是唯一的选择,但出于历史原因,我们通过这篇文章讨论一下在Red Hat Linux Server 6上能否使用ASMLib?
  下面是Oracle对在Red Hat Linux 6上使用ASMLib的说明:
Oracle ASMLib Downloads for Red Hat Enterprise Linux Server 6
  Note: All ASMLib installations require that the 'kmod-oracleasm','oracleasmlib' and 'oracleasm-support' packages be installed on the system. The 'oracleasmlib' and 'oracleasm-support' packages are available for download at the locations listed below.
  The kernel driver package 'kmod-oracleasm' is available directly from Red Hat, and can be installed from the "RHEL Server Supplementary (v. 6 64-bit x86_64)" channel on Red Hat Network (RHN).  Use the ASMLib kernel driver that corresponds to the version of the Red Hat Enterprise Linux kernel you're running.

  To>  使用ASMLib需要3个包:kmod-oracleasm oracleasmlib oracleasm-support,后两个包都可以直接在网站上下载到,关键是第一个ASMLib内核驱动包需要到RHN上更新,且应该匹配操作系统的内核版本。
  以上文字来源于:http://www.oracle.com/technetwork/server-storage/linux/asmlib/rhel6-1940776.html
  下面是Oracle对在Oracle Linux 6上使用ASMLib的说明:

Oracle ASMLib Downloads for Oracle Linux 6
  Note: All ASMLib installations require the oracleasmlib and oracleasm-support packages appropriate for their machine.
  The oracleasm-support package can be downloaded from the Unbreakable Linux Network(ULN) if you have an active support subscription, or from http://public-yum.oracle.com if you do not.
  The oracleasm kernel driver is built into the Unbreakable Enterprise Kernel for Oracle Linux 6 and does not need to be installed manually.
  The oracleasm kernel driver for the 64-bit (x86_64) Red Hat Compatible Kernel for Oracle Linux 6 can be installed manually from ULN or http://public-yum.oracle.com using the yum tool:
# yum install kmod-oracleasm  This kernel driver is not version-specific and does not need to be upgraded when the kernel is upgraded.
  如果使用的是Oracle Linux的uek内核,oracleasm已经被编译到了内核中,如果使用的是和Red Hat兼容的内核,那么需要手动安装kmod-oracleasm包。
  以上文字来源于:
  http://www.oracle.com/technetwork/server-storage/linux/asmlib/ol6-1709075.html
  [root@localhost ~]# cd /etc/yum.repos.d/
  [root@localhost yum.repos.d]# ls
  rhel-source.repo
  [root@localhost yum.repos.d]# wget http://public-yum.oracle.com/public-yum-ol6.repo
  --2014-03-25 22:43:05--  http://public-yum.oracle.com/public-yum-ol6.repo
  Resolving public-yum.oracle.com... 2.16.54.48, 2.16.54.96
  Connecting to public-yum.oracle.com|2.16.54.48|:80... failed: Connection reset by peer.
  Connecting to public-yum.oracle.com|2.16.54.96|:80... connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 4233 (4.1K) [text/plain]
  Saving to: “public-yum-ol6.repo”
  100%[===================================================================================================>] 4,233       --.-K/s   in 0s
  2014-03-25 22:43:07 (190 MB/s) - “public-yum-ol6.repo” saved [4233/4233]
  [root@localhost yum.repos.d]# wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
  --2014-03-25 23:06:00--  http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
  Resolving public-yum.oracle.com... 46.33.75.121, 46.33.75.138
  Connecting to public-yum.oracle.com|46.33.75.121|:80... connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 1011 [text/plain]
  Saving to: “/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle”
  100%[===================================================================================================>] 1,011       --.-K/s   in 0s
  2014-03-25 23:06:01 (27.6 MB/s) - “/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle” saved [1011/1011]
  [root@localhost yum.repos.d]# yum install kmod-oracleasm
  Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
  This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  Setting up Install Process
  Resolving Dependencies
  --> Running transaction check
  ---> Package kmod-oracleasm.x86_64 0:2.0.6.rh1-2.el6 will be installed
  --> Finished Dependency Resolution
  Dependencies Resolved
  =============================================================================================================================================

  Package                             Arch                        Version                               Repository                      >  =============================================================================================================================================
  Installing:
  kmod-oracleasm                      x86_64                      2.0.6.rh1-2.el6                       ol6_latest                       34 k
  Transaction Summary
  =============================================================================================================================================
  Install       1 Package(s)

  Total>
  Installed>  Is this ok [y/N]: y
  Downloading Packages:

  warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key>  Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
  Importing GPG key 0xEC551F03:
  Userid: "Oracle OSS group (Open Source Software group) "@oss.oracle.com>
  From  : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
  Is this ok [y/N]: y
  Running rpm_check_debug
  Running Transaction Test
  Transaction Test Succeeded
  Running Transaction
  Installing : kmod-oracleasm-2.0.6.rh1-2.el6.x86_64                                                                                     1/1
  mylocalnet/productid                                                                                                  | 1.7 kB     00:00 ...
  Verifying  : kmod-oracleasm-2.0.6.rh1-2.el6.x86_64                                                                                     1/1
  Installed:
  kmod-oracleasm.x86_64 0:2.0.6.rh1-2.el6
  Complete!
  ------------------------------------------------------------------------
  oracleasmlib-2.0.4-1.el6.x86_64.rpm
  oracleasm-support-2.1.8-1.el6.x86_64.rpm
  这两个包可以通过ORACLE官方网站进行下载  http://www.oracle.com/technetwork/server-storage/linux/asmlib/rhel6-1940776.html
  [root@localhost opt]# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm oracleasm-support-2.1.8-1.el6.x86_64.rpm
  Preparing...                ########################################### [100%]
  1:oracleasm-support      ########################################### [ 50%]
  2:oracleasmlib           ########################################### [100%]
  至此在Red Hat Linux Server 6.4 x86_64bit上成功安装了kmod-oracleasm oracleasm-support oracleasmlib 3个包。
  [root@localhost ~]# /etc/init.d/oracleasm configure
  Configuring the Oracle ASM library driver.
  This will configure the on-boot properties of the Oracle ASM library
  driver.  The following questions will determine whether the driver is
  loaded on boot and what permissions it will have.  The current values
  will be shown in brackets ('[]').  Hitting  without typing an
  answer will keep that current value.  Ctrl-C will abort.
  Default user to own the driver interface []: grid
  Default group to own the driver interface []: asmadmin
  Start Oracle ASM library driver on boot (y/n) [n]: y
  Scan for Oracle ASM disks on boot (y/n) [y]: y
  Writing Oracle ASM library driver configuration: done
  Initializing the Oracle ASMLib driver: [FAILED]
  目前知道可能导致这个错误的原因有两个:
  1.oracle asmlib内核和linux系统内核不符,修正方法,到oracle网站下载内核版本符合的asmlib,从新安装。
  [root@rac01 etc]# uname -r
  2.6.32-220.el6.x86_64
  [root@rac01 oracle]# rpm -qa|grep oracleasm
  oracleasm-support-2.1.8-1.el6.x86_64
  kmod-oracleasm-2.0.8-6.el6_7.x86_64
  oracleasmlib-2.0.4-1.el6.x86_64
  发现在使用yum安装kmod-oracleasm时同时Updateb了一个新的kernel,原有内核为2.6.32-220.el6.x86_64、新内核为2.6.32-573.12.1.el6.x86_64。
  [root@localhost ~]# cat /boot/grub/grub.conf
  # grub.conf generated by anaconda
  #
  # Note that you do not have to rerun grub after making changes to this file
  # NOTICE:  You have a /boot partition.  This means that

  #          all kernel and initrd paths are>  #          root (hd0,0)
  #          kernel /vmlinuz-version ro root=/dev/sda2
  #          initrd /initrd-[generic-]version.img
  #boot=/dev/sda
  default=0
  timeout=5
  splashimage=(hd0,0)/grub/splash.xpm.gz
  hiddenmenu
  title CentOS (2.6.32-573.12.1.el6.x86_64)
  root (hd0,0)
  kernel /vmlinuz-2.6.32-573.12.1.el6.x86_64 ro root=UUID=259c88b6-618d-4050-bb4a-a92f747e2f29 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
  initrd /initramfs-2.6.32-573.12.1.el6.x86_64.img
  title CentOS (2.6.32-220.el6.x86_64)
  root (hd0,0)
  kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=259c88b6-618d-4050-bb4a-a92f747e2f29 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
  initrd /initramfs-2.6.32-220.el6.x86_64.img
  -------------------------------------------------------------
  重启系统加载新的内核。
  2.linux的selinux没有设置为disable
  # vi /etc/selinux/config (把SELINUX置为disabled)
  SELINUX=disabled
  [root@localhost ~]# /etc/init.d/oracleasm configure
  Configuring the Oracle ASM library driver.
  This will configure the on-boot properties of the Oracle ASM library
  driver.  The following questions will determine whether the driver is
  loaded on boot and what permissions it will have.  The current values
  will be shown in brackets ('[]').  Hitting without typing an
  answer will keep that current value.  Ctrl-C will abort.
  Default user to own the driver interface []: grid
  Default group to own the driver interface []: asmadmin
  Start Oracle ASM library driver on boot (y/n) [n]: y
  Scan for Oracle ASM disks on boot (y/n) [y]:
  Writing Oracle ASM library driver configuration: done
  Initializing the Oracle ASMLib driver: [  OK  ]
  Scanning the system for Oracle ASMLib disks: [  OK  ]
  [root@localhost ~]# fdisk -l
  Disk /dev/sda: 53.7 GB, 53687091200 bytes
  255 heads, 63 sectors/track, 6527 cylinders
  Units = cylinders of 16065 * 512 = 8225280 bytes

  Sector>
  I/O>
  Disk>
  Device Boot      Start         End      Blocks  >  /dev/sda1   *           1          26      204800   83  Linux
  Partition 1 does not end on cylinder boundary.
  /dev/sda2              26         679     5242880   82  Linux swap / Solaris
  Partition 2 does not end on cylinder boundary.
  /dev/sda3             679        6528    46980096   83  Linux
  Disk /dev/sdb: 8589 MB, 8589934592 bytes
  255 heads, 63 sectors/track, 1044 cylinders
  Units = cylinders of 16065 * 512 = 8225280 bytes

  Sector>
  I/O>
  Disk>  [root@localhost ~]# fdisk /dev/sdb
  Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

  Building a new DOS disklabel with disk>  Changes will remain in memory only, until you decide to write them.
  After that, of course, the previous content won't be recoverable.
  Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
  WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
  switch off the mode (command 'c') and change display units to
  sectors (command 'u').
  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, +cylinders or +size{K,M,G} (1-1044, default 1044):
  Using default value 1044
  Command (m for help): w

  The partition table has been>  Calling ioctl() to re-read partition table.
  Syncing disks.
  [root@cafis ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
  Marking disk "VOL1" as an ASM disk:                        [  OK  ]
  查看硬盘设置与ASM disk对应关系
  [root@localhost disks]# ls -lt
  total 0
  brw-rw---- 1 oracle oinstall8, 17 Nov 30 23:02 VOL1
  [root@cafis disks]# cd /dev/
  [root@cafis dev]# ls -lt sd*
  brw-rw---- 1 root disk 8, 17 Nov 30 23:04 sdb1
  brw-rw---- 1 root disk 8, 16 Nov 30 23:04 sdb
  brw-rw---- 1 root disk 8,  1 Nov 30 23:00 sda1
  brw-rw---- 1 root disk 8,  2 Nov 30 23:00 sda2
  brw-rw---- 1 root disk 8,  3 Nov 30 23:00 sda3
  brw-rw---- 1 root disk 8,  5 Nov 30 23:00 sda5
  brw-rw---- 1 root disk 8,  4 Nov 30 23:00 sda4
  brw-rw---- 1 root disk 8,  0 Nov 30 23:00 sda
  可以看到/dev/sdb1,/dev/oracleasm/disks/VOL1两个设备的设备号8,17是相同的,说明它们是一一对应的关系.
  通过oracleasm命令也可以查询出这种对应关系.
  [root@ocmdb1 dev]# oracleasm listdisks
  VOL1
  [root@ocmdb1 dev]# oracleasm querydisk VOL1
  Disk "VOL1" is a valid ASM disk
  [root@ocmdb1 dev]# oracleasm querydisk /dev/sdb1
  Device "/dev/sdb1" is marked an ASM disk with the label "VOL1"
  [root@ocmdb1 dev]# oracleasm querydisk -d VOL1
  Disk "VOL1" is a valid ASM disk on device [8, 17]
  [root@ocmdb1 dev]# oracleasm querydisk /dev/sda5
  Device "/dev/sda5" is not marked as an ASM disk ##/dev/sda5不是asm盘
  ---------------------------------
  自已做了一把,总结遇到的问题,以及查看网络和自己排查后的一些方法,记录并与大家分享。



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-624730-1-1.html 上篇帖子: sqlserver 看进程中的sql 下篇帖子: 【MySQL】加快sql导入
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表