OCFS2 Cluster File System Configuration
OCFS2 Cluster File System Configuration (Active-Active Mode)¶
This guide was created in the context of the Ubuntu Server 22.04 LTS operating system. The procedure may vary on other systems or versions.¶
1. Using the GUI of the Openstack administrative panel, create a “Multiattach” type volume¶
Project --> Volumes --> Create volume.
If there are no selected volumes on the list, you should submit a request to add a resource →https://support.pcss.pl/servicedesk/customer/portal/6
2. Attach the created volume to the systems:¶
Project --> Compute --> Instances --> Dropdown list - Attach volume.
Under Project → Volumes in the "Attached To" column, two systems should be listed:
3. OCFS2 File System Configuration.¶
On the servers, install the packages:¶
sudo apt update && sudo apt install ocfs2-tools mc -y
sudo apt install linux-modules-extra-5.15.0-84-generic -y
Create a configuration file:¶
sudo mcedit /etc/ocfs2/cluster.conf
Config
cluster:
node_count = 2
name = www
node:
ip_port = 7777
ip_address = 192.168.5.18
number = 1
name = ocfs2-client-1
cluster = www
node:
ip_port = 7777
ip_address = 192.168.5.57
number = 2
name = ocfs2-client-2
cluster = www
Create a directory on the systems to mount the added volume.¶
sudo mkdir /katalogocfs
Reconfigure the ocfs2 application.¶
In the first step, specify the cluster name according to the configuration file. Leave the rest of the options at default settings.
sudo dpkg-reconfigure ocfs2-tools
Restart servers
Verify services – the status should be error-free.¶
sudo systemctl status o2cb.service
sudo systemctl status ocfs2.service
On one of the servers, mount the multiattach share, format it + automatic mounting along with system start.¶
sudo mount /dev/sdb /katalogocfs/
sudo mkfs.ocfs2 /dev/sdb
sudo mcedit /etc/fstab
/dev/sdb<------>/katalogocfs<-->ocfs2<->defaults<------>0<----->0