1. 공유 스토리지 생성

공유 스토리지 구성을 위해 고정 공간이 할당된 가상 디스크 6개를 추가로 생성합니다.

파일 이름용량타입용도비고

CRS1.vdi

1GBFixed / ShareableCRS 저장 영역공유(shareable) 디스크로 사용하기 위해서 Fixed Size로 생성합니다.
CRS2.vdi1GBFixed / Shareable
CRS3.vdi1GBFixed / Shareable
DATA.vdi30GBFixed / ShareableData 저장 영역
FRA.vdi20GBFixed / ShareableFast Recovery Area
RAW.vdi20GBFixed / ShareableRaw Device 영역

A) 가상 스토리지 파일 생성

공유 스토리지 가상 디스크 생성
vboxmanage createmedium --filename CRS1.vdi --size 1024 --format VDI --variant Fixed
vboxmanage createmedium --filename CRS2.vdi --size 1024 --format VDI --variant Fixed
vboxmanage createmedium --filename CRS3.vdi --size 1024 --format VDI --variant Fixed
vboxmanage createmedium --filename DATA.vdi --size 30720 --format VDI --variant Fixed
vboxmanage createmedium --filename FRA.vdi --size 20480 --format VDI --variant Fixed
vboxmanage createmedium --filename RAW.vdi --size 20480 --format VDI --variant Fixed
PS D:\VM> pwd

Path
----
D:\VM

PS D:\VM> vboxmanage createmedium --filename CRS1.vdi --size 1024 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 3a6327e8-0367-4edc-bb5b-591efe123e8d
PS D:\VM> vboxmanage createmedium --filename CRS2.vdi --size 1024 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 9d4524a2-5a06-478a-b733-81cd9889e59e
PS D:\VM> vboxmanage createmedium --filename CRS3.vdi --size 1024 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: a9d5a021-b91a-4c43-b7d5-2136bf447e83
PS D:\VM> vboxmanage createmedium --filename DATA.vdi --size 30720 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 94a0fac2-2040-42ec-9b7e-2fecc49bcf05
PS D:\VM> vboxmanage createmedium --filename FRA.vdi --size 20480 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 8f120938-511d-42b1-b15b-dfd4e20218e9
PS D:\VM> vboxmanage createmedium --filename RAW.vdi --size 20480 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 4f20eb5e-79a3-42e3-8b35-c9c9983b9040

Host 컴퓨터에서 VM에 연결시킬 공유 디스크를 생성합니다.

디스크는 2개의 노드에서 공유할 것이므로, 반드시 Fixed 모드로 디스크 공간이 사전에 할당되도록 생성해야 합니다.

B) 스토리지 파일 공유 설정

가상 디스크 타입 변경
vboxmanage modifymedium CRS1.vdi --type shareable
vboxmanage modifymedium CRS2.vdi --type shareable
vboxmanage modifymedium CRS3.vdi --type shareable
vboxmanage modifymedium DATA.vdi --type shareable
vboxmanage modifymedium FRA.vdi --type shareable
vboxmanage modifymedium RAW.vdi --type shareable
PS D:\VM> vboxmanage modifymedium CRS1.vdi --type shareable
PS D:\VM> vboxmanage modifymedium CRS2.vdi --type shareable
PS D:\VM> vboxmanage modifymedium CRS3.vdi --type shareable
PS D:\VM> vboxmanage modifymedium DATA.vdi --type shareable
PS D:\VM> vboxmanage modifymedium FRA.vdi --type shareable
PS D:\VM> vboxmanage modifymedium RAW.vdi --type shareable

생성된 디스크들은 모두 shareable 디스크로 속성 변경이 필요합니다.

VirtualBox의 GUI 툴을 사용하여 변경할 수도 있습니다.

C) VM에 스토리지 연결

정지된 1번 노드의 설정 모드로 들어가서 디스크 파일을 추가합니다.

SATA 콘트롤러의 오른쪽에 하드디스크 모양의 아이콘을 클릭합니다

vboxmanage 명령으로 이미 생성된 디스크 파일을 추가할 것이므로 <기존 디스크 선택하기>를 클릭합니다.

Not Attatched에 등록된 디스크 목록에서 "CRS1.vdi"를 선택한 후 <선택>을 클릭합니다.

만약 생성된 디스크 이미지가 목록에 없다면 <추가> 아이콘을 클릭한 후에 디스크 이미지를 찾아서 추가하면 됩니다.

정상적으로 스토리지가 추가된 것을 확인할 수 있습니다.

다른 공유 디스크들도 같은 방법으로 추가해줍니다.

나머지 디스크 파일 모두 순서에 맞게 SATA 컨트롤러에 등록시켜줍니다.

반드시 동일한 순서대로 다른 노드에도 등록시켜야 합니다.

2. 공유 스토리지 환경 구성

