此内容没有您所选择的语言版本。
2.5. Provisioning Storage
Amazon Elastic Block Storage (EBS) is designed specifically for use with Amazon EC2 instances. Amazon EBS provides storage that works like a raw, unformatted, external block device. This section provides step-by-step instructions to provision storage for creating bricks in form of logical volumes. These bricks can be used to create different types of volumes like Gluster arbitrated replicated volumes, and Gluster three-way replicated volumes.
Important
- Starting 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.
- 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 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 are unavailable. 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 or an instance where Red Hat Gluster Storage Server is installed as a guest operating system, and Fibre Channel or iSCSI SAN snapshots, are not supported.
- 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.
- Create a physical volume (PV) by using the following command:
pvcreate device
# pvcreate device
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:pvcreate /dev/xvdd
# pvcreate /dev/xvdd Physical volume "/dev/xvdd" successfully created.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
/dev/xvdd
is 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…
# pvcreate /dev/xvdd /dev/xvde /dev/xvdf…
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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 device
# vgcreate volume_group device
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:vgcreate rhs_vg /dev/xvdd
# vgcreate rhs_vg /dev/xvdd Volume group "rhs_vg" successfully created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
/dev/xvdd
is a storage device. If you have multiple devices, create multiple VGs. - 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 n
# lvcreate --thinpool VOLGROUP/POOLNAME -l 100%FREE --chunksize chunk_size --poolmetadatasize metadata_pool_size --zero n
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The 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
# 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.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
# 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
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute
lvs
command to get the maximum available device space in the EBS volume. You can use theLSize
size 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
# 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
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a logical volume using the
LSize
obtained in the previous command to consume the 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_name
# lvcreate -V lv_size -T VOLGROUP/POOLNAME -n lv_name
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example 1Create a single LV usingLSize
obtained 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
# 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.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Format the logical volume using the following command:
mkfs.xfs -i size=512 -n size=8192 /VOLGROUP/POOLNAME/
# mkfs.xfs -i size=512 -n size=8192 /VOLGROUP/POOLNAME/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to format/dev/rhgs_vg/rhgs_lv:
:mkfs.xfs -i size=512 -n size=8192 /dev/rhgs_vg/rhgs_lv
# mkfs.xfs -i size=512 -n size=8192 /dev/rhgs_vg/rhgs_lv
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a mount point and mount the logical device using the following commands:
mkdir File Mount Path
# mkdir File Mount Path # mount -t xfs -o inode64,noatime Logical Volume Path File Mount Path
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:mkdir /export/mountlv mount -t xfs -o inode64,noatime /dev/rhgs_vg/rhgs_lv /export/mountlv
# mkdir /export/mountlv # mount -t xfs -o inode64,noatime /dev/rhgs_vg/rhgs_lv /export/mountlv
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the file system automatically by adding the following line in the
/etc/fstab
:Logical Volume Path File Mount Path xfs rw,inode64,noatime,nouuid 0 0
# Logical Volume Path File Mount Path xfs rw,inode64,noatime,nouuid 0 0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:/dev/rhgs_vg/rhgs_lv /export/mountlv xfs rw,inode64,noatime,nouuid 0 0
# /dev/rhgs_vg/rhgs_lv /export/mountlv xfs rw,inode64,noatime,nouuid 0 0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After adding the EBS volumes, you can use the mount points as bricks to be a part of existing or new volumes. For more information on creating arbitrated replicated volumes, and three-way replicated volumes, see chapter Red Hat Gluster Storage Volumes in the Red Hat Gluster Storage Administration Guide.