Products/HA/DellRedHatHALinuxCluster/Cluster/Storage Cluster with CLI
From DellLinuxWiki
Dell|Red Hat HA Linux > Cluster > Storage Cluster with CLI Tools
Contents |
Configuring a Storage Cluster
The following is an example of creating a clustered logical volume for use with GFS and a shared storage array using CLI commands. For instructions on using Conga, see Configuring a Storage Cluster with Conga.
Preparing to Configure a Storage Cluster
NOTE: Ensure the cluster is functioning before proceeding. See Managing the Cluster for more information.
The following services must be running at a minimum:
[root]# service cman start [root]# service clvmd start
Creating a Partition Table
To partition shared storage:
1. Verify that the devices on each node are consistent by executing the following command:
[root]# cat /proc/partitions
All devices must be accessible from all nodes.
NOTICE: Executing the command in step 2 erases all partitions and data from your hard drive.
NOTE: Execute all commands from one cluster node only. All nodes have access to the same shared disk and the following steps must be performed one time only.
2. From one node only, set up shared storage partition.
[root@node1 ~]# parted {your shared device}
Where {your shared device} is the shared disk configured in the Storage section.
- For PowerVault MD series storage arrays using Multi-Path Proxy driver:
[root@node1 ~]# parted /dev/sdb
- For any other configuration using device-mapper-multipath:
[root@node1 ~]# parted /dev/mapper/cluster_disk
The parted interface will change the prompt:
GNU Parted 1.8.1 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted)
3. Change the partition type to GPT.
(parted) mklabel gpt
View the disk information with the print command:
(parted) print Model: DELL MD Virtual Disk (scsi) Disk /dev/sdb: 1000GB Disk geometry for /dev/sdb 0kB - 1000GB Disk label type: gpt
Creating a Partition
1. Create a partition by executing the following command. It is typical for one partition to consume the entire disk, but you may create partitions that match your needs. Create a single partition that uses the entire disk:
(parted) mkpart primary 0 -1
NOTE: The value "-1" refers to the end of the disk. Replace this with a different value as desired.
2. Set the lvm flag for the data partition. Use the set command:
(parted) set 1 lvm on
3. Verify that the partitions are set up properly:
(parted) print Disk geometry for /dev/sdb: 0kB - 1000GB For Model: DELL MD Virtual Disk (scsi) Disk /dev/sdb: 1000GB Disk label type: gpt Number Start End Size File system Name Flags 1 17.4kB 1000MB 1000MB primary lvm
4. Quit parted. The changes are saved immediately.
(parted) quit
5. Perform the following step on all nodes. Display devices and verify the partitions are visible to the kernel.
[root]# cat /proc/partitions
6. If the partitions are not visible, run the following command to update the kernel:
[root]# partprobe -s {your shared device}
Where {your shared device} is the disk where the newly-created partition is. For example:
[root]# partprobe -s /dev/sdb
To view partitions again:
[root]# cat /proc/partitions
Enable Clustered Logical Volume
NOTE: Run the following commands on all cluster nodes.
1. Enable cluster support for lvm:
[root]# lvmconf --enable-cluster
2. Restart the clustered lvm service (clvmd) by typing:
[root]# service clvmd restart
3. Ensure that clvmd starts on boot:
[root]# chkconfig clvmd on
Creating a Volume Group
NOTE: Perform the following steps from one node only.
1. Create a physical volume (pv):
[root@node1 ~]# pvcreate {your shared device partition}
Where {your shared device partition} is the newly-created partition. For example:
[root@node1 ~]# pvcreate /dev/sdb1 Physical volume "/dev/sdb1" successfully created.
NOTE: If you encounter any errors such as pvcreate failed, run the following command to rescan for partition changes:
[root]# partprobe -s
2. Create a volume group (vg):
[root@node1 ~]# vgcreate --clustered y {volume group name} {your shared device partition}
Where {volume group name} is a name of your choice to identify this volume group, and {your shared device partition} is the data partition you created. For example:
[root@node1 ~]# vgcreate --clustered y vg_cluster /dev/sdb1 Volume group vg_cluster successfully created
NOTE: If you encounter any errors such as vgcreate failed, run the following command to rescan for physical volume changes:
[root]# pvscan
Activating Clustered Volume Group
NOTE: Perform these steps on all cluster nodes.
1. Restart clvmd on all nodes to view the new volume group:
[root]# service clvmd restart
NOTE: If you encounter any errors on any nodes, you may need to run the following commands on those nodes first, then restart clvmd again:
[root]# pvscan [root]# vgscan
Creating a Clustered Logical Volume
NOTE: Perform the following steps from one node only.
1. Create a logical volume (lv):
[root@node1 ~]# lvcreate {size of logical volume} -n {logical volume name} {volume group name}
Where {size of logical volume} is one of the following options:
- -l 100%FREE (consumes all available space)
- -l {physical extents} (see man lvcreate for more info)
- -L {size} (see man lvcreate for more info)
You can create several logical volumes based on your specific applications needs, or a single one that consumes all available space.
Lastly where {logical volume name} is a name of your choice. For example:
[root@node1 ~]# lvcreate -l 100%FREE -n lv_cluster vg_cluster Logical volume "lv_cluster" created
NOTE: If you encounter any errors such as lvcreate failed, run the following command to rescan for volume group changes:
[root]# vgscan
2. Verify the lv was created successfully:
[root@node1 ~]# lvdisplay /dev/vg_cluster/lv_cluster --- Logical volume --- LV Name /dev/vg_cluster/lv_cluster VG Name vg_cluster LV UUID zcdt4M-VI2U-l9bA-h2mJ-dmfofFBE- ub3RYk LV Write Access read/write LV Status available # open 0 LV Size 1020.00 MB Current LE 255 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:2
Creating a Global File System
NOTE: For more information on configuring GFS, see the Global File System Guide on the Red Hat website at www.redhat.com/docs/manuals/enterprise or the package Global_File_System-en-US locally on each node.
Before you create a GFS:
- Gather the following information:
- {cluster name} - is listed in Conga in the Cluster tab, and is also the /etc/cluster/cluster.conf file in each node.
- {gfs filesystem name} - A unique identifier among GFS file systems.
- {number of journals} - One journal per node is required. However, at least one additional journal is recommended.
- {name of clustered logical volume} - The cluster logical volume that you created. For example /dev/vg_cluster/lv_cluster.
To create a file system:
1. From one system only execute the following command:
[root@node1 ~]# mkfs.gfs2 -t {cluster name}:{gfs filesystem name} -p lock_dlm -j {number of journales} {name of clustered logical volume}
For example:
[root@node1 ~]# mkfs.gfs2 -t my_cluster:gfs -p lock_dlm -j 3 /dev/vg_cluster/lv_cluster This will destroy any data on /dev/vg_cluster/lv_cluster. Are you sure you want to proceed? [y/n]
2. Enter <y>.
Device: /dev/vg_cluster/lv_cluster Blocksize: 4096 Device Size 272.46 GB (71424000 blocks) Filesystem Size: 272.46 GB (71423999 blocks) Journals: 3 Resource Groups: 1090 Locking Protocol: "lock_dlm" Lock Table: "my_cluster:gfs"
NOTE: If you encounter any errors, run the following command to rescan for logical volume changes:
[root]# lvscan
Continue to Managing the Cluster Infrastructure
Dell|Red Hat HA Linux > Cluster > Storage Cluster with CLI Tools