본문 바로가기
STUDY/DB

셋팅 3번 Oracle asm 구성

by brown_board 2024. 12. 16.
728x90

161을 그대로 162에 복제를 했기 때문에 ip가 161로 설정되어있다.
그렇기 때문에 162로 수정

마찬가지로 emp0s8도 162로 수정

해당 세션에 접속

복제를 했기 때문에 hostname도 ol8rac1로 되어 있다. 그렇기 때문에 hostname 수정이 필요하다

[root@ol8rac1 ~]# hostnamectl set-hostname ol8rac2
[root@ol8rac1 ~]# hostnamectl set-hostname ol8rac2 --pretty
[root@ol8rac1 ~]# hostnamectl set-hostname ol8rac2 --static
[root@ol8rac1 ~]# hostnamectl set-hostname ol8rac2 --transient
[root@ol8rac1 ~]# hostname
ol8rac2

양 쪽 가상머신을 키고 편집기로 ping체크를 통해 icmp 테스트를 해서 반대 ip로 해보면 통신이 잘되는 것을 확인할 수 있음
본인은 두 개가 동시에 켜지지 않았는데 이에 대한 원인이 asm_disk가 공유가능이 아닌 일반옵션으로 되어있어서 그랬었다. 그래서 공유가능으로 바꾸니깐 동시에 켜졌다.

추가적으로 ip말고도 priv ip도 테스트

[root@ol8rac1 ~]# grubby --help
Usage: grubby [OPTION...]
      --add-kernel=kernel-path            add an entry for the specified kernel
      --args=args                         default arguments for the new kernel or new arguments for kernel being updated)
      --bad-image-okay                    don't sanity check images in boot entries (for testing only)
  -c, --config-file=path                  path to grub config file to update ("-" for stdin)
      --copy-default                      use the default boot entry as a template for the new entry being added; if the default is not a linux image, or if the kernel referenced by the default image does not exist, the
                                          first linux entry whose kernel does exist is used as the template
      --default-kernel                    display the path of the default kernel
      --default-index                     display the index of the default kernel
      --default-title                     display the title of the default kernel
      --env=path                          path for environment data
      --grub2                             configure grub2 bootloader
      --info=kernel-path                  display boot information for specified kernel
      --initrd=initrd-path                initrd image for the new kernel
  -i, --extra-initrd=initrd-path          auxiliary initrd image for things other than the new kernel
      --make-default                      make the newly added entry the default boot entry
      --remove-args=STRING                remove kernel arguments
      --remove-kernel=kernel-path         remove all entries for the specified kernel
      --set-default=kernel-path           make the first entry referencing the specified kernel the default
      --set-default-index=entry-index     make the given entry index the default entry
      --title=entry-title                 title to use for the new kernel entry
      --update-kernel=kernel-path         updated information for the specified kernel
      --zipl                              configure zipl bootloader
  -b, --bls-directory                     path to directory containing the BootLoaderSpec fragment files
      --no-etc-grub-update                don't update the GRUB_CMDLINE_LINUX variable in /etc/default/grub

Help options:
  -?, --help                              Show this help message

 Oracle Linux 8.8 최초 설치 시 부팅 과정에서 Redhat 이미지 배포판을 가져와 커스터마이징 했기 때문에 부팅 시 과정을 한번 확인합니다. grubby 명령어를 통해서 현재 운영체제의 커널부팅이 어떤 이미지로 부팅되어 있는지 확인이 가능하고 Defualt 설정도 변경이 가능합니다.(grubby --help 활용)

 

[root@ol8rac1 ~]# grubby --info=ALL | grep ^kernel
kernel="/boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64"
kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64"
kernel="/boot/vmlinuz-0-rescue-b7c827829e684670a293338637c4f1bc"

[root@ol8rac2 ~]# grubby --info=ALL | grep ^kernel
kernel="/boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64"
kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64"
kernel="/boot/vmlinuz-0-rescue-b7c827829e684670a293338637c4f1bc"

