1. 공유 스토리지 구성
공유 스토리지 구성을 위해 고정 공간이 할당된 가상 디스크 6개를 추가로 생성합니다.
파일 이름 | 용량 | 타입 | 용도 | 비고 |
---|---|---|---|---|
CRS1.vdi | 1GB | Fixed / Shareable | CRS 저장 영역 | 공유(shareable) 디스크로 사용하기 위해서 Fixed Size로 생성합니다. |
CRS2.vdi | 1GB | Fixed / Shareable | ||
CRS3.vdi | 1GB | Fixed / Shareable | ||
DATA.vdi | 30GB | Fixed / Shareable | Data 저장 영역 | |
FRA.vdi | 20GB | Fixed / Shareable | Fast Recovery Area |
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
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
Host 컴퓨터에서 VM에 연결시킬 CRS, MGMT, DATA와 FRA 디스크를 생성합니다.
디스크는 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
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
생성된 디스크들은 모두 shareable 디스크로 속성 변경이 필요합니다.
VirtualBox의 GUI 툴을 사용하여 변경할 수도 있습니다.
C) VM에 스토리지 연결
정지된 1번 노드의 설정 모드로 들어가서 디스크 파일을 추가합니다.
SATA 콘트롤러의 오른쪽에 하드디스크 모양의 아이콘을 클릭합니다
vboxmanage 명령으로 이미 생성된 디스크 파일을 추가할 것이므로 <기존 디스크 선택하기>를 클릭합니다.
Not Attatched에 등록된 디스크 목록에서 "CRS1.vdi"를 선택한 후 <선택>을 클릭합니다.
만약 생성된 디스크 이미지가 목록에 없다면 <추가> 아이콘을 클릭한 후에 디스크 이미지를 찾아서 추가하면 됩니다.
정상적으로 스토리지가 추가된 것을 확인할 수 있습니다.
다른 공유 디스크들도 같은 방법으로 추가해줍니다.
나머지 디스크 파일 모두 순서에 맞게 SATA 컨트롤러에 등록시켜줍니다.
반드시 동일한 순서대로 다른 노드에도 등록시켜야 합니다.
2. ASM 환경 구성
A) ASM 환경 설정 및 초기화
oracleasm configure -i oracleasm init oracleasm status oracleasm configure
[root@node1 ~]# 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@node1 ~]# 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@node1 ~]# oracleasm status Checking if ASM is loaded: yes Checking if /dev/oracleasm is mounted: yes [root@node1 ~]# 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에 대한 추가적인 환경 설정(사용자, 그룹, 부팅시 활성화, 부팅시 스캔 여부)을 수행하고 적용 여부를 검증합니다.
B) 디스크 파티셔닝
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" 입력 ls /dev/sd*
[root@node1 ~]# ls /dev/sd* /dev/sda /dev/sda1 /dev/sda2 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf [root@node1 ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.32.1). 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. Created a new DOS disklabel with disk identifier 0x5d4aacce. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-2097151, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-2097151, default 2097151): Created a new partition 1 of type 'Linux' and of size 1023 MiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@node1 ~]# fdisk /dev/sdc Welcome to fdisk (util-linux 2.32.1). 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. Created a new DOS disklabel with disk identifier 0x104edbfe. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-2097151, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-2097151, default 2097151): Created a new partition 1 of type 'Linux' and of size 1023 MiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@node1 ~]# fdisk /dev/sdd Welcome to fdisk (util-linux 2.32.1). 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. Created a new DOS disklabel with disk identifier 0x1780c426. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-2097151, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-2097151, default 2097151): Created a new partition 1 of type 'Linux' and of size 1023 MiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@node1 ~]# fdisk /dev/sde Welcome to fdisk (util-linux 2.32.1). 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. Created a new DOS disklabel with disk identifier 0x0401edc8. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-62914559, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-62914559, default 62914559): Created a new partition 1 of type 'Linux' and of size 30 GiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@node1 ~]# fdisk /dev/sdf Welcome to fdisk (util-linux 2.32.1). 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. Created a new DOS disklabel with disk identifier 0xdc12631f. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-41943039, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): Created a new partition 1 of type 'Linux' and of size 20 GiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@node1 ~]# ls /dev/sd* /dev/sda /dev/sda2 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sda1 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf
VM에 연결된 디스크에 fdisk 명령어로 파티션 분할 작업을 수행 합니다.
실습의 편의를 위해 하나의 디스크가 하나의 파티션이 되도록 합니다.
C) 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@node1 ~]# oracleasm createdisk CRS1 /dev/sdb1 Writing disk header: done Instantiating disk: done [root@node1 ~]# oracleasm createdisk CRS2 /dev/sdc1 Writing disk header: done Instantiating disk: done [root@node1 ~]# oracleasm createdisk CRS3 /dev/sdd1 Writing disk header: done Instantiating disk: done [root@node1 ~]# oracleasm createdisk DATA /dev/sde1 Writing disk header: done Instantiating disk: done [root@node1 ~]# oracleasm createdisk FRA /dev/sdf1 Writing disk header: done Instantiating disk: done [root@node1 ~]# oracleasm scandisks Reloading disk partitions: done Cleaning any stale ASM disks... Scanning system for ASM disks... [root@node1 ~]# oracleasm listdisks CRS1 CRS2 CRS3 DATA FRA
VM에 마운트된 디스크를 각각 ASM Disk로 할당해줍니다.
순서대로 마운트가 되었다면, 디바이스 명의 알파벳 순으로 ASM 디스크를 생성하면 됩니다.
{}