2.4. Provisioning Storage
- The supported configuration for a Red Hat Gluster Storage EC2 instance is up to 24 Amazon EBS volumes.
- If you are provisioning storage for three-way replicated volumes or arbitrated volumes, you must ensure to create each replica set of a volume in three different zones. With this configuration, there will be no impact on the data availability even if two availability zones have hit an outage. Client-side quorum is enabled by default and hence unavailability of two zones would make the access read-only.
- External snapshots, such as snapshots of a virtual machine/instance, where Red Hat Gluster Storage Server is installed as a guest OS or FC/iSCSI SAN snapshots are not supported.
- If you want to create arbitrated replicated volumes or three-way replicated volumes, you must use
EBSvolume type comprising general purpose SSD or PIOPS SSD.
- Create a physical volume (PV) by using the following command:
# pvcreate deviceFor example:
# pvcreate /dev/xvdd Physical volume "/dev/xvdd" successfully created.
/dev/xvddis a storage device. This command has to be executed on all the disks if there are multiple volumes. For example:
# pvcreate /dev/xvdd /dev/xvde /dev/xvdf…
- The device name and the alignment value will vary based on the device you are using.
- Create a Volume Group (VG) from the PV using the following command:
# vgcreate volume_group deviceFor example:
# vgcreate rhs_vg /dev/xvdd Volume group "rhs_vg" successfully created
/dev/xvddis a storage device. If you have multiple devices, create multiple VGs.
ImportantStarting with Red Hat Gluster Storage 3.4, Red Hat does not recommend the aggregation of multiple EBS volumes when they are consumed by a Red Hat Gluster Storage instance. Follow the steps provided in this chapter to configure Red Hat Gluster Storage in an AWS environment.
- Create a thin pool of the maximum possible size or the pool size of 0.5% of the EBS volume size:
# lvcreate --thinpool VOLGROUP/POOLNAME -l 100%FREE --chunksize chunk_size --poolmetadatasize metadata_pool_size --zero nThe maximum possible size for a metadata LV is 16 GiB. Red Hat Gluster Storage recommends creating the metadata device of the maximum supported size. You can allocate less than the maximum if space is a concern, but in this case you should allocate a minimum of 0.5% of the pool size.Example 1To create a thin pool with the maximum possible metadata device size of the maximum possible size for your device:
# lvcreate --thinpool rhs_vg/rhs_pool -l 100%FREE --chunksize 256K --poolmetadatasize 16g --zero n Using default stripesize 64.00 KiB. Logical volume "rhs_pool" created.Example 2To create 0.5% pool metadata size of the EBS volume of size of 20 GiB.
# lvcreate --thinpool rhs_vg1/rhs_pool1 -l 100%FREE --chunksize 256K --poolmetadatasize 0.1g --zero n Using default stripesize 64.00 KiB. Rounding up size to full physical extent 104.00 MiB
lvscommand to get the maximum available device space in the EBS volume. You can use the
LSizesize listed in this command while creating logical volume. This is to ensure that the entire EBS volume is used and no space is wasted.
# lvs rhs_vg LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert rhs_pool rhs_vg twi-a-t--- 1.97t 0.00 0.02
- Create a logical volume using the
LSizeobtained in the previous command to consume entire thin pool into a single LV or you can create multiple LVs from a single thin pool.
# lvcreate -V lv_size -T VOLGROUP/POOLNAME -n lv_nameExample 1Create a single LV using
LSizeobtained in the previous command to consume entire thin pool into a single LV:
# lvcreate -V 1.96T -T rhs_vg/rhs_pool -n rhs_lv Using default stripesize 64.00 KiB. Rounding up size to full physical extent 1.96 TiB Logical volume "rhs_lv" created.For thin pool auto extension activation/thin_pool_autoextend_threshold should be below 100.Example 2Create multiple LVs from the single thin pool. This example creates two LVs of size 2G from the thin pool rhs_pool1.
# lvcreate -V 2G -T rhs_vg1/rhs_pool1 -n rhs_lv Using default stripesize 64.00 KiB. Logical volume "rhs_lv" created. # lvcreate -V 2G -T rhs_vg1/rhs_pool1 -n rhs_lv1 Using default stripesize 64.00 KiB. Logical volume "rhs_lv1" created.
- Format the logical volume using the following command:
# mkfs.xfs -i size=512 -n size=8192 /VOLGROUP/POOLNAME/For example, to format
# mkfs.xfs -i size=512 -n size=8192 /dev/rhgs_vg/rhgs_lv
- Create a mount point and mount the logical device using the following commands:
# mkdir File Mount Path # mount -t xfs -o inode64,noatime Logical Volume Path File Mount PathFor example:
# mkdir /export/mountlv # mount -t xfs -o inode64,noatime /dev/rhgs_vg/rhgs_lv /export/mountlv
- Mount the file system automatically by adding the following line in the
# Logical Volume Path File Mount Path xfs rw,inode64,noatime,nouuid 0 0For example:
# /dev/rhgs_vg/rhgs_lv /export/mountlv xfs rw,inode64,noatime,nouuid 0 0