Show Table of Contents
2.3. Provisioning Storage
Amazon Elastic Block Storage (EBS) is designed specifically for use with Amazon EC2 instances. Amazon EBS provides storage that behaves like a raw, unformatted, external block device. This section provides step-by-step instructions to provision storage for arbitrated replicated volumes, three-way replicated volumes, and two-way replicated volumes.
- 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.
- Log in to Amazon Web Services at http://aws.amazon.com and select the tab.
- Create a physical volume (PV) by using the
# 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
# 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.3, 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 /export/mountlv # mount -t xfs -o inode64, noatime /dev/rhgs_vg/rhgs_lv /export/mountlv
- Mount the file system automatically with /etc/fstab:
# /dev/rhgs_vg/rhgs_lv /export/mountlv xfs rw,inode64,noatime,nouuid 0 0
After adding the EBS volumes, you can use the mount point as a brick with existing and new volumes. If you want to create arbitrated replicated volumes or three-way replicated volumes, you must use EBS volume type comprising general purpose SSD or PIOPS SSD. For more information on creating two-way replicated volumes, arbitrated replicated volumes, and three-way replicated volumes, see chapter Red Hat Gluster Storage Volumes in the Red Hat Gluster Storage Administration Guide.