A) 디스크 파티셔닝

스토리지 파티션 생성
ls /dev/sd*
fdisk /dev/sdb  ### "n", "p", "1", "엔터", "엔터", "w" 입력
fdisk /dev/sdc  ### "n", "p", "1", "엔터", "엔터", "w" 입력
fdisk /dev/sdd  ### "n", "p", "1", "엔터", "엔터", "w" 입력
fdisk /dev/sde  ### "n", "p", "1", "엔터", "엔터", "w" 입력
fdisk /dev/sdf  ### "n", "p", "1", "엔터", "엔터", "w" 입력
fdisk /dev/sdg  ### "n", "p", "1", "엔터", "+15G" 입력, "n", "p", "2", "엔터", "엔터", "w" 입력
ls /dev/sd*
[root@rac1 ~]# ls /dev/sd*
/dev/sda   /dev/sda2  /dev/sdc  /dev/sde  /dev/sdg
/dev/sda1  /dev/sdb   /dev/sdd  /dev/sdf

[root@rac1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xcc8fe296.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-2097151, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
Using default value 2097151
Partition 1 of type Linux and of size 1023 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@rac1 ~]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x721e08dc.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-2097151, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
Using default value 2097151
Partition 1 of type Linux and of size 1023 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@rac1 ~]# fdisk /dev/sdd
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x4f1e2a87.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-2097151, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
Using default value 2097151
Partition 1 of type Linux and of size 1023 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@rac1 ~]# fdisk /dev/sde
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x02219e92.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62914559, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-62914559, default 62914559):
Using default value 62914559
Partition 1 of type Linux and of size 30 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@rac1 ~]# fdisk /dev/sdf
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xecdb8b19.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 ~]# fdisk /dev/sdg
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x6f157778.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +15G
Partition 1 of type Linux and of size 15 GiB is set

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (2-4, default 2): 2
First sector (31459328-41943039, default 31459328):
Using default value 31459328
Last sector, +sectors or +size{K,M,G} (31459328-41943039, default 41943039):
Using default value 41943039
Partition 2 of type Linux and of size 5 GiB is set

Command (m for help): p

Disk /dev/sdg: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6f157778

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1            2048    31459327    15728640   83  Linux
/dev/sdg2        31459328    41943039     5241856   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@rac1 ~]# ls /dev/sd*
/dev/sda   /dev/sdb   /dev/sdc1  /dev/sde   /dev/sdf1  /dev/sdg2
/dev/sda1  /dev/sdb1  /dev/sdd   /dev/sde1  /dev/sdg
/dev/sda2  /dev/sdc   /dev/sdd1  /dev/sdf   /dev/sdg1

VM에 연결된 디스크에 fdisk 명령어로 파티션 분할 작업을 수행 합니다.

/dev/sdb에서부터 /dev/sdf까지는 하나의 파티션으로 분할하여 ASM 스토리지로 사용할 것입니다.

/dev/sdg 디스크는 15GB와 5GB의 파티셔으로 분할하여, 15GB는 raw device 영역으로 사용하고 나머지 5GB는 OCFS2으로 클러스터링하여 FRA 영역으로 사용합니다.

B) ASM 구성

ASM 환경 설정
oracleasm configure -i
oracleasm init
oracleasm status
oracleasm configure
[root@rac1 ~]# oracleasm configure -i
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 <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
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

