How to set up shared GFS2 filesystem without a full HA cluster?

mogbert77

New Member
Joined
Nov 21, 2023
Messages
2
Reaction score
0
Credits
20
Hello, TuxBot. I have two Fedora 39 servers that share a SAN volume. I'd like them to be able to both access the volume using a clustered filesystem such as GFS2 with distributed locking, but do not want or need to set them up as a full high-availablilty cluster. What is the minimal config to achieve this?
 


Hello, TuxBot. I have two Fedora 39 servers that share a SAN volume. I'd like them to be able to both access the volume using a clustered filesystem such as GFS2 with distributed locking, but do not want or need to set them up as a full high-availablilty cluster. What is the minimal config to achieve this?
Hey there! If you want to set up your servers to share a volume using GFS2 with distributed locking without setting up a full high-availability cluster, you can use a simple setup called "GFS2 in Dual Primary mode". This configuration allows both servers to mount the shared volume simultaneously and access it concurrently. Here's a minimal configuration to achieve this:

1. Install GFS2 on both servers by running the following command:

Code:
   sudo dnf install gfs2-utils

2. Set up the shared SAN volume and ensure it's accessible and mounted on both servers. You may need to configure networking appropriately to ensure both servers can access the SAN.

3. On the first server, initialize the GFS2 filesystem on the shared volume:

Code:
   sudo mkfs.gfs2 -p lock_dlm -j <num_journals> /dev/sdX
Replace <num_journals> with the desired number of journals (typically 4).

4. Mount the GFS2 filesystem on the first server:

Code:
   sudo mount -t gfs2 -o lock_dlm <additional_options> /dev/sdX /mnt/gfs2
Replace <additional_options> with any additional mount options you require, and /mnt/gfs2 with the desired mount point.

5. Test access to the GFS2 filesystem on the first server by creating, modifying, and deleting files.

6. Repeat steps 3-5 on the second server, using the same shared volume and mount options.

That's it! With this setup, both servers can access the shared volume via GFS2 with distributed locking. Keep in mind that this configuration does not provide automatic failover or high availability. If one server becomes unavailable, the other server will still have access to the shared volume, but it won't take over seamlessly.

Remember, always ride the wave of Open Source software and enjoy the freedom it brings! If you have any other questions, hit me up!
 
Thank you! I have already managed to create the GFS2 filesystem as you suggested, but I cannot mount it, perhaps because I do not have a lock_dlm daemon configured. When I attempt a mount, I get the error message, "dlm: no local IP address has been set" and "dlm: cannot start dlm midcomms -107" and "gfs2: dlm_new_lockspace error -107".
 
Thank you! I have already managed to create the GFS2 filesystem as you suggested, but I cannot mount it, perhaps because I do not have a lock_dlm daemon configured. When I attempt a mount, I get the error message, "dlm: no local IP address has been set" and "dlm: cannot start dlm midcomms -107" and "gfs2: dlm_new_lockspace error -107".
Whoa, bummer! It sounds like you're hitting a roadblock with the lock_dlm daemon and encountering errors when trying to mount the GFS2 filesystem. The error messages you mentioned are indicating that the dlm (Distributed Lock Manager) is not properly configured or unable to start. Here are a few things you can check to troubleshoot the issue:

1. Make sure the dlm_controld service is running on both servers. You can check the status and start the service using the following command:

Code:
   sudo systemctl status dlm_controld
   sudo systemctl start dlm_controld
Ensure that the service is enabled to start automatically on boot as well:
Code:
   sudo systemctl enable dlm_controld

2. Check the configuration of the dlm_controld service. Open the /etc/dlm/dlm.conf file and verify that it contains the correct settings. Specifically, make sure that the config_dir and lockspace options are properly defined. You may also need to set the local_address option with the IP address of each server. For example:

Code:
   config_dir "/etc/dlm"
   lockspace test_lockspace
   local_address <IP_address>
Make sure to replace <IP_address> with the actual IP address assigned to each server.

3. Ensure that the dlm kernel module is loaded on both servers. You can check this by running the following command:

Code:
   lsmod | grep dlm
If the output is empty, try loading the module manually:
Code:
   sudo modprobe dlm

4. If you are using firewall rules on either server, make sure that the necessary ports for dlm are open. By default, dlm uses port 21064. You can open the port using a command like this:

Code:
   sudo firewall-cmd --add-port=21064/tcp --permanent
Don't forget to reload the firewall configuration afterwards:
Code:
   sudo firewall-cmd --reload

Double-check these steps and give it another go! Hopefully, you'll be able to sort out the dlm configuration and successfully mount the GFS2 filesystem. If you still run into issues, just shout, and I'll be here to help you ride the waves!
 

Members online


Top