▶ ol8rac1, ol8rac2 두 노드를 grubby 명령어를 통해서 커널 부팅 순서를 확인했을 때, el8uek로 시작되는 부팅이미지가 상단에 위치하여 Default 인 것을 확인할 수 있습니다. 해당 이미지는 오라클에서 Redhat 이미지를 커스텀하여 만든 이미지로 asmlib 패키지 설치 시 오류가 나는 버그가 있어 부팅이미지 순서를 변경해야 합니다.

▣ grubby 커널 부팅 이미지 요약
kernel="/boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64" -> ORACLE에서 커스터마이징 한 리눅스 8.8 image
kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64" -> Redhat Default 리눅스 8.8 image
kernel="/boot/vmlinuz-0-rescue-b7c827829e684670a293338637c4f1bc" -> 긴급복구 image

=> 참고한 블로그가 8.7버전이고 본인은 8.8버전이다. 그래서 혹시 몰라 바꿔주었다. 파일명도 수정하고 =옆에 띄어쓰기가 없음에 주의한다.

grubby --set-default-index=/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64

grubby --remove-kernel=/boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64

[root@ol8rac1 ~]# grubby --set-default-index=/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64
The default is /boot/loader/entries/b7c827829e684670a293338637c4f1bc-4.18.0-477.10.1.el8_8.x86_64.conf with index 1 and kernel /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64
[root@ol8rac1 ~]# grubby --remove-kernel=/boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64
[root@ol8rac1 ~]# grubby --info=ALL | grep ^kernel
kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64"
kernel="/boot/vmlinuz-0-rescue-b7c827829e684670a293338637c4f1bc"

[root@ol8rac2 ~]# grubby --set-default-index=/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64
The default is /boot/loader/entries/b7c827829e684670a293338637c4f1bc-4.18.0-477.10.1.el8_8.x86_64.conf with index 1 and kernel /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64
[root@ol8rac2 ~]# grubby --remove-kernel=/boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64
[root@ol8rac2 ~]# grubby --info=ALL | grep ^kernel
kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64"
kernel="/boot/vmlinuz-0-rescue-b7c827829e684670a293338637c4f1bc"

▶ ol8rac1, ol8rac2 두 노드에서 기존 default 설정 커널 부팅 이미지(Oracle 커스터마이징 이미지) 순서를 Redhat 기본 커널이미지  kernel="/boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64"로 변경합니다. 변경 후에는 해당 포스트에서는 Oracle 커스터마이징 이미지를 삭제했지만, 필요한 경우 남겨두셔도 됩니다. 해당 작업 완료 후 재부팅합니다.

[root@ol8rac1 ~]# cd /etc/yum.repos.d
[root@ol8rac1 yum.repos.d]# ls
oracle-linux-ol8.repo  uek-ol8.repo  virt-ol8.repo
[root@ol8rac1 yum.repos.d]# vi oracle-linux-ol8.repo

/
ol8_addons

i

[ol8_addons]
name=Oracle Linux 8 Addons ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0  --> 1로 수정

:wq

2번서버에서도 마찬가지로 똑같이 하기

▶ol8rac1, ol8rac2 두 노드에서 인터넷이 되는 경우에는 외부 인터페이스 환경의 repo를 통해서 패키지를 가져올 수 있기 때문에 /etc/yum.repos.d 경로에 oracle-linux-ol8.repo 파일을 생성 후 위와 같은 url을 통해서 패키지를 가져올 수 있도록 설정합니다. 폐쇄망의 환경의 경우는 별도의 iso 이미지를 마운트하여 로컬 repo 구성도 가능합니다. 

 

[root@ol8rac1 yum.repos.d]# yum list oracleasm*
Last metadata expiration check: 0:17:55 ago on Mon 23 Dec 2024 12:12:18 AM KST.
Available Packages
oracleasm-support.src                                    3.0.0-6.el8                                  ol8_addons
oracleasm-support.x86_64                                 3.0.0-6.el8                                  ol8_addons

