23.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.
Important
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.
23.3.1. Provisioning Storage for Two-way Replication Volumes Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The supported configuration for two-way replication is upto 24 Amazon EBS volumes of equal size, attached as a brick, which enables consistent I/O performance.
Single EBS volumes exhibit inconsistent I/O performance. Hence, other configurations are not supported by Red Hat.
To Add Amazon Elastic Block Storage Volumes
- Login to Amazon Web Services at http://aws.amazon.com and select the tab.
- In the select the option to add the Amazon Elastic Block Storage Volumes
- Create a thinly provisioned logical volume using the following steps:
- Create a physical volume (PV) by using the
pvcreatecommand.For example:pvcreate --dataalignment 1280K /dev/sdb
pvcreate --dataalignment 1280K /dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
- Here,
/dev/sdbis a storage device. This command has to be executed on all the disks if there are multiple volumes. For example:pvcreate --dataalignment 1280K /dev/sdc /dev/sdd /dev/sde ...
# pvcreate --dataalignment 1280K /dev/sdc /dev/sdd /dev/sde ...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.
Use the correctdataalignmentoption based on your device. For more information, see Section 13.2, “Brick Configuration” - Create a Volume Group (VG) from the PV using the
vgcreatecommand:For example:vgcreate --physicalextentsize 128K rhs_vg /dev/sdb
vgcreate --physicalextentsize 128K rhs_vg /dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Here,/dev/sdbis a storage device. This command has to be executed on all the disks if there are multiple volumes. For example:vgcreate --physicalextentsize 128K rhs_vg /dev/sdc /dev/sdd /dev/sde ...
vgcreate --physicalextentsize 128K rhs_vg /dev/sdc /dev/sdd /dev/sde ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a thin-pool using the following commands:
- Create an LV to serve as the metadata device using the following command:
lvcreate -L metadev_sz --name metadata_device_name VOLGROUP
lvcreate -L metadev_sz --name metadata_device_name VOLGROUPCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvcreate -L 16776960K --name rhs_pool_meta rhs_vg
lvcreate -L 16776960K --name rhs_pool_meta rhs_vgCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create an LV to serve as the data device using the following command:
lvcreate -L datadev_sz --name thin_pool VOLGROUP
lvcreate -L datadev_sz --name thin_pool VOLGROUPCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvcreate -L 536870400K --name rhs_pool rhs_vg
lvcreate -L 536870400K --name rhs_pool rhs_vgCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a thin pool from the data LV and the metadata LV using the following command:
lvconvert --chunksize STRIPE_WIDTH --thinpool VOLGROUP/thin_pool --poolmetadata VOLGROUP/metadata_device_name
lvconvert --chunksize STRIPE_WIDTH --thinpool VOLGROUP/thin_pool --poolmetadata VOLGROUP/metadata_device_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvconvert --chunksize 1280K --thinpool rhs_vg/rhs_pool --poolmetadata rhs_vg/rhs_pool_meta
lvconvert --chunksize 1280K --thinpool rhs_vg/rhs_pool --poolmetadata rhs_vg/rhs_pool_metaCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
By default, the newly provisioned chunks in a thin pool are zeroed to prevent data leaking between different block devices. In the case of Red Hat Gluster Storage, where data is accessed via a file system, this option can be turned off for better performance.lvchange --zero n VOLGROUP/thin_pool
lvchange --zero n VOLGROUP/thin_poolCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvchange --zero n rhs_vg/rhs_pool
lvchange --zero n rhs_vg/rhs_poolCopy to Clipboard Copied! Toggle word wrap Toggle overflow
- Create a thinly provisioned volume from the previously created pool using the
lvcreatecommand:For example:lvcreate -V 1G -T rhs_vg/rhs_pool -n rhs_lv
lvcreate -V 1G -T rhs_vg/rhs_pool -n rhs_lvCopy to Clipboard Copied! Toggle word wrap Toggle overflow It is recommended that only one LV should be created in a thin pool.
- Format the logical volume using the following command:
mkfs.xfs -i size=512 DEVICE
# mkfs.xfs -i size=512 DEVICECopy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to format/dev/glustervg/glusterlv:mkfs.xfs -i size=512 /dev/glustervg/glusterlv
# mkfs.xfs -i size=512 /dev/glustervg/glusterlvCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the device using the following commands:
mkdir -p /export/glusterlv mount /dev/glustervg/glusterlv /export/glusterlv
# mkdir -p /export/glusterlv # mount /dev/glustervg/glusterlv /export/glusterlvCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Using the following command, add the device to
/etc/fstabso that it mounts automatically when the system reboots:echo "/dev/glustervg/glusterlv /export/glusterlv xfs defaults 0 2" >> /etc/fstab
# echo "/dev/glustervg/glusterlv /export/glusterlv xfs defaults 0 2" >> /etc/fstabCopy to Clipboard Copied! Toggle word wrap Toggle overflow
After adding the EBS volumes, you can use the mount point as a brick with existing and new volumes. For more information on creating volumes, see Chapter 6, Red Hat Gluster Storage Volumes.
23.3.2. Provisioning Storage for Three-way Replication Volumes Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Red Hat Gluster Storage supports synchronous three-way replication across three availability zones. The supported configuration for three-way replication is upto 24 Amazon EBS volumes of equal size, attached as a brick, which enables consistent I/O performance.
- Login to Amazon Web Services at http://aws.amazon.com and select the tab.
- Create three AWS instances in three different availability zones. All the bricks of a replica pair must be from different availability zones. For each replica set, select the instances for the bricks from three different availability zones. A replica pair must not have a brick along with its replica from the same availability zone.
- Add single EBS volume to each AWS instances
- Create a thinly provisioned logical volume using the following steps:
- Create a physical volume (PV) by using the
pvcreatecommand.For example:pvcreate --dataalignment 1280K /dev/sdb
pvcreate --dataalignment 1280K /dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
- Here,
/dev/sdbis a storage device. This command has to be executed on all the disks if there are multiple volumes. For example:pvcreate --dataalignment 1280K /dev/sdc /dev/sdd /dev/sde ...
pvcreate --dataalignment 1280K /dev/sdc /dev/sdd /dev/sde ...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.
Use the correctdataalignmentoption based on your device. For more information, see Section 13.2, “Brick Configuration” - Create a Volume Group (VG) from the PV using the
vgcreatecommand:For example:vgcreate --physicalextentsize 128K rhs_vg /dev/sdb
vgcreate --physicalextentsize 128K rhs_vg /dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Here,/dev/sdbis a storage device. This command has to be executed on all the disks if there are multiple volumes. For example:vgcreate --physicalextentsize 128K rhs_vg /dev/sdc /dev/sdd /dev/sde ...
vgcreate --physicalextentsize 128K rhs_vg /dev/sdc /dev/sdd /dev/sde ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a thin-pool using the following commands:
- Create an LV to serve as the metadata device using the following command:
lvcreate -L metadev_sz --name metadata_device_name VOLGROUP
lvcreate -L metadev_sz --name metadata_device_name VOLGROUPCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvcreate -L 16776960K --name rhs_pool_meta rhs_vg
lvcreate -L 16776960K --name rhs_pool_meta rhs_vgCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create an LV to serve as the data device using the following command:
lvcreate -L datadev_sz --name thin_pool VOLGROUP
lvcreate -L datadev_sz --name thin_pool VOLGROUPCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvcreate -L 536870400K --name rhs_pool rhs_vg
lvcreate -L 536870400K --name rhs_pool rhs_vgCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a thin pool from the data LV and the metadata LV using the following command:
lvconvert --chunksize STRIPE_WIDTH --thinpool VOLGROUP/thin_pool --poolmetadata VOLGROUP/metadata_device_name
lvconvert --chunksize STRIPE_WIDTH --thinpool VOLGROUP/thin_pool --poolmetadata VOLGROUP/metadata_device_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvconvert --chunksize 1280K --thinpool rhs_vg/rhs_pool --poolmetadata rhs_vg/rhs_pool_meta
lvconvert --chunksize 1280K --thinpool rhs_vg/rhs_pool --poolmetadata rhs_vg/rhs_pool_metaCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
By default, the newly provisioned chunks in a thin pool are zeroed to prevent data leaking between different block devices. In the case of Red Hat Gluster Storage, where data is accessed via a file system, this option can be turned off for better performance.lvchange --zero n VOLGROUP/thin_pool
lvchange --zero n VOLGROUP/thin_poolCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:lvchange --zero n rhs_vg/rhs_pool
lvchange --zero n rhs_vg/rhs_poolCopy to Clipboard Copied! Toggle word wrap Toggle overflow
- Create a thinly provisioned volume from the previously created pool using the
lvcreatecommand:For example:lvcreate -V 1G -T rhs_vg/rhs_pool -n rhs_lv
lvcreate -V 1G -T rhs_vg/rhs_pool -n rhs_lvCopy to Clipboard Copied! Toggle word wrap Toggle overflow It is recommended that only one LV should be created in a thin pool.
- Format the logical volume using the following command:
mkfs.xfs -i size=512 DEVICE
# mkfs.xfs -i size=512 DEVICECopy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to format/dev/glustervg/glusterlv:mkfs.xfs -i size=512 /dev/glustervg/glusterlv
# mkfs.xfs -i size=512 /dev/glustervg/glusterlvCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the device using the following commands:
mkdir -p /export/glusterlv mount /dev/glustervg/glusterlv /export/glusterlv
# mkdir -p /export/glusterlv # mount /dev/glustervg/glusterlv /export/glusterlvCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Using the following command, add the device to
/etc/fstabso that it mounts automatically when the system reboots:echo "/dev/glustervg/glusterlv /export/glusterlv xfs defaults 0 2" >> /etc/fstab
# echo "/dev/glustervg/glusterlv /export/glusterlv xfs defaults 0 2" >> /etc/fstabCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Client-side Quorum
You must ensure to create each replica set of a volume in three difference zones. With this configuration, there will be no impact on the data availability even if two availability zones have hit an outage. However, when you set
client-side quorum to avoid split-brain scenarios, unavailability of two zones would make the access read-only.
For information on creating three-way replicated volumes, see Section 6.7, “Creating Distributed Replicated Volumes”. For more information on configuring client-side quorum, see Section 10.11.1.2, “Configuring Client-Side Quorum”.