Centos6.9安装ACFS
安装完oracle 11GR2的RAC后,使用asmca打开图形化界面后,发现Volumes和ASM Cluster File System两个选项卡不能用
原因是因为ACFS不支持CentOS
解决方法
1.查看ACFS是否支持当前操作系统
[grid@rac02 ~]$ acfsdriverstate -orahome $ORACLE_HOME supported
2.修改osds_acfslib.pm文件(RAC所有节点)
# cp -p osds_acfslib.pm osds_acfslib.pm.bak # vi osds_acfslib.pm ----------------------------------------------------------------------------- if ((defined($release)) && # Redhat or OEL if defined (($release =~ /^redhat-release/) || # straight RH ($release =~ /^enterprise-release/) || # Oracle Enterprise Linux ($release =~ /^oraclelinux-release/))) # Oracle Linux 修改为 if ((defined($release)) && # Redhat or OEL if defined (($release =~ /^redhat-release/) || # straight RH ($release =~ /^enterprise-release/) || # Oracle Enterprise Linux ($release =~ /^centos-release/) || # Centos Linux ($release =~ /^oraclelinux-release/))) # Oracle Linux -----------------------------------------------------------------------------
3.安装acfs(RAC所有节点)
# cd /grid/home/bin/ # ./acfsload start -s ---------------------------------------------------- ACFS-9129: ADVM/ACFS not installed ---------------------------------------------------- # ./acfsroot install # ./acfsload start -s # lsmod |grep oracle ---------------------------------------------------- oracleacfs 1990406 2 oracleadvm 250040 6 oracleoks 427672 2 oracleacfs,oracleadvm ----------------------------------------------------
4.添加ora.registry.acfs到ocr中(任一节点即可)
# /grid/home/bin/crsctl add type ora.registry.acfs.type -basetype ora.local_resource.type -file /grid/home/crs/template/registry.acfs.type # /grid/home/bin/crsctl add resource ora.registry.acfs -attr ACL=\'owner:root:rwx,pgrp:oinstall:r-x,other::r--\' -type ora.registry.acfs.type -f
# su - grid -c crs_stat | grep acfs
----------------------------------------------------
NAME=ora.registry.acfs
TYPE=ora.registry.acfs.type
----------------------------------------------------
#/sbin/acfsutil registr
5.创建Volumes
[grid@rac01 ~]$ export DISPLAY=10.206.132.253:0.0 $ asmca
6.创建ASM Cluster File System并挂载
两个节点创建目录
# mkdir /oggdata # chown -R oracle.oinstall /oggdata/
挂载
点击OK后报错
ASM Cluster File System creation on /dev/asm/ogg_vol-471 failed with the following message: mkfs.acfs: ACFS-01010: Volume already contains an ACFS file system. To reformat the volume, reissue mkfs.acfs with the -f option. mkfs.acfs: ACFS-01004: /dev/asm/ogg_vol-471 was not formatted.
此时点击Show Command,手动挂载
# /sbin/mkfs -t acfs /dev/asm/ogg_vol-471 # /sbin/acfsutil registry -a -f /dev/asm/ogg_vol-471 /oggdata 报错 ------------------------------------------------------------------------------------ [root@rac01 ~]# /sbin/mkfs -t acfs /dev/asm/ogg_vol-471 mkfs.acfs: version = 11.2.0.4.0 mkfs.acfs: on-disk version = 39.0 mkfs.acfs: volume = /dev/asm/ogg_vol-471 mkfs.acfs: ACFS-01010: Volume already contains an ACFS file system. To reformat the volume, reissue mkfs.acfs with the -f option. mkfs.acfs: ACFS-01004: /dev/asm/ogg_vol-471 was not formatted. [root@rac01 ~]# /sbin/acfsutil registry -a -f /dev/asm/ogg_vol-471 /oggdata acfsutil registry: ACFS-03161: Device : /dev/asm/ogg_vol-471 : Mount Point : /oggdata already exis ------------------------------------------------------------------------------------
已经有文件系统且注册,此时直接挂载即可(两个节点都要执行)
# mount.acfs -o all
查看挂载目录信息
# /sbin/acfsutil info fs
7.重启系统,查看是否会挂载
# su - grid $ crsctl status resource -t ----------------------------------------------------------------------------- ora.registry.acfs ONLINE OFFLINE rac01 ONLINE OFFLINE rac02 ------------------------------------------------------------------------------
可以看到重启后,acfs为offline状态并且目录页没有挂载
解决方法
两个节点开启acfs # cd /grid/home/bin # ./acfsload start -s 任一一个节点开启资源 # ./crsctl start res ora.registry.acfs
根据以上的实践,我们需要acfs加入开机自启动(两个节点)
# vi /etc/init.d/acfsload ------------------------------------------------------------------------- #!/bin/sh # description: Load Oracle ASM volume driver on system startup ORACLE_HOME=/grid/home export ORACLE_HOME $ORACLE_HOME/bin/acfsload start -s ------------------------------------------------------------------------- # chmod u+x /etc/rc.d/init.d/acfsload # chkconfig acfsload on
再次重启系统后,acfs资源自动启动,目录也自动挂载
参考:https://blog.csdn.net/shiyu1157758655/article/details/62215468