[root@rac1 ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

[root@rac1 ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes

[root@rac1 ~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=oracle
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_SCAN_DIRECTORIES=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"

ASM library에 대한 추가적인 환경 설정(사용자, 그룹, 부팅시 활성화, 부팅시 스캔 여부)을 수행하고 적용 여부를 검증합니다.

ASM 디스크 생성 및 확인
oracleasm createdisk CRS1 /dev/sdb1
oracleasm createdisk CRS2 /dev/sdc1
oracleasm createdisk CRS3 /dev/sdd1
oracleasm createdisk DATA /dev/sde1
oracleasm createdisk FRA /dev/sdf1
oracleasm scandisks
oracleasm listdisks
[root@rac1 ~]# oracleasm createdisk CRS1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@rac1 ~]# oracleasm createdisk CRS2 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@rac1 ~]# oracleasm createdisk CRS3 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@rac1 ~]# oracleasm createdisk DATA /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@rac1 ~]# oracleasm createdisk FRA /dev/sdf1
Writing disk header: done
Instantiating disk: done

[root@rac1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...

[root@rac1 ~]# oracleasm listdisks
CRS1
CRS2
CRS3
DATA
FRA

VM에 마운트된 디스크를 각각 ASM Disk로 할당해줍니다.

순서대로 마운트가 되었다면, 디바이스 명의 알파벳 순으로 ASM 디스크를 생성하면 됩니다.

C) Raw Device 구성

Raw Device 볼륨 그룹 생성
pvcreate /dev/sdg1
pvdisplay /dev/sdg1
vgcreate rawvg /dev/sdg1
vgdisplay rawvg
[root@rac1 ~]# pvcreate /dev/sdg1
  Physical volume "/dev/sdg1" successfully created.
  
[root@rac1 ~]# pvdisplay /dev/sdg1
  "/dev/sdg1" is a new physical volume of "15.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdg1
  VG Name
  PV Size               15.00 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               30eYro-iXra-PEwU-ncIe-oo0D-ijud-8RBXmu

[root@rac1 ~]# vgcreate rawvg /dev/sdg1
  Volume group "rawvg" successfully created
  
[root@rac1 ~]# vgdisplay rawvg
  --- Volume group ---
  VG Name               rawvg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <15.00 GiB
  PE Size               4.00 MiB
  Total PE              3839
  Alloc PE / Size       0 / 0
  Free  PE / Size       3839 / <15.00 GiB
  VG UUID               Eqt7EF-d4Qt-DuQP-ChuW-Lceo-uG9r-X1DZ6t

Raw Device로 사용할 디스크의 물리 볼륨과 볼륨 그룹을 생성합니다.

Raw Device 논리 볼륨 생성
lvcreate -L 300M -n ocr01 rawvg
lvcreate -L 300M -n ocr02 rawvg
lvcreate -L 300M -n vote01 rawvg
lvcreate -L 300M -n vote02 rawvg
lvcreate -L 300M -n vote03 rawvg
lvcreate -L 2048M -n system rawvg
lvcreate -L 2048M -n sysaux rawvg
lvcreate -L 1024M -n users rawvg
lvcreate -L 700M -n temp rawvg
lvcreate -L 2048M -n undotbs1 rawvg
lvcreate -L 2048M -n undotbs2 rawvg
lvcreate -L 100M -n control01 rawvg
lvcreate -L 100M -n control02 rawvg
lvcreate -L 200M -n redo01 rawvg
lvcreate -L 200M -n redo02 rawvg
lvcreate -L 200M -n redo03 rawvg
lvcreate -L 200M -n redo04 rawvg
lvcreate -L 200M -n redo05 rawvg
lvcreate -L 200M -n redo06 rawvg
lvcreate -L 200M -n spfile rawvg
lvdisplay
[root@rac1 ~]# lvcreate -L 300M -n ocr01 rawvg
  Logical volume "ocr01" created.
  
[root@rac1 ~]# lvcreate -L 300M -n ocr02 rawvg
  Logical volume "ocr02" created.
  
[root@rac1 ~]# lvcreate -L 300M -n vote01 rawvg
  Logical volume "vote01" created.
  
[root@rac1 ~]# lvcreate -L 300M -n vote02 rawvg
  Logical volume "vote02" created.
  
[root@rac1 ~]# lvcreate -L 300M -n vote03 rawvg
  Logical volume "vote03" created.
  
[root@rac1 ~]# lvcreate -L 2048M -n system rawvg
  Logical volume "system" created.
  
[root@rac1 ~]# lvcreate -L 2048M -n sysaux rawvg
  Logical volume "sysaux" created.
  
[root@rac1 ~]# lvcreate -L 1024M -n users rawvg
  Logical volume "users" created.
  
[root@rac1 ~]# lvcreate -L 700M -n temp rawvg
  Logical volume "temp" created.
  
[root@rac1 ~]# lvcreate -L 2048M -n undotbs1 rawvg
  Logical volume "undotbs1" created.
  
[root@rac1 ~]# lvcreate -L 2048M -n undotbs2 rawvg
  Logical volume "undotbs2" created.
  
[root@rac1 ~]# lvcreate -L 100M -n control01 rawvg
  Logical volume "control01" created.
  
[root@rac1 ~]# lvcreate -L 100M -n control02 rawvg
  Logical volume "control02" created.
  
[root@rac1 ~]# lvcreate -L 200M -n redo01 rawvg
  Logical volume "redo01" created.
  
[root@rac1 ~]# lvcreate -L 200M -n redo02 rawvg
  Logical volume "redo02" created.
  
[root@rac1 ~]# lvcreate -L 200M -n redo03 rawvg
  Logical volume "redo03" created.
  
[root@rac1 ~]# lvcreate -L 200M -n redo04 rawvg
  Logical volume "redo04" created.
  
[root@rac1 ~]# lvcreate -L 200M -n redo05 rawvg
  Logical volume "redo05" created.
  
[root@rac1 ~]# lvcreate -L 200M -n redo06 rawvg
  Logical volume "redo06" created.
  
[root@rac1 ~]# lvcreate -L 200M -n spfile rawvg
  Logical volume "spfile" created.

[root@rac1 ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/rawvg/ocr01
  LV Name                ocr01
  VG Name                rawvg
  LV UUID                VP12OH-WsGO-nuQc-3KGr-0sIl-q8Hj-QZ0zL1
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                300.00 MiB
  Current LE             75
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:2

  --- Logical volume ---
  LV Path                /dev/rawvg/ocr02
  LV Name                ocr02
  VG Name                rawvg
  LV UUID                2nMgYm-Et4K-ODEK-WXM9-c5u7-ZP3W-zxEjxN
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                300.00 MiB
  Current LE             75
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:3

  --- Logical volume ---
  LV Path                /dev/rawvg/vote01
  LV Name                vote01
  VG Name                rawvg
  LV UUID                OuYYAj-yANF-kSxa-X92S-6WHt-2s9Z-sihzqr
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                300.00 MiB
  Current LE             75
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:4

  --- Logical volume ---
  LV Path                /dev/rawvg/vote02
  LV Name                vote02
  VG Name                rawvg
  LV UUID                by0V2t-L14c-GTuC-6eeA-lm9g-Ikiv-YabeRA
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                300.00 MiB
  Current LE             75
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:5

  --- Logical volume ---
  LV Path                /dev/rawvg/vote03
  LV Name                vote03
  VG Name                rawvg
  LV UUID                kBx6Wo-h8a0-ETtq-FbIV-5dat-84rI-uTKv2L
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                300.00 MiB
  Current LE             75
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:6

  --- Logical volume ---
  LV Path                /dev/rawvg/system
  LV Name                system
  VG Name                rawvg
  LV UUID                m0x6bB-bEzR-qgDO-DgnQ-OMDO-y3Td-0sxnGh
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                2.00 GiB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:7

  --- Logical volume ---
  LV Path                /dev/rawvg/sysaux
  LV Name                sysaux
  VG Name                rawvg
  LV UUID                KKgx8r-f1kl-su3S-K3GI-h2kr-dsnZ-nZPQqa
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                2.00 GiB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:8

  --- Logical volume ---
  LV Path                /dev/rawvg/users
  LV Name                users
  VG Name                rawvg
  LV UUID                FSGR2q-0MZZ-rFdR-5VSD-KNCu-ujLb-zmha2D
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:9

  --- Logical volume ---
  LV Path                /dev/rawvg/temp
  LV Name                temp
  VG Name                rawvg
  LV UUID                qntMvR-9Dm0-dtRv-4azP-2f9R-hR7e-Dsw0g5
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:56 +0900
  LV Status              available
  # open                 0
  LV Size                700.00 MiB
  Current LE             175
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:10

  --- Logical volume ---
  LV Path                /dev/rawvg/undotbs1
  LV Name                undotbs1
  VG Name                rawvg
  LV UUID                srl0yr-gufu-Byf3-zgdG-Wwr6-oIsv-5hTK9u
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                2.00 GiB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:11

  --- Logical volume ---
  LV Path                /dev/rawvg/undotbs2
  LV Name                undotbs2
  VG Name                rawvg
  LV UUID                TCK1xl-ZvXs-2bRT-PZWI-isqV-Ei73-AAv152
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                2.00 GiB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:12

  --- Logical volume ---
  LV Path                /dev/rawvg/control01
  LV Name                control01
  VG Name                rawvg
  LV UUID                2uw94p-td32-23yd-li8G-y3xE-bnJg-dpuxJe
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                100.00 MiB
  Current LE             25
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:13

  --- Logical volume ---
  LV Path                /dev/rawvg/control02
  LV Name                control02
  VG Name                rawvg
  LV UUID                GbO1Iq-EdGK-gDXz-O2em-PSLV-s9rm-k2Gy3Y
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                100.00 MiB
  Current LE             25
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:14

  --- Logical volume ---
  LV Path                /dev/rawvg/redo01
  LV Name                redo01
  VG Name                rawvg
  LV UUID                lWipjE-Ted7-JF33-tDNe-BKUX-FnNc-5Garlr
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                200.00 MiB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:15

  --- Logical volume ---
  LV Path                /dev/rawvg/redo02
  LV Name                redo02
  VG Name                rawvg
  LV UUID                iWGac1-yfbz-vWy4-jZ0C-7DFa-joq0-6OF03E
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                200.00 MiB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:16

  --- Logical volume ---
  LV Path                /dev/rawvg/redo03
  LV Name                redo03
  VG Name                rawvg
  LV UUID                4WVBxD-gXs6-kkQD-MK8j-ApUF-kJFc-NbOcWz
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                200.00 MiB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:17

  --- Logical volume ---
  LV Path                /dev/rawvg/redo04
  LV Name                redo04
  VG Name                rawvg
  LV UUID                TP8pev-sQ7z-UwlH-Wte3-96H7-DHvB-c0DHgK
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                200.00 MiB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:18

  --- Logical volume ---
  LV Path                /dev/rawvg/redo05
  LV Name                redo05
  VG Name                rawvg
  LV UUID                SxhN6y-KNHF-OiOF-ENfW-ud4Q-Bc0o-Jh2Fah
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                200.00 MiB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:19

  --- Logical volume ---
  LV Path                /dev/rawvg/redo06
  LV Name                redo06
  VG Name                rawvg
  LV UUID                TXeS5L-qPEk-RlBf-VHo6-Ab5F-buiY-HvhDNi
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                200.00 MiB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:20

  --- Logical volume ---
  LV Path                /dev/rawvg/spfile
  LV Name                spfile
  VG Name                rawvg
  LV UUID                O1d4Ck-b15L-ORZx-EI4Z-RhA4-hl1B-9f3uag
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 13:24:57 +0900
  LV Status              available
  # open                 0
  LV Size                200.00 MiB
  Current LE             50
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:21

  --- Logical volume ---
  LV Path                /dev/ol/swap
  LV Name                swap
  VG Name                ol
  LV UUID                E6X06I-63Al-dbJo-i53I-Fk7V-uR90-uCLpBf
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 09:25:27 +0900
  LV Status              available
  # open                 2
  LV Size                10.00 GiB
  Current LE             2560
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:1

  --- Logical volume ---
  LV Path                /dev/ol/root
  LV Name                root
  VG Name                ol
  LV UUID                d1uCT2-Z8h7-HVtm-3mQ8-OWpX-WewL-a8zJQr
  LV Write Access        read/write
  LV Creation host, time rac1, 2020-04-13 09:25:27 +0900
  LV Status              available
  # open                 1
  LV Size                <89.51 GiB
  Current LE             22914
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           249:0

데이터 파일이나 로그 파일, 컨트롤 파일 등에 사용할 크기별로 논리 볼륨을 할당합니다.

개별 논리 볼륨을 Raw Device로 할당
raw /dev/raw/raw1 /dev/rawvg/ocr01
raw /dev/raw/raw2 /dev/rawvg/ocr02
raw /dev/raw/raw3 /dev/rawvg/vote01
raw /dev/raw/raw4 /dev/rawvg/vote02
raw /dev/raw/raw5 /dev/rawvg/vote03
raw /dev/raw/raw6 /dev/rawvg/system
raw /dev/raw/raw7 /dev/rawvg/sysaux
raw /dev/raw/raw8 /dev/rawvg/users
raw /dev/raw/raw9 /dev/rawvg/temp
raw /dev/raw/raw10 /dev/rawvg/undotbs1
raw /dev/raw/raw11 /dev/rawvg/undotbs2
raw /dev/raw/raw12 /dev/rawvg/control01
raw /dev/raw/raw13 /dev/rawvg/control02
raw /dev/raw/raw14 /dev/rawvg/redo01
raw /dev/raw/raw15 /dev/rawvg/redo02
raw /dev/raw/raw16 /dev/rawvg/redo03
raw /dev/raw/raw17 /dev/rawvg/redo04
raw /dev/raw/raw18 /dev/rawvg/redo05
raw /dev/raw/raw19 /dev/rawvg/redo06
raw /dev/raw/raw20 /dev/rawvg/spfile
raw -qa
ls -l /dev/raw
[root@rac1 ~]# raw /dev/raw/raw1 /dev/rawvg/ocr01
/dev/raw/raw1:  bound to major 249, minor 2

[root@rac1 ~]# raw /dev/raw/raw2 /dev/rawvg/ocr02
/dev/raw/raw2:  bound to major 249, minor 3

[root@rac1 ~]# raw /dev/raw/raw3 /dev/rawvg/vote01
/dev/raw/raw3:  bound to major 249, minor 4

[root@rac1 ~]# raw /dev/raw/raw4 /dev/rawvg/vote02
/dev/raw/raw4:  bound to major 249, minor 5

[root@rac1 ~]# raw /dev/raw/raw5 /dev/rawvg/vote03
/dev/raw/raw5:  bound to major 249, minor 6

[root@rac1 ~]# raw /dev/raw/raw6 /dev/rawvg/system
/dev/raw/raw6:  bound to major 249, minor 7

[root@rac1 ~]# raw /dev/raw/raw7 /dev/rawvg/sysaux
/dev/raw/raw7:  bound to major 249, minor 8

[root@rac1 ~]# raw /dev/raw/raw8 /dev/rawvg/users
/dev/raw/raw8:  bound to major 249, minor 9

[root@rac1 ~]# raw /dev/raw/raw9 /dev/rawvg/temp
/dev/raw/raw9:  bound to major 249, minor 10

[root@rac1 ~]# raw /dev/raw/raw10 /dev/rawvg/undotbs1
/dev/raw/raw10:  bound to major 249, minor 11

[root@rac1 ~]# raw /dev/raw/raw11 /dev/rawvg/undotbs2
/dev/raw/raw11:  bound to major 249, minor 12

[root@rac1 ~]# raw /dev/raw/raw12 /dev/rawvg/control01
/dev/raw/raw12:  bound to major 249, minor 13

[root@rac1 ~]# raw /dev/raw/raw13 /dev/rawvg/control02
/dev/raw/raw13:  bound to major 249, minor 14

[root@rac1 ~]# raw /dev/raw/raw14 /dev/rawvg/redo01
/dev/raw/raw14:  bound to major 249, minor 15

[root@rac1 ~]# raw /dev/raw/raw15 /dev/rawvg/redo02
/dev/raw/raw15:  bound to major 249, minor 16

[root@rac1 ~]# raw /dev/raw/raw16 /dev/rawvg/redo03
/dev/raw/raw16:  bound to major 249, minor 17

[root@rac1 ~]# raw /dev/raw/raw17 /dev/rawvg/redo04
/dev/raw/raw17:  bound to major 249, minor 18

[root@rac1 ~]# raw /dev/raw/raw18 /dev/rawvg/redo05
/dev/raw/raw18:  bound to major 249, minor 19

[root@rac1 ~]# raw /dev/raw/raw19 /dev/rawvg/redo06
/dev/raw/raw19:  bound to major 249, minor 20

[root@rac1 ~]# raw /dev/raw/raw20 /dev/rawvg/spfile
/dev/raw/raw20:  bound to major 249, minor 21

[root@rac1 ~]# raw -qa
/dev/raw/raw1:  bound to major 249, minor 2
/dev/raw/raw2:  bound to major 249, minor 3
/dev/raw/raw3:  bound to major 249, minor 4
/dev/raw/raw4:  bound to major 249, minor 5
/dev/raw/raw5:  bound to major 249, minor 6
/dev/raw/raw6:  bound to major 249, minor 7
/dev/raw/raw7:  bound to major 249, minor 8
/dev/raw/raw8:  bound to major 249, minor 9
/dev/raw/raw9:  bound to major 249, minor 10
/dev/raw/raw10:  bound to major 249, minor 11
/dev/raw/raw11:  bound to major 249, minor 12
/dev/raw/raw12:  bound to major 249, minor 13
/dev/raw/raw13:  bound to major 249, minor 14
/dev/raw/raw14:  bound to major 249, minor 15
/dev/raw/raw15:  bound to major 249, minor 16
/dev/raw/raw16:  bound to major 249, minor 17
/dev/raw/raw17:  bound to major 249, minor 18
/dev/raw/raw18:  bound to major 249, minor 19
/dev/raw/raw19:  bound to major 249, minor 20

[root@rac1 ~]# ls -l /dev/raw
합계 0
crw-rw----. 1 oracle dba 162,  0  4월 13 14:42 rawctl
crw-rw----. 1 oracle dba 162,  1  4월 13 14:42 raw1
crw-rw----. 1 oracle dba 162,  2  4월 13 14:42 raw2
crw-rw----. 1 oracle dba 162,  3  4월 13 14:42 raw3
crw-rw----. 1 oracle dba 162,  4  4월 13 14:42 raw4
crw-rw----. 1 oracle dba 162,  5  4월 13 14:42 raw5
crw-rw----. 1 oracle dba 162,  6  4월 13 14:42 raw6
crw-rw----. 1 oracle dba 162,  7  4월 13 14:42 raw7
crw-rw----. 1 oracle dba 162,  8  4월 13 14:42 raw8
crw-rw----. 1 oracle dba 162,  9  4월 13 14:42 raw9
crw-rw----. 1 oracle dba 162, 10  4월 13 14:42 raw10
crw-rw----. 1 oracle dba 162, 11  4월 13 14:42 raw11
crw-rw----. 1 oracle dba 162, 12  4월 13 14:42 raw12
crw-rw----. 1 oracle dba 162, 13  4월 13 14:42 raw13
crw-rw----. 1 oracle dba 162, 14  4월 13 14:42 raw14
crw-rw----. 1 oracle dba 162, 15  4월 13 14:42 raw15
crw-rw----. 1 oracle dba 162, 16  4월 13 14:42 raw16
crw-rw----. 1 oracle dba 162, 17  4월 13 14:42 raw17
crw-rw----. 1 oracle dba 162, 18  4월 13 14:42 raw18
crw-rw----. 1 oracle dba 162, 19  4월 13 14:42 raw19
crw-rw----. 1 oracle dba 162, 20  4월 13 14:42 raw20

생성된 논리 볼륨을 Raw Device에 할당합니다.

vi /etc/udev/rules.d/60-raw.rules 로 규칙 생성
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="ocr01", RUN+="/bin/raw /dev/raw/raw1 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="ocr02", RUN+="/bin/raw /dev/raw/raw2 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="vote01", RUN+="/bin/raw /dev/raw/raw3 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="vote02", RUN+="/bin/raw /dev/raw/raw4 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="vote03", RUN+="/bin/raw /dev/raw/raw5 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="system", RUN+="/bin/raw /dev/raw/raw6 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="sysaux", RUN+="/bin/raw /dev/raw/raw7 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="users", RUN+="/bin/raw /dev/raw/raw8 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="temp", RUN+="/bin/raw /dev/raw/raw9 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="undotbs1", RUN+="/bin/raw /dev/raw/raw10 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="undotbs2", RUN+="/bin/raw /dev/raw/raw11 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="control01", RUN+="/bin/raw /dev/raw/raw12 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="control02", RUN+="/bin/raw /dev/raw/raw13 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo01", RUN+="/bin/raw /dev/raw/raw14 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo02", RUN+="/bin/raw /dev/raw/raw15 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo03", RUN+="/bin/raw /dev/raw/raw16 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo04", RUN+="/bin/raw /dev/raw/raw17 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo05", RUN+="/bin/raw /dev/raw/raw18 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo06", RUN+="/bin/raw /dev/raw/raw19 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="spfile", RUN+="/bin/raw /dev/raw/raw20 %N"
ACTION=="add", KERNEL=="raw*", OWNER=="oracle", GROUP=="dba", MODE=="0660"
[root@rac1 ~]# cat > /etc/udev/rules.d/60-raw.rules
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="ocr01", RUN+="/bin/raw /dev/raw/raw1 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="ocr02", RUN+="/bin/raw /dev/raw/raw2 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="vote01", RUN+="/bin/raw /dev/raw/raw3 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="vote02", RUN+="/bin/raw /dev/raw/raw4 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="vote03", RUN+="/bin/raw /dev/raw/raw5 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="system", RUN+="/bin/raw /dev/raw/raw6 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="sysaux", RUN+="/bin/raw /dev/raw/raw7 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="users", RUN+="/bin/raw /dev/raw/raw8 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="temp", RUN+="/bin/raw /dev/raw/raw9 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="undotbs1", RUN+="/bin/raw /dev/raw/raw10 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="undotbs2", RUN+="/bin/raw /dev/raw/raw11 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="control01", RUN+="/bin/raw /dev/raw/raw12 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="control02", RUN+="/bin/raw /dev/raw/raw13 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo01", RUN+="/bin/raw /dev/raw/raw14 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo02", RUN+="/bin/raw /dev/raw/raw15 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo03", RUN+="/bin/raw /dev/raw/raw16 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo04", RUN+="/bin/raw /dev/raw/raw17 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo05", RUN+="/bin/raw /dev/raw/raw18 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="redo06", RUN+="/bin/raw /dev/raw/raw19 %N"
ENV{DM_VG_NAME}=="rawvg", ENV{DM_LV_NAME}=="spfile", RUN+="/bin/raw /dev/raw/raw20 %N"
ACTION=="add", KERNEL=="raw*", OWNER=="oracle", GROUP=="dba", MODE=="0660"
^C

서버를 재부팅 시에 논리 볼륨을 raw device에 할당할 수 있도록 rule 파일을 생성하고, 소유자와 그룹 설정을 추가합니다.

Raw Device 규칙을 적용
udevadm control --reload-rules
udevadm trigger --type=devices --action=change
[root@rac1 ~]# udevadm control --reload-rules

[root@rac1 ~]# udevadm trigger --type=devices --action=change

생성된 rule을 적용합니다.

D) OCFS2 구성

OCFS2 클러스터 정보 등록
o2cb add-cluster <클러스터명>
o2cb add-node <클러스터명> <node1명> --ip <node1 사설IP>
o2cb add-node <클러스터명> <node2명> --ip <node2 사설IP>
cat /etc/ocfs2/cluster.conf
[root@rac1 ~]# o2cb add-cluster raccluster

[root@rac1 ~]# o2cb add-node raccluster rac1 --ip 10.0.5.101

[root@rac1 ~]# o2cb add-node raccluster rac2 --ip 10.0.5.102

[root@rac1 ~]# cat /etc/ocfs2/cluster.conf
cluster:
        heartbeat_mode = local
        node_count = 2
        name = raccluster

node:
        number = 0
        cluster = raccluster
        ip_port = 7777
        ip_address = 10.0.5.101
        name = rac1

node:
        number = 1
        cluster = raccluster
        ip_port = 7777
        ip_address = 10.0.5.102
        name = rac2

Archive Log를 저장하기 위해서는 파일을 저장할 수 있는 공유 영역이 있어야 하며, 이를 위해서 OCFS2를 구성해야 합니다.

각각의 노드에 파일로 저장할 경우, 파일을 공유할 수 없어서 노드 장애로 인한 복구가 어려울 수 있습니다.

먼저 클러스터의 이름과 연결될 노드 정보를 저장합니다.

OCFS2 환경 설정 및 활성화
/sbin/o2cb.init configure	# "y" 입력, "엔터" 입력, <클러스터명> 입력, "엔터" 입력, "엔터" 입력, "엔터" 입력, "엔터" 입력
/sbin/o2cb.init status
systemctl enable o2cb
systemctl enable ocfs2
[root@rac1 ~]# /sbin/o2cb.init configure
Configuring the O2CB driver.

This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot.  The current values will be shown in brackets ('[]').  Hitting
<ENTER> without typing an answer will keep that current value.  Ctrl-C
will abort.

Load O2CB driver on boot (y/n) [n]: y
Cluster stack backing O2CB [o2cb]:
Cluster to start on boot (Enter "none" to clear) [ocfs2]: raccluster
Specify heartbeat dead threshold (>=7) [31]:
Specify network idle timeout in ms (>=5000) [30000]:
Specify network keepalive delay in ms (>=1000) [2000]:
Specify network reconnect delay in ms (>=2000) [2000]:
Writing O2CB configuration: OK
checking debugfs...
Loading stack plugin "o2cb": OK
Loading filesystem "ocfs2_dlmfs": OK
Creating directory '/dlm': OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Setting cluster stack "o2cb": OK
Registering O2CB cluster "raccluster": OK
Setting O2CB cluster timeouts : OK

[root@rac1 ~]# /sbin/o2cb.init status
Driver for "configfs": Loaded
Filesystem "configfs": Mounted
Stack glue driver: Loaded
Stack plugin "o2cb": Loaded
Driver for "ocfs2_dlmfs": Loaded
Filesystem "ocfs2_dlmfs": Mounted
Checking O2CB cluster "raccluster": Online
  Heartbeat dead threshold: 31
  Network idle timeout: 30000
  Network keepalive delay: 2000
  Network reconnect delay: 2000
  Heartbeat mode: Local
Checking O2CB heartbeat: Not active
Debug file system at /sys/kernel/debug: mounted

[root@rac1 ~]# systemctl enable o2cb
Created symlink from /etc/systemd/system/multi-user.target.wants/o2cb.service to /usr/lib/systemd/system/o2cb.service.

[root@rac1 ~]# systemctl enable ocfs2
Created symlink from /etc/systemd/system/multi-user.target.wants/ocfs2.service to /usr/lib/systemd/system/ocfs2.service.

OCFS2를 사용하기 위한 환경 설정과 서비스 활성화를 수행합니다.

vi /etc/sysctl.conf 로 커널 파라미터 추가
# Define panic and panic_on_oops for cluster operation
kernel.panic = 30
kernel.panic_on_oops = 1

추가적으로 필요한 커널 파라미터를 /etc/sysctl.conf에 추가합니다.

마운트 경로 및 OCFS2 영역 생성
mkdir /FRA
mkfs.ocfs2 -L "fra" /dev/sdg2
[root@rac1 ~]# mkdir /FRA

[root@rac1 ~]# mkfs.ocfs2 -L "fra" /dev/sdg2
mkfs.ocfs2 1.8.6
Cluster stack: classic o2cb
Label: fra
Features: sparse extended-slotmap backup-super unwritten inline-data strict-journal-super xattr indexed-dirs refcount discontig-bg
Block size: 4096 (12 bits)
Cluster size: 4096 (12 bits)
Volume size: 5367660544 (1310464 clusters) (1310464 blocks)
Cluster groups: 41 (tail covers 20224 clusters, rest cover 32256 clusters)
Extent allocator size: 4194304 (1 groups)
Journal size: 67108864
Node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 2 block(s)
Formatting Journals: done
Growing extent allocator: done
Formatting slot map: done
Formatting quota files: done
Writing lost+found: done
mkfs.ocfs2 successful

OCFS2 영역을 마운트할 경로를 생성하고, 공유할 디스크 영역에 대한 포맷을 수행합니다.

vi /etc/fstab 으로 마운트 정보 저장
/dev/sdg2               /FRA            ocfs2   _netdev,defaults        0 0

포맷한 영역이 공유 경로에 마운트될 수 있도록 /etc/fstab에 정보를 저장합니다.

vi /etc/rc.d/rc.local 로 소유자 및 권한 설정
chown -R oracle:dba /FRA
chmod -R 770 /FRA

OCFS2 영역의 소유자와 권한 부여 작업을  /etc/rc.d/rc.local에 저장하여 재기동시에 설정이 유지될 수 있도록 합니다.

부팅시 자동 수행 활성화
chmod +x /etc/rc.d/rc.local
[root@rac1 ~]# chmod +x /etc/rc.d/rc.local

/etc/rc.d/rc.local 파일에 실행 모드를 추가하여 재기동시 작업이 수행되도록 활성화시킵니다.

  • 레이블 없음