Oracle Database in Pacemaker Corosync Cluster
Oracle Database in Pacemaker Corosync Cluster
Configuring an lvm volume with an ext4 file system
-
Create an LVM physical volume
pvcreate /dev/sdb1
pvcreate /dev/sdc1 -
Create the volume group
vgcreate data_vg /dev/sdb1
vgcreate arch_vg /dev/sdc1 -
Create a logical volume
lvcreate -l 100%FREE -n data_lv data_vg
lvcreate -l 100%FREE -n arch_lv arch_vg -
Create an ext4 file system
mkfs.ext4 /dev/data_vg/data_lv
mkfs.ext4 /dev/arch_vg/arch_lv
Exclusive activation of a volume group in a cluster (HA-LVM)
-
Execute the following command to ensure that locking_type is set to 1 and that use_lvmetad is set to 0 in the /etc/lvm/lvm.conf file. This command also disables and stops any lvmetad processes immediately.
lvmconf --enable-halvm --services --startstopservices
-
Determine which volume groups are currently configured on your local storage with the following command.
~]# vgs --noheadings -o vg_name
arch_vg
data_vg
rhel -
Add the volume groups other than data_vg/arch_vg (the volume group you have just defined for the cluster) as entries to volume_list in the /etc/lvm/lvm.conf configuration file.
volume_list = [ "rhel" ]
-
Rebuild the initramfs boot image to guarantee that the boot image will not try to activate avolume group controlled by the cluster. Update the initramfs device with the following command. This command may take up to a minute to complete.
dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
-
Reboot the node.
-
Start clusterservices on each of the nodes with the following command.
pcs cluster start --all
Creating resources and resource groups
-
Create LVM resource.
pcs resource create data001_vg LVM volgrpname=data001_vg exclusive=true --group ora_grp
pcs resource create arch001_vg LVM volgrpname=arch001_vg exclusive=true --group ora_grp -
Create Filesystem resource.
pcs resource create data001 Filesystem \
device="/dev/data001_vg/data001_lv" directory="/data001" fstype="xfs" --group ora_grp
pcs resource create arch001 Filesystem \
device="/dev/arch001_vg/arch001_lv" directory="/arch001" fstype="xfs" --group ora_grp -
Create VirtualIP resource.
pcs resource create vip1 IPaddr2 ip=192.168.184.146 \
cidr_netmask=24 nic=ens32 --group ora_grp -
Create Oracle Database Listener resource.
pcs resource create coco_lsnr oralsnr \
sid="coco" home="/u01/app/oracle/product/11.2.0.4/db_1" user="oracle" \
listener="LI_COCO" tns_admin="/u01/app/oracle/product/11.2.0.4/db_1/network/admin" \
op monitor on-fail=standby --group ora_grp -
Create Oracle Database resource.
pcs resource create coco_inst oracle \
sid="coco" home="/u01/app/oracle/product/11.2.0.4/db_1" user="oracle" shutdown_method=immediate \
op monitor on-fail=standby --group ora_grp
Create lsb resource for oracle database
pcs resource create ora_orcl lsb:lsb_ora_orcl --group oraclegroup |
Reference:
・ Corosync/Pacemaker - LSB Resources Restart When Starting Node (Doc ID 2925231.1)
・ /etc/init.d/lsb_ora_orcl



