Hello and welcome to this presentation. You see how to configure and test an OCFS2 cluster
comprising three Oracle Linux 8 instances. Prior the configuration activity demonstrated
in this presentation, one of the instances was configured as an iSCSI target and another
was configured as an initiator. You can see that part of the process in the presentation
titled "Configure a Linux iSCSI Target and Initiator on Oracle Cloud Infrastructure".
The two cluster members used in this presentation are instances in the Oracle Cloud Infrastructure
and shown in the illustration on this slide.
The shared iSCSI storage is provided by a Block Volume attached to another instance
which has been configured as an iSCSI target. The iSCSI connection from each initiator uses
the target instance private IP address and locally configured target iqn.
In the following demonstration, we apply a rule to the firewall for port 7777, and install
ocfs2-tools and configure to cluster.
After the cluster instance ports are set, from one of the cluster members, we create
a partition on the shared storage device. Then we make the OCFS2 file system before
mounting on each cluster member.
The cluster status is checked and then the shared storage is ready for access from each
cluster member.
Now, you see how to perform this configuration in the following demonstration.
During the demonstration, most of the configuration activity takes place on the cluster member
smm-cluster-01. Because many of the configuration activities take place on both instances, I
will explain when steps need to be repeated on cluster member smm-cluster-02, but will
not show the steps to save time.
The Oracle Cloud Infrastructure Virtual Cloud Network Security List includes a rule to allow
traffic for port 7777 from any source on the VCN. So, the next step is to enable port 7777
on the two cluster members.
I'm logged into the Oracle Linux 8 instance smm-cluster-01. Here, set the firewall to
allow communication on port 7777 for TCP and UDP protocols. Enter
sudo firewall-cmd --permanent --add-port=7777/tcp --add-port=7777/udp.
Reload the firewall rules with the command sudo firewall-cmd --reload.
Repeat these firewall commands on the other cluster member, instance smm-cluster-02.
Check the firewall settings by entering the sudo firewall-cmd --info-zone=public.
The firewall-cmd output confirms port 7777 has been enabled for the TCP and UDP protocols.
Clear the screen.
To install the software on an instance on this isolated VCN, we have configured an http
proxy on the bastion. So, sudo -E is used to pass the proxy environment variables to
the dnf command.
Enter the command sudo -E dnf install ocfs2* -y
The package name includes the wildcard star to shorten the typing and still ensure I get
the relevant packages.
After the command runs to completion, run the same command on the other cluster member
instance smm-cluster-02, then return to this terminal.
On smm-cluster-01, create the cluster and add the members.
Start with the command sudo o2cb add-cluster ociocfs2.
Then sudo o2cb add-node ociocfs2 smm-cluster-01
-ip 10.0.2.10 And
sudo o2cb add-node ociocfs2 smm-cluster-02 -ip 10.0.2.11
Clear the screen.
Display the cluster configuration file with the command sudo cat
/etc/ocfs2/cluster.conf.
Copy the contents of the file into the paste buffer and switch to the terminal for the
instance smm-cluster-02.
Create the cluster configuration file on smm-cluster-02. First create the directory with sudo mkdir
/etc/ocfs2.
Then create the configuration file with sudo vi /etc/ocfs2/cluster.conf
Insert the contents of the paste buffer and save the file.
Return to the instance smm-cluster-01.
Initialize the cluster. Enter the command sudo /sbin/o2cb.init configure
Enter y in response to the load O2CB driver on boot prompt, then accept the default values
at each subsequent prompt by pressing return.
Run the same command and provide the same response on the instance smm-cluster-02.
Return to smm-cluster-01 and clear the screen.
Check cluster status with the command sudo /sbin/o2cb.init status
Note that the cluster heartbeat is Not Active.
On the instance smm-cluster-02, the cluster status also shows the cluster heartbeat is
Not Active.
On smm-cluster-01, enter sudo systemctl enable o2cb
Recall the command and change it to sudo systemctl enable ocfs2
Clear the screen and perform the same commands on smm-cluster-02.
Return to smm-cluster-01 to set some kenel parameters. Start by interactively setting
them. Enter the command sudo sysctl kernel.panic=30
Recall the command and change sudo sysctl kernel.panic=30 to
sudo sysctl kernel.panic_on_oops=1
Now, to make the kernel parameter settings persistent, edit the kernel configuration
file by entering sudo vi /etc/sysctl.conf
Instert two lines into the file: kernel.panic=30 and kernel.panic_on_oops=1.
Save the file on exit. Make the same kernel parameter settings and updates to the configuration
file on the instance smm-cluster-02.
Make the same changes on smm-cluster-02.
Clear the screen. Now, time to create a partition on the device so it can be used. Enter
sudo fdisk /dev/sdb
The block device in this configuration is being re-used and the old ext2 signature can
be removed. This only need be done from smm-cluster-01.
So, enter the letter n for new partition.
Press return at each prompt to accept default values to partition the entire space.
When the 50 GiB partition has been created, enter w to write the partition.
Clear the screen.
Now, make the ocfs2 file system on the partition. Enter
sudo mkfs.ocfs2 -L "ocfs2" /dev/sdb1
Clear the screen.
Now, create a mount point on smm-cluster-01 for the volume, mount it and check the status
of the cluster with the next three commands.
First, enter sudo mkdir /u01
to create the mount point.
Next, enter sudo mount -L ocfs2 /u01
to mount the volume.
Last, enter sudo /sbin/o2cb.init status
to check on the cluster. Note that now there is storage for the file system to use, and
the heartbeat is Active.
Perform the same three steps on the instance smm-cluster-02. Note that the heartbeat is
Active on this cluster member as well.
Save the file.
Return to the instance smm-cluster-01.
Now, test the cluster file system. Clear the screen.
First, copy some files into /u01. Enter sudo cp /boot/vmlinuz* /u01
Now enter ls /u01
and see that the files are there.
Create a text file test file by entering sudo vi /u01/test.txt
and input the line: This is written from smm-cluster-01, the save the file. Verify the file by entering
cat /u01/test.txt and see the line that was input.
On the instance smm-cluster-02, clear the screen and enter
ls /u01 and see that all the files are present. Update
the test.txt file by entering sudo vi /u01/test.txt
then providing a second line: Update from smm-cluster-02.
Return to smm-cluster-01 and recall the cat command to display /u01/text.txt. The two
input lines are displayed, showing that the file is shared for read/write access from
both cluster members.