• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Beginners Guide to Global File System 2 (GFS2)

By admin

Global File System 2 (GFS2)

Global File System 2 (GFS2) is a cluster file system interfacing directly with the kernel VFS layer. This means that the same file system can be mounted and used by multiple cluster nodes simultaneously, while still providing a full regular file system, including features such as support for POSIX ACLs, extended attributes, and quotas.

To accomplish this, every node accessing a GFS2 file system uses the cluster infrastructure provided by Corosync and Pacemaker to provide services such as fencing and locking. Each cluster node mounting a GFS2 file system will use a separate journal. If a node fails, one of the other nodes in the cluster will replay the journal for the failed node after the failed node has been fenced. To prevent race conditions between two nodes when accessing the file system, GFS2 uses the Distributed Lock Manager (DLM) to coordinate locks on files and directories.

Note: Red Hat does not support the use of GFS2 as a single-node file system, or cluster deployments of more than 16 nodes. If a high-performance, scalable, server file system is needed for use by a single node, Red Hat recommends the use of the default XFS file system, or as an alternative, ext4.

When running in a pure 64-bit environment, a GFS2 file system can theoretically scale up to 8 EiB. However, the maximum GFS2 file system size currently supported by Red Hat is 100 TiB. For most deployments, having multiple smaller file systems makes more sense than a single large file system. On a larger file system, running a fsck.gfs2 command will take longer, and use more memory. A full restore of a file system from backup will also take longer.

Note: Red Hat currently only supports GFS2 file systems that have been created on a CLVM cluster logical volume.

Red Hat offers the GFS2 file system and CLVM as part of the Resilient Storage Add-on for Red Hat Enterprise Linux Server. The Resilient Storage Add-on includes the High-Availability Add-on as part of the subscription.

SELinux and GFS2

GFS2 supports extended attributes (xattrs) and can store file labels used by Security Enhanced Linux (SELinux) just like XFS and ext4. However, using SELinux with GFS2 is complicated by the fact that updates to SELinux file labels on a GFS2 file system are currently not cluster coherent.

This means that if one node changes the SELinux context of a file on a GFS2 file system, other cluster nodes that have that file system mounted may continue using the old context on that file indefinitely. This is somewhat tricky to resolve, and the issue is currently being tracked at bugzilla.redhat.com as bug #437984.

Due to this issue, it may be beneficial to not write SELinux labels to individual files on a GFS2 file system. Due to the way in which GFS2 stores file xattrs, updating those labels may result in a performance penalty specific to GFS2. This is likely to be most noticeable with workloads that involve many small files. One approach that may help to work around this while still using SELinux is to take advantage of the mount option context= to set the context of all files on that GFS2 file system to a particular value when mounted. This will avoid xattr lookups and writes. Alternatively, other steps might be taken to ensure that file labels are not changed on the file system while it is mounted by multiple nodes.

If SELinux labels are not changed on files, then SELinux in enforcing mode will otherwise function normally with GFS2 file systems, and Red Hat does test GFS2 file systems and the entire cluster stack with SELinux enforcing on.

Note: Red Hat recommends that customers using GFS2 in a cluster deployment contact Red Hat for an architectural review to ensure that the planned cluster configuration is supportable. GFS2 is fully supported, but it is not suitable for all environments and workloads. It is best to consult with Red Hat about architecture and intended use of the file system before proceeding.
How to Create a GFS2 Formatted Cluster File System
Managing a GFS2 File System – Adding journals tp GFS2, extending and repairing GFS2
How to configure a GFS2 Pacemaker cluster resource

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Fedora, Linux, pacemaker

Some more articles you might also be interested in …

  1. Why Does a Lun World Wide ID Starts with the Number 3 in Linux dm-multipath
  2. CentOS / RHEL : How to configure an DHCP server
  3. CentOS / RHEL : How to delete LVM volume
  4. Troubleshooting “connection refused” From Remote Servers in CentOS/RHEL 7 (Either Firewalld or iptables service issue)
  5. How to merge 2 volume groups (VGs) into one using vgmerge in LVM
  6. iSCSI connection command examples (Cheat Sheet)
  7. CentOS / RHEL : How to remove used Physical Volume(PV) from Volume Group (VG) in LVM
  8. The /var/log/messages is empty, and so are the rotated log files such as messages.0, messages.1
  9. UNIX / Linux : How to change the niceness (priority) of a process
  10. Unable To Remove Files From Directory with Error “Argument list too long”

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle Database – Configuring Secure Application Roles
  • Extend rule sets by using factors in Oracle Database Vault
  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary