Professional Documents
Culture Documents
Cluster File Systems: Section 10
Cluster File Systems: Section 10
SECTION 10
With a cluster file system it is possible to share a file system between systems. In the cluster jargon these systems are called nodes. Cluster file systems are also known as shared disk file systems. The benefit of these file systems is that data is still available to the remaining nodes if one node fails. Cluster file systems are routinely used in high availability environments. Different cluster file systems are available for Linux, the best known are:
OCFS (Oracle Cluster File System) GPFS (General Parallel File System) GFS (Global File System) LUSTRE
Objectives
1. 2.
Version 1
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
10-1
Objective 1
10-2
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Version 1
Objective 2
OCFS2 Background OCFS2 Configuration OCFS to OCFS2 Migration GFS - OCFS2 Comparison Table
OCFS2 Background
OCFS2 is a cluster file system that was released by Oracle as Open Source software under the GPL in 2005. Contrary to its predecessor OCFS, released in 2002, it is now a general-purpose cluster file system that is suitable as a storage base for a more widespread type of scenarios than deploying Oracle Real Application Cluster (RAC) only. In SUSE Linux Enterprise Server 10 it can, for instance, be used to give several hosts access to XenVM loopback disk images. Thanks to OCFS2 virtual machines can be relocated from host to host. Novell has integrated OCFS2 version 1.0.8 into SLES 9 SP2, version 1.2.1 into SP3 and SLES 10. As OCFS2 has been included into the mainline Linux kernel starting with version 2.6.16, probably more Linux distributions will integrate OCFS2 in the future. All OCFS2 versionsstarting with version 1.0are on-disk compatible, but their corresponding tools are not. So take care to upgrade them together, and access the cluster filesystem only with management tools that are at the same level as the kernel driver. On SLES10 it is possible to set up an OCFS2 from the command line or with the shipped OCFS console which provides a GUI.
Version 1
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
10-3
POSIX compliant Support for multiple CPU architectures as it is endian-safe. Thread-safe, asynchronous I/O, metadata and data caching provides high performance. Lockless node-local allocation area enables fast creation of new files. Extents-based; allocates metadata groups automatically, no fixed inode limit. Direct I/O to bypass local OS cache. Fully integrated with the Heartbeat 2 cluster solution in SUSE Linux Enterprise Server 10. OCFS2 is certified for Oracle 9iR2, 10g, 10gR2 RAC on RHEL4, SLES 9 SP3 and SLES 10.
OCFS2 Configuration
The following sample configuration assumes that the OCFS2 resides on the device sda. To be able to share this device between nodes, this device could be made available using iSCSI as covered in Section iSCSI on page 9-1.
To avoid having the storage device as a possible single point of failure, which would thwart the purpose of a HA cluster, the storage device should include HA features as well. DRBD (Distributed Replicated Block Device) and Heartbeat could be used for this purpose; configuration of DRBD and Heartbeat is, however, beyond the scope of this course.
10-4
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Version 1
Most of the following steps to configure OCFS2 need to be taken on every node:
1.
Create SSH keys for graphical OCFS2 frontend ocfs2console. To facilitate the configuration on the different nodes, one usually uses ssh keys. Keys are generated by the command ssh-keygen. The option -N creates a key without a passphrase. ssh-copy-id is a script that adds the public key to the .ssh/authorized_keys file on the destination computer.
da10:~ # ssh-keygen -t rsa -N ""; Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): <ENTER> Created directory '/root/.ssh'. Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: cb:1e:a9:7b:08:a7:82:d5:24:fc:90:49:cc:84:d6:a7 root@da10 da10:~ # ssh-copy-id -i ~/.ssh/id_rsa.pub root@da11; da10:~ # ssh-copy-id -i ~/.ssh/id_rsa.pub root@da12; ...
2.
Install the OCFS2 packages. Use the YaST Software Management module or the command yast -i ocfs2-tools ocfs2console.
Version 1
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
10-5
3.
Create /etc/ocfs2/cluster.conf The following is an example with two nodes, just adapt "node_count" if you add more.
cluster: name = mycluster node_count = 2 node: name = da10 cluster = mycluster number = 0 ip_address = 10.0.0.10 ip_port = 7777 node: name = da11 cluster = mycluster number = 1 ip_address = 10.0.0.11 ip_port = 7777
Instead of the hostname, name could also be the fully qualified domain name; name resolution has to work.
4.
Create an OCFS2 on the shared block device. This is only done on one node. Take care that you use the same label as in the cluster configuration file (this is mycluster in the example above). The command to create an OCFS2 file system is mkfs.ocfs2. Entering the command without options gives a brief syntax overview:
da3:~ # mkfs.ocfs2 Usage: mkfs.ocfs2 [-b block-size] [-C cluster-size] [-N number-of-node-slots] [-T filesystem-type] [-L volume-label] [-J journal-options] [-HFqvV] device [blocks-count]
10-6
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Version 1
5.
Add an entry in /etc/fstab. The following is done on all nodes and assumes that the device (/dev/sda in this example) is the same on all nodes
/mnt
ocfs2
defaults
Version 1
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
10-7
6.
Configure the OCFS2 cluster services. Make sure that Cluster to start on boot is the same as the entry in /etc/ocfs2/cluster.conf
da10:~ # /etc/init.d/o2cb configure Configuring the O2CB driver. This will configure the on-boot properties of the O2CB driver. ... Load O2CB driver on boot (y/n) [y]: <ENTER> Cluster to start on boot (Enter "none" to clear) [mycluster]: <ENTER> Use user-space driven heartbeat? (y/n) [n]: <ENTER> Writing O2CB configuration: OK
7.
Start the storage cluster services automatically. The following commands create the links in /etc/init.d/rcx.d/ needed to start the services at boot time.
10-8
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Version 1
8.
Start the OCFS2 cluster services manually and mount the OCFS2. The following commands start the services needed for ocfs2:
da10:~ # /etc/init.d/o2cb start; Loading module "configfs": OK Mounting configfs filesystem at /sys/kernel/config: OK Loading module "ocfs2_nodemanager": OK Loading module "ocfs2_dlm": OK Loading module "ocfs2_dlmfs": OK Mounting ocfs2_dlmfs filesystem at /dlm: OK Starting cluster mycluster: OK da10:~ # /etc/init.d/ocfs2 start Starting Oracle Cluster File System (OCFS2)
done
The second command mounts the file system. Use the command mount to see the result.
9.
10. Stop the OCFS2 cluster services manually and unmount the
done
Version 1
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
10-9
You should also familiarize yourself with the graphical OCFS2 frontend ocfs2console which allows to adminster different aspects of OCFS2. Figure 10-1
Figure 10-2
10-10
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Version 1
If the old cluster file system is still online you can replicate it to the new one via the network. You have to ensure that there are no changes to the old OCFS storage cluster after the last replication; during the migration you need double SAN capacity. Oracle provides the FSCat tools that can read OCFS disk images in userland. Using these tools on an OCFS2 cluster node, you can extract your OCFS backup into the OCFS2 mountpoint.
Version 1
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
10-11
Max. supported notes Max. file name length Max. path length Block size Cluster size Max. file size Max. fs size Volume manager Lock manager Cluster manager Shared block devices
256 255 unlimited 512 B - 4 KB 2 TB / 16 TB / 8 EB 2 TB / 16 TB / 8 EB LVM2 + CLVM GULM, kernel DLM CMAN GNBD, FC, iSCSI
Online/Offline resizing grow/User/Group quotas Multipath Direct I/O yes/yes yes yes
10-12
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Version 1
Exercise 10-1
Set up an OCFS2 The purpose of this exercise is to familiarize you with OCFS2. This exercise builds on the previous one, Set up an iSCSI Target and an iSCSI initiator on page 9-23. You will find this exercise in the workbook.
(End of Exercise)
Version 1
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
10-13
Summary
Objective
1. Global File System (GFS)
Summary Under RHEL, primarily GFS (Global File System) is used as cluster file system. OCFS2 is the cluster file system used under SUSE Linux Enterprise Server 10. The configuration is contained in /etc/ocfs2/cluster.conf; the program to create the file system is mkfs.ocfs2. The clustering functionality is provided by the services o2cb and ocfs2.
10-14
Copyright 2007 Novell, Inc. Copying or distributing all or part of this manual is protected by a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license.
Version 1