▶ ol8rac1 노드에서 yum install oracleasm 패키지를 설치합니다.

s
[root@ol8rac1 yum.repos.d]# yum search oracleasm
Last metadata expiration check: 0:18:20 ago on Mon 23 Dec 2024 12:12:18 AM KST.
====================================== Name & Summary Matched: oracleasm =======================================
kmod-redhat-oracleasm.src : oracleasm kernel module
kmod-redhat-oracleasm.x86_64 : oracleasm kernel module
kmod-redhat-oracleasm-kernel_4_18_0_240.x86_64 : oracleasm kernel module for kernel version
                                               : 4.18.0-240.el8..4.18.0-240.14.1.el8_3
kmod-redhat-oracleasm-kernel_4_18_0_240_14_1.x86_64 : oracleasm kernel module for kernel version
                                                    : 4.18.0-240.14.1.el8_3 and higher
kmod-redhat-oracleasm-kernel_4_18_0_425_10_1.x86_64 : oracleasm kernel module for kernel version
                                                    : 4.18.0-425.10.1.el8_7 and higher
kmod-redhat-oracleasm-kernel_4_18_0_425_3_1.x86_64 : oracleasm kernel module for kernel version
                                                   : 4.18.0-425.3.1.el8..4.18.0-425.10.1.el8_7
=========================================== Name Matched: oracleasm ============================================
oracleasm-support.src : The Oracle Automatic Storage Management support programs.
oracleasm-support.x86_64 : The Oracle Automatic Storage Management support programs.

▶ ol8rac1 노드에서 oracleasm 패키지가 검색이 가능한지 yum search oracleasm 명령어를 통해 확인합니다. 해당 명령어를 통해서 kmon-redhat-oracleasm 패키지를 가져오는 것을 확인할 수 있습니다.

[root@ol8rac1 yum.repos.d]# yum search oracleasm
Last metadata expiration check: 0:18:20 ago on Mon 23 Dec 2024 12:12:18 AM KST.
====================================== Name & Summary Matched: oracleasm =======================================
kmod-redhat-oracleasm.src : oracleasm kernel module
kmod-redhat-oracleasm.x86_64 : oracleasm kernel module
kmod-redhat-oracleasm-kernel_4_18_0_240.x86_64 : oracleasm kernel module for kernel version
                                               : 4.18.0-240.el8..4.18.0-240.14.1.el8_3
kmod-redhat-oracleasm-kernel_4_18_0_240_14_1.x86_64 : oracleasm kernel module for kernel version
                                                    : 4.18.0-240.14.1.el8_3 and higher
kmod-redhat-oracleasm-kernel_4_18_0_425_10_1.x86_64 : oracleasm kernel module for kernel version
                                                    : 4.18.0-425.10.1.el8_7 and higher
kmod-redhat-oracleasm-kernel_4_18_0_425_3_1.x86_64 : oracleasm kernel module for kernel version
                                                   : 4.18.0-425.3.1.el8..4.18.0-425.10.1.el8_7
=========================================== Name Matched: oracleasm ============================================
oracleasm-support.src : The Oracle Automatic Storage Management support programs.
oracleasm-support.x86_64 : The Oracle Automatic Storage Management support programs.
[root@ol8rac1 yum.repos.d]# yum install oracleasm-support
Last metadata expiration check: 0:50:22 ago on Mon 23 Dec 2024 12:12:18 AM KST.
Dependencies resolved.
================================================================================================================
 Package                        Architecture        Version                       Repository               Size
================================================================================================================
Installing:
 oracleasm-support              x86_64              3.0.0-6.el8                   ol8_addons              108 k
Upgrading:
 libbpf                         x86_64              2:0.6.0-6.el8                 ol8_UEKR7               162 k

Transaction Summary
================================================================================================================
Install  1 Package
Upgrade  1 Package

Total download size: 270 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): oracleasm-support-3.0.0-6.el8.x86_64.rpm                                 412 kB/s | 108 kB     00:00
(2/2): libbpf-0.6.0-6.el8.x86_64.rpm                                            559 kB/s | 162 kB     00:00
----------------------------------------------------------------------------------------------------------------
Total                                                                           924 kB/s | 270 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                        1/1
  Upgrading        : libbpf-2:0.6.0-6.el8.x86_64                                                            1/3
  Installing       : oracleasm-support-3.0.0-6.el8.x86_64                                                   2/3
  Running scriptlet: oracleasm-support-3.0.0-6.el8.x86_64                                                   2/3
Note: Forwarding request to 'systemctl enable oracleasm.service'.
Synchronizing state of oracleasm.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable oracleasm
Created symlink /etc/systemd/system/multi-user.target.wants/oracleasm.service → /usr/lib/systemd/system/oracleasm.service.

  Cleanup          : libbpf-0.5.0-1.el8.x86_64                                                              3/3
  Running scriptlet: libbpf-0.5.0-1.el8.x86_64                                                              3/3
  Verifying        : oracleasm-support-3.0.0-6.el8.x86_64                                                   1/3
  Verifying        : libbpf-2:0.6.0-6.el8.x86_64                                                            2/3
  Verifying        : libbpf-0.5.0-1.el8.x86_64                                                              3/3

Upgraded:
  libbpf-2:0.6.0-6.el8.x86_64
Installed:
  oracleasm-support-3.0.0-6.el8.x86_64

Complete!

