Background: Four hpdl0000g5 machines are configured with 2 4-core GB CPUs and 32 GB memory. One HPMSA2000SAS cabinet has a raid 6 with 6 TB space. The 64-bit AP version of RHEL5.1 is installed on all machines. Now we need four machines to concurrently read and write the cabinet. After fully comparing the GFS and OCFS2 cluster file systems, select GFS. Cause: GFS is more stable than OCFS2. Of course, GFS configuration is more complex than OCFS2 and is charged. OCFS2
Background: four HP dl1_g5 machines are configured with 2 4-core GB CPUs and 32 GB memory. One HP MSA2000SAS cabinet has a raid 6 with 6 TB space. The 64-bit AP version of RHEL5.1 is installed on all machines. Now we need four machines to concurrently read and write the cabinet.
After comparing the GFS and OCFS2 cluster file systems, select GFS. Cause: GFS is more stable than OCFS2. Of course, GFS configuration is more complex than OCFS2 and is charged. OCFS2 is an open-source project led by Oracle. It is free of charge and is mainly used to share a file system when it is used for RAC.
According to the project requirements, the Cabinet is divided into four partitions. In this example, the partition named upload with a capacity of 4 TB (/dev/sda) is used to store data. The LUM number is the same and is 8. Push the four shards to the four machines directly connected to the Cabinet. The data library of this project adopts Oracle10g and OCFS2 + ASM storage mechanism for RAC.
1. Manually install the GFS software package on four machines, as shown in the following figure:
Rpm-Uvh perl-Net-Telnet-3.03-5.noarch.rpm ###### (rpm package is in the Server Directory of RHEL5 mounting disk 3rd)
Rpm-Uvh openais-0.80.2-1.el5.x86_64.rpm ###### (rpm package is in the Server Directory of RHEL5 mounting disk 3rd)
Rpm-Uvh cman-2.0.60-1.el5.x86_64.rpm ###### (rpm package is in the Server Directory of RHEL5 mounting disk 3rd)
Rpm-Uvh gfs2-utils-0.1.25-1.el5.x86_64.rpm ###### (rpm package is in the Server Directory of RHEL5 mounting disk 3rd)
Rpm-Uvh gfs-utils-0.1.11-1.el5.x86_64.rpm ###### (rpm package is in the Cluster directory of RHEL5 mounting disk 6th)
Rpm-Uvh kmod-gfs-0.1.16-5.2.6.18_8.el5.x86_64.rpm ###### (rpm package is in the Cluster directory of RHEL5 mounting disk 6th)
Rpm-Uvh lvm2-cluster-2.02.16-3.el5.x86_64.rpm ###### (rpm package is in the Cluster directory of RHEL5 mounting disk 6th)
Rpm-Uvh system-config-cluster-1.0.39-1.0.noarch.rpm ###### (rpm package is in the Cluster directory of RHEL5 mounting disk 6th)
Rpm-Uvh rgmanager-2.0.23-1.x86_64.rpm ###### (rpm package is in the Cluster directory of RHEL5 mounting disk 6th)
2. Configure/etc/hosts. The host name and ip address correspond to the following:
127.0.0.1 localhost
192.168.9.61 web1
192.168.9.62 web2
192.168.9.63 rac1
192.168.9.64 rac2
3. Modify/etc/lvm. conf for each machine and change the value of locking_type from 1 to 3 by default.
4. Run system-config-cluster on web1. The procedure is as follows:
(1) Name cluster (click "Cluster" and then "" Create New Configuration ")
(2. add each Node (click "Cluster Nodes" and then click "Add a Cluster node". Here, the cluster Node name and quorum votes are web1, 1, web2, and 2, respectively; rac1, 3; rac2, 4; The host names of four machines are ordered)
(3) set the fence Device (click "Fence Devices" and then "Add a Fence Device "). Note: The fence device is used to monitor which machine is down. It is a component of the cluster kit RHCS. Because I only share the disk, I choose "Manual Fencing" and name it "webfence ".
(4. add a fence device to each Node (click the device Node name and click "Manage Fencing for This Node"; click "Add a New Fence Level "; click "Fence-Level-1", click "Add a New Fence to This Level", and finally select the fence device named webfence.
Category. Shared disk arrays, so you do not need to create any "Services" or "Resources ".
Save. Save the configuration and copy the configuration to the/etc/cluster directory of all nodes.
Summary. The full text of the configured cluster. conf is as follows:
5. Add the GFS component as auto-start. Run the following command on each machine:
Chkconfig -- add cman
Chkconfig -- add clvmd
Chkconfig -- add gfs
Chkconfig -- add rgmanager
Chkconfig -- level 345 cman on
Chkconfig -- level 345 clvmd on
Chkconfig -- level 345 gfs on
Chkconfig -- level 345 rgmanager on
You can use chkconfig -- list | grep "3: on" to view the service loading result.
6. Because cman has a bug, you need to execute the following command on each machine to create a soft link:
Ln-s/usr/sbin/cman_tool
7. Start the GFS service on web1:
Service cman start
Service clvmd start
Service gfs start
Service rgmanager start
8. fdisk cannot be used due to a 4 t partition. On web1, parted/dev/sda is required. After mklabel is output to the gpt format, perform disk operations:
Run pvscan before creating an LVM physical volume, and then:
# Pvdisplay
# Pvremove/dev/sda
Pvcreate/dev/sda
Create a volume group named gfs1:
# Vgremove gfs1
# Vgdisplay. By default, vgcreate can only create 128 GB volume groups without parameters. Here I am 4 TB, so the parameter is.
Vgcreate-s 128 gfs1/dev/sda
After creating a volume group on web1, run the following command on the other three machines:
Service cman start
Service clvmd start
Service gfs start
Service rgmanager start
Then activate the volume group:
Vgchange-ay
# Lvremove/dev/gfs1/upload
# Lvdisplay
# Vgdisplay view: Total PE = 32790.
Then, create a full logical volume named upload on web1:
Lvcreate-l 32790 gfs1-n upload
9. create and load a GFS File System (the following four nodes named gfs01 are created in the logical volume/dev/gfs1/upload under the gfs_cluster management of the cluster ), run the following command on web1:
Gfs_mkfs-p lock_dlm-t gfs_cluster: gfs01-j 4/dev/gfs1/upload
Create a mount point on four machines
Mkdir/upload
Mount/dev/gfs1/upload on four machines to the/upload directory:
Mount-t gfs/dev/gfs1/upload
Then df-h is used to check the effect.
10. set to automatically mount GFS at startup. Vi/etc/fstab, add:
/Dev/gfs1/upload gfs defaults 0 0