• 配置Oracle ACFS集群文件系统


    配置Oracle ACFS集群文件系统                2012-07-10 10:18:39

    标签:asm acfs
    版权声明:原创作品,谢绝转载!否则将追究法律责任。           

    首先来看下,神马是ACFS,请看oracle官方给出的定义: Oracle Automatic Storage Management Cluster File System (Oracle ACFS) is a multi-platform, scalable file system, and storage management technology that extends Oracle Automatic Storage Management (Oracle ASM) functionality to support customer files maintained outside of Oracle Database. Oracle ACFS supports many database and application files, including executables,database trace files, database alert logs, application reports, BFILEs, and configuration files. Other supported files are video, audio, text, images, engineering drawings, and other general-purpose application file data.

    大意是ACFS是一个支持多个平台,可扩展的,基于ASM的集群文件系统,可以用来存储数据库和各种应用的文件,包括数据库的trace文件,alert日志文件和配置文件等等,也可以用来存储视频,音频,文本,图片等文件!

    在这之前,集群文件系统使用过redhat的gfs,还有开源的ocfs2,gfs的感觉是配置太繁琐且复杂,因为是基于RHCS套件,所以很多功能对应单纯的集群文件系统来说显得有些冗余;ocfs2属于被放弃的孩子,目前已经停止开发了,不过胜在配置简单;ACFS在11g r2中推出,基于grid infrastructure,配置上也算容易,且在ASM的基础上进行发展,稳定性应该还是有保证的,下一步打算利用ACFS测试下rac环境下的golden gate复制!下面来介绍下11G RAC环境下ACFS的使用!

    一:查看acfs相关的服务是否正常

    1. [grid@rac1 ~]$ crs_stat -t -v ora.registry.acfs
    2. Name Type R/RA F/FT Target State Host
    3. ----------------------------------------------------------------------
    4. ora....ry.acfs ora....fs.type 0/5 0/ ONLINE ONLINE rac1
    5. [grid@rac1 ~]$ crs_stat -t -v ora.ACFS.dg
    6. Name Type R/RA F/FT Target State Host
    7. ----------------------------------------------------------------------
    8. ora.ACFS.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

    二:使用asmca图形化工具,在asm磁盘组中创建volume并格式化成ACFS文件系统

    1. [root@rac1 ~]# su - grid
    2. [grid@rac1 ~]$ !exp
    3. export DISPLAY=192.168.1.105:0
    4. [grid@rac1 ~]$ asmca

     

    三:查看两个节点是否均已成功挂载ACFS,并测试读写

    1. [grid@rac1 ~]$ df -h
    2. Filesystem Size Used Avail Use% Mounted on
    3. /dev/vda3 26G 14G 11G 58% /
    4. /dev/vda1 99M 12M 83M 13% /boot
    5. tmpfs 1.2G 787M 441M 65% /dev/shm
    6. /dev/asm/vol1-330 5.0G 75M 5.0G 2% /u01/app/grid/acfsmounts/acfs_vol1
    7. [grid@rac1 ~]$ ssh rac2 "df -h"
    8. Filesystem Size Used Avail Use% Mounted on
    9. /dev/vda3 26G 14G 10G 59% /
    10. /dev/vda1 99M 12M 83M 13% /boot
    11. tmpfs 1.2G 787M 441M 65% /dev/shm
    12. /dev/asm/vol1-330 5.0G 75M 5.0G 2% /u01/app/grid/acfsmounts/acfs_vol1
    13. [grid@rac1 ~]$ cd /u01/app/grid/acfsmounts/acfs_vol1
    14. [grid@rac1 acfs_vol1]$ ls
    15. lost+found
    16. drwx------ 2 root root 65536 Jul 9 09:24 lost+found
    17. [grid@rac1 acfs_vol1]$ cp /etc/passwd ./
    18. [grid@rac2 ~]$ cd /u01/app/grid/acfsmounts/acfs_vol1
    19. [grid@rac2 acfs_vol1]$ ls
    20. lost+found passwd
    21. [grid@rac2 acfs_vol1]$ head -1 passwd
    22. root:x:0:0:root:/root:/bin/bash

    四:在asmcmd命令行下面操作

    1. [grid@rac1 ~]$ echo $ORACLE_SID
    2. +ASM1
    3. [grid@rac1 ~]$ asmcmd
    4. ASMCMD> ls
    5. ACFS/
    6. CRS/
    7. DATA/
    8. FRA/
    9. ASMCMD> volcreate //查看帮助命令
    10. usage: volcreate -G diskgroup -s size [ --column number ] [ --width stripe_width ] [--redundancy {high|mirror|unprotected} ]
    11. [--primary {hot|cold}] [--secondary {hot|cold}] volume
    12. help: help volcreate
    13. ASMCMD> volcreate -G ACFS -s 5G vol2 //如果空间不足就会报这个错误
    14. ORA-15032: not all alterations performed
    15. ORA-15041: diskgroup "ACFS" space exhausted (DBD ERROR: OCIStmtExecute)
    16. ASMCMD> volcreate -G ACFS -s 4G vol2
    17. ASMCMD> volinfo -G ACFS vol2
    18. Diskgroup Name: ACFS
    19. Volume Name: VOL2
    20. Volume Device: /dev/asm/vol2-330
    21. State: ENABLED
    22. Size (MB): 4096
    23. Resize Unit (MB): 32
    24. Redundancy: UNPROT
    25. Stripe Columns: 4
    26. Stripe Width (K): 128
    27. Usage:
    28. Mountpath:
    29. ASMCMD> volinfo -G ACFS vol1
    30. Diskgroup Name: ACFS
    31. Volume Name: VOL1
    32. Volume Device: /dev/asm/vol1-330
    33. State: ENABLED
    34. Size (MB): 5120
    35. Resize Unit (MB): 32
    36. Redundancy: UNPROT
    37. Stripe Columns: 4
    38. Stripe Width (K): 128
    39. Usage: ACFS
    40. Mountpath: /u01/app/grid/acfsmounts/acfs_vol1
    41. [root@rac1 ~]# mkdir /vol2 (节点2创建相同的挂载点)
    42. [root@rac1 ~]# mkfs.acfs /dev/asm/vol2-330
    43. mkfs.acfs: version = 11.2.0.3.0
    44. mkfs.acfs: on-disk version = 39.0
    45. mkfs.acfs: volume = /dev/asm/vol2-330
    46. mkfs.acfs: volume size = 4294967296
    47. mkfs.acfs: Format complete.
    48. [root@rac1 ~]# mount -t acfs /dev/asm/vol2-330 /vol2/
    49. [root@rac1 ~]# df -h /vol2
    50. Filesystem Size Used Avail Use% Mounted on
    51. /dev/asm/vol2-330 4.0G 45M 4.0G 2% /vol2
    52. [root@rac1 ~]# acfsutil registry -a /dev/asm/vol2-330 /vol2/(注册后,节点2会自动挂载)
    53. acfsutil registry: mount point /vol2 successfully added to Oracle Registry
  • 相关阅读:
    css 媒体查询
    Centos7将/dev/mapper/centoshome磁盘空间转移到/dev/mapper/centosroot
    MySQL查看锁表的状态命令
    域控机器 共享文件目录无法用IP访问
    第一篇 川川
    用cmp,还是重载‘<’、‘>’、‘==’、‘!=’ 川川
    这几周在实现一个简单词法器的过程中所学的 川川
    Spring 自定义注解
    十大排序算法
    堆排序
  • 原文地址:https://www.cnblogs.com/weixun/p/3082698.html
Copyright © 2020-2023  润新知