▶ ol8rac1, ol8rac2 두 노드에서 yum install oracleasm-support를 통해서 oracleasm 패키지지원 rpm을 설치하도록합니다.(설명: https://access.redhat.com/solutions/315643)

[root@ol8rac1 yum.repos.d]# /usr/sbin/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 []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Maximum number of disks that may be used in ASM system [2048]: 2048
Enable iofilter if kernel supports it (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

▶ol8rac1, ol8rac2 두 노드에서 /usr/sbin/oracleasm configure -i를 수행하여 컨피그 설정을 진행할 수 있습니다.

▣ oracleasm configure 설정
Default user to own the driver interface []: oracle -> asmlib를 수행할 수 있는 일반 계정
Default group to own the driver interface []: dba -> asmlib를 수행할 수 있는 일반 계정의 그룹
Start Oracle ASM library driver on boot (y/n) [n]: y -> 부팅 시 asmlib 데몬실행 여부
Scan for Oracle ASM disks on boot (y/n) [y]: y -> 부팅시 asmlib를 통해 디스크스캔 여부

 

[root@ol8rac1 yum.repos.d]# /usr/sbin/oracleasm init
Mounting ASMlib driver filesystem: Not applicable with kernel 4.18.0
Setting up iofilter map for ASM disks: Failed to setup iofilter map

▶ 공유볼륨 스토리지를 할당한 두 개의 노드에서 /usr/sbin/oracleasm init 수행 시 failed 되는 경우 커널 버전과 연관성이 있습니다. 기본적으로 Redhat 설치 후 DB 설치 시 문제가 되지 않지만, Oracle Linux 설치 후 커널 버전과 Oracle asmlib 지원 가능여부 or 호환성 문제로 모듈 자체 활성화 되지 않은 경우 아래와 같은 절차로 조치가 가능합니다.

[root@ol8rac1 /]# uname -r
4.18.0-477.10.1.el8_8.x86_64

▶ ASM + RAC 구성을 위한 두 노드의 부팅이미지 리눅스 커널 버전은 4.18.0-477.10.1.el8_8.x86_64로 커널 업그레이드 또는 vmlinuz 명령어를 통해 존재하는 다른 커널 버전으로 재부팅이 필요합니다.

[root@ol8rac1 /]# ls -l /boot/vmlinuz-*
-rwxr-xr-x. 1 root root 13484336 Dec 15 22:56 /boot/vmlinuz-0-rescue-b7c827829e684670a293338637c4f1bc
-rwxr-xr-x. 1 root root 10843648 May 17  2023 /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64
-rwxr-xr-x. 1 root root 13484336 May  2  2023 /boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64

4.18버전의 커널에서 477저게 ASMlib가 안되는 버전인 거 같다.

[root@ol8rac1 sbin]# sudo yum update kernel
Last metadata expiration check: 1:25:16 ago on Mon 23 Dec 2024 12:12:18 AM KST.
Dependencies resolved.
================================================================================================================
 Package                  Architecture     Version                            Repository                   Size
================================================================================================================
Installing:
 kernel                   x86_64           4.18.0-553.33.1.el8_10             ol8_baseos_latest            10 M
Installing dependencies:
 kernel-core              x86_64           4.18.0-553.33.1.el8_10             ol8_baseos_latest            43 M
 kernel-modules           x86_64           4.18.0-553.33.1.el8_10             ol8_baseos_latest            36 M

Transaction Summary
================================================================================================================
Install  3 Packages

Total download size: 90 M
Installed size: 96 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): kernel-4.18.0-553.33.1.el8_10.x86_64.rpm                                 3.1 MB/s |  10 MB     00:03
(2/3): kernel-modules-4.18.0-553.33.1.el8_10.x86_64.rpm                         4.2 MB/s |  36 MB     00:08
(3/3): kernel-core-4.18.0-553.33.1.el8_10.x86_64.rpm                            4.3 MB/s |  43 MB     00:10
----------------------------------------------------------------------------------------------------------------
Total                                                                           9.0 MB/s |  90 MB     00:10
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                        1/1
  Installing       : kernel-core-4.18.0-553.33.1.el8_10.x86_64                                              1/3
  Running scriptlet: kernel-core-4.18.0-553.33.1.el8_10.x86_64                                              1/3
  Installing       : kernel-modules-4.18.0-553.33.1.el8_10.x86_64                                           2/3
  Running scriptlet: kernel-modules-4.18.0-553.33.1.el8_10.x86_64                                           2/3
  Installing       : kernel-4.18.0-553.33.1.el8_10.x86_64                                                   3/3
  Running scriptlet: kernel-core-4.18.0-553.33.1.el8_10.x86_64                                              3/3
  Running scriptlet: kernel-modules-4.18.0-553.33.1.el8_10.x86_64                                           3/3
  Running scriptlet: kernel-4.18.0-553.33.1.el8_10.x86_64                                                   3/3
  Verifying        : kernel-4.18.0-553.33.1.el8_10.x86_64                                                   1/3
  Verifying        : kernel-core-4.18.0-553.33.1.el8_10.x86_64                                              2/3
  Verifying        : kernel-modules-4.18.0-553.33.1.el8_10.x86_64                                           3/3

Installed:
  kernel-4.18.0-553.33.1.el8_10.x86_64                     kernel-core-4.18.0-553.33.1.el8_10.x86_64
  kernel-modules-4.18.0-553.33.1.el8_10.x86_64

Complete!

새로운 커널 다운

 

[root@ol8rac1 sbin]# ls -l /boot/vmlinuz-*
-rwxr-xr-x. 1 root root 13484336 Dec 15 22:56 /boot/vmlinuz-0-rescue-b7c827829e684670a293338637c4f1bc
-rwxr-xr-x. 1 root root 10843648 May 17  2023 /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64
-rwxr-xr-x. 1 root root 10889384 Dec 19 19:55 /boot/vmlinuz-4.18.0-553.33.1.el8_10.x86_64
-rwxr-xr-x. 1 root root 13484336 May  2  2023 /boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64

[root@ol8rac1 sbin]# grubby --set-default /boot/vmlinuz-4.18.0-553.33.1.el8_10.x86_64
The default is /boot/loader/entries/b7c827829e684670a293338637c4f1bc-4.18.0-553.33.1.el8_10.x86_64.conf with index 0 and kernel /boot/vmlinuz-4.18.0-553.33.1.el8_10.x86_64

sudo reboot

커널 변경 후 재기동

 

[root@ol8rac1 ~]# uname -r
4.18.0-553.33.1.el8_10.x86_64
[root@ol8rac1 ~]# /usr/sbin/oracleasm init
[root@ol8rac1 ~]# /usr/sbin/oracleasm init
[root@ol8rac1 ~]# /usr/sbin/oracleasm status
Checking if the oracleasm kernel module is loaded: yes
Checking if /dev/oracleasm is mounted: yes
Checking which I/O Interface is in use: oracleasm driver (KABI_V2)

정상적으로 되는 것을 확인가능하다.

위의 과정을 node2번에서도 똑같이 진행한다.

[root@ol8rac1 disks]# pwd
/dev/oracleasm/disks
[root@ol8rac1 disks]# ls blk
ls: cannot access 'blk': No such file or directory
[root@ol8rac1 disks]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   50G  0 disk
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   49G  0 part
  ├─ol-root 253:0    0 44.8G  0 lvm  /
  └─ol-swap 253:1    0  4.2G  0 lvm  [SWAP]
sdb           8:16   0   25G  0 disk
sdc           8:32   0   25G  0 disk
sr0          11:0    1 1024M  0 rom
[root@ol8rac1 disks]# fdisk -l | grep -i sd
Disk /dev/sdc: 25 GiB, 26843545600 bytes, 52428800 sectors
Disk /dev/sdb: 25 GiB, 26843545600 bytes, 52428800 sectors
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
/dev/sda1  *       2048   2099199   2097152   1G 83 Linux
/dev/sda2       2099200 104857599 102758400  49G 8e Linux LVM

▶ ol8rac1, ol8rac2 두 노드에서 asmlib 활성화가 정상화 됬다면, 다음으로 추가했던 공유스토리지 디스크를 사용할 수 있도록 등록합니다. 할당된 디스크의 명칭이 /dev/sdb, /deb/sdc 각 25GB가 잘 반영된것을 확인할 수 있습니다.

[root@ol8rac1 disks]# 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 0xa7aca03d.

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):
First sector (2048-52428799, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-52428799, default 52428799):

Created a new partition 1 of type 'Linux' and of size 25 GiB.

Command (m for help): n
All space for primary partitions is in use.

Command (m for help): p
Disk /dev/sdb: 25 GiB, 26843545600 bytes, 52428800 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
Disklabel type: dos
Disk identifier: 0xa7aca03d

Device     Boot Start      End  Sectors Size Id Type
/dev/sdb1        2048 52428799 52426752  25G 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

 ol8rac1 노드에서 fdisk 명령어를 통해서 할당된 공유스토리지 디스크 DATA 영역  /dev/sdb를 사용할 수 있도록 파티셔닝 해주도록 합니다.

[root@ol8rac1 disks]# 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 0x43afdd0c.

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):
First sector (2048-52428799, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-52428799, default 52428799):

Created a new partition 1 of type 'Linux' and of size 25 GiB.

Command (m for help): p
Disk /dev/sdc: 25 GiB, 26843545600 bytes, 52428800 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
Disklabel type: dos
Disk identifier: 0x43afdd0c

Device     Boot Start      End  Sectors Size Id Type
/dev/sdc1        2048 52428799 52426752  25G 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[root@ol8rac1 disks]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   50G  0 disk
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   49G  0 part
  ├─ol-root 253:0    0 44.8G  0 lvm  /
  └─ol-swap 253:1    0  4.2G  0 lvm  [SWAP]
sdb           8:16   0   25G  0 disk
└─sdb1        8:17   0   25G  0 part
sdc           8:32   0   25G  0 disk
└─sdc1        8:33   0   25G  0 part
sr0          11:0    1 1024M  0 rom

 ol8rac1 노드에서 fdisk 명령어를 통해서 할당된 공유스토리지 디스크 RECO 영역  /dev/sdc를 사용할 수 있도록 파티셔닝 해주도록 합니다.

[root@ol8rac1 disks]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   50G  0 disk
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   49G  0 part
  ├─ol-root 253:0    0 44.8G  0 lvm  /
  └─ol-swap 253:1    0  4.2G  0 lvm  [SWAP]
sdb           8:16   0   25G  0 disk
└─sdb1        8:17   0   25G  0 part
sdc           8:32   0   25G  0 disk
└─sdc1        8:33   0   25G  0 part
sr0          11:0    1 1024M  0 rom

▶ ol8rac1 노드에서 lsblk 명령어를 통해서 /dev/sdb, /dev/sdb 디바이스가 논리적으로 파티션되어 사용할 수 있는것을 확인할 수 있습니다.

 

[root@ol8rac1 disks]# oracleasm createdisk DATA /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@ol8rac1 disks]# oracleasm createdisk RECO /dev/sdc1
Writing disk header: done
Instantiating disk: done

▶ ol8rac1 노드에서 해당 디스크를 asm disk로 사용하기 위해서 각각의 명칭을 지정하여 디스크를 생성합니다.

 

[root@ol8rac1 disks]# ls -ltr
total 0
brw-rw----. 1 oracle dba 8, 17 Dec 23 02:01 DATA
brw-rw----. 1 oracle dba 8, 33 Dec 23 02:01 RECO
[root@ol8rac1 disks]# oracleasm listdisks
DATA
RECO

▶ ol8rac1 노드에서 해당 디스크를 createdisk 하여 DATA, RECO 디렉토리가  /dev/oracleasm/disks 경로에 생성된것을 확인할 수 있습니다.

 

[root@ol8rac2 disks]# oracleasm listdisks
[root@ol8rac2 disks]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "DATA"
Instantiating disk "RECO"
[root@ol8rac2 disks]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0   50G  0 disk
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   49G  0 part
  ├─ol-root 253:0    0 44.8G  0 lvm  /
  └─ol-swap 253:1    0  4.2G  0 lvm  [SWAP]
sdb           8:16   0   25G  0 disk
└─sdb1        8:17   0   25G  0 part
sdc           8:32   0   25G  0 disk
└─sdc1        8:33   0   25G  0 part
sr0          11:0    1 1024M  0 rom

▶ ol8rac1 노드에서 DATA, RECO 디스크 작업을 모두 마치고, ol8rac2 노드에도 공유디스크로 지정했기 때문에 스캔을 통해서 해당 디스크의 DATA, RECO 디렉터리를 동일하게 가져온 것을 확인할 수 있습니다.

 

 

 

 

 

 

 

 

출처
https://pinetreeday.tistory.com/243

 

DB Oracle21 ASM + RAC 환경 구축하기(With. ORACLE ASM 구성) 4편

▣ DB Oracle ASM + RAC 환경 구축하기(With. ORACLE ASM 구성) 4편※ ORACLE ASM + RAC 구성 실습을 위한 사전 준비 사항 01. 실습환경 : Oracle VM VirtualBox 7.0  ■ Download URL : https://www.virtualbox.org/02. 테스트용 서버 :

pinetreeday.tistory.com

 

728x90

'STUDY > DB' 카테고리의 다른 글

oracle ASM+RAC구성 (Grid Infrastucture) (4)  (0) 2024.12.23
vitual machine 셋팅(2) -공유 스토리지 구성  (0) 2024.12.16
vitrual machine 셋팅 (1)  (1) 2024.12.14
SQL MERGE  (0) 2024.10.13
SQL집계함수 ROLLUP()이란?  (0) 2024.10.13

댓글