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. Red Hat supports 8 EBS volumes assembled into a software RAID 0 array for use as a single brick.
Important
Single EBS volume exhibits inconsistent I/O performance. Red Hat supported configuration is 8 Amazon EBS volumes of equal size on software RAID 0 (stripe) attached to a brick enables consistent I/O performance. You can create a brick ranging from 8 GB to 8 TB. For example, if you create a brick of 128 GB, you must create 8 Amazon EBS volumes of size 16 GB each and then create RAID 0 (stripe). Other configurations are not supported by Red Hat.
To add EBS volumes and provision storage
- Create an EBS volume using the following command:
# ec2-create-volume -s SIZE -z ZONEFor example,# ec2-create-volume -s 16 -z us-east-1a vol-239289
This command creates a volume of 16 GB and returns the volume ID. - Use the generated volume ID to attach the created volume to an existing Red Hat Storage instance, using the following command:
# ec2-attach-volume volumeid -i instanceid -dDEVICEFor example,# ec2-attach-volume vol-239289 -i i-343833 -d /dev/sdf1The device/dev/sdf1appears as/dev/xvdf1in the instance.Important
You must repeat the above steps to add remaining 7 Amazon EBS volumes to the existing instances. - Amazon EBS volumes are assembled in to a RAID volume in support of configuration as a brick. Assemble software RAID 0 (stripe) using the following command:
# mdadm --createarrayname--level=0 --raid-devices=8list of all devicesFor example, to create a software raid of eight volumes# mdadm --create /dev/md0 --level=0 --raid-devices=8 /dev/xvdf1 /dev/xvdf2 /dev/xvdf3 /dev/xvdf4 /dev/xvdf5 /dev/xvdf6 /dev/xvdf7 /dev/xvdf8# mdadm --examine --scan > /etc/mdadm.conf - Tag the attached EBS volumes using the following command:
ec2-create-tags VOLID \--tag Domain=gluster \--tag Device=DEVICE \--tag Instance=INSTANCE_ID\--tag Array=UUIDTable 16.1. Field Description
Variable Description VOLID EBS volume ID DEVICE Device path of the EBS volume in the instance INSTANCE_ID Instance Id to which the volume is attached UUID UUID of the array device. You can obtain the UUID of the array device by running # mdadm --detailcommand.DEVICE| grep UUIDFor example, to tag/dev/xvdf1device, run the following command:# ec2-create-tags vol-239289 \ --tag Domain=gluster \ --tag Device=/dev/xvdf1 \ --tag Instance=i-343833 \ --tag Array=e35641fc:621a9fa8:276a0ee4:a1bc6b5f
Repeat Step 4 to tag all eight EBS volumes. - Create a LVM Logical Volume (LV) by running the following commands:
# pvcreate/dev/md0# vgcreateglustervg /dev/md0# vgchange -a yglustervg# lvcreate -a y -l 100%VG -nglusterlv glustervgHereglustervgis the name of the volume group andglusterlvis the name of the logical volume. This LVM logical volume created over EBS RAID volumes is used as Red Hat Storage bricks.For more information on creating LVM, refer to https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/index.html. - Format the LVM LV using the following command:
# mkfs.xfs -i size=512DEVICEFor example, to format/dev/glustervg/glusterlvrun the following command:# mkfs.xfs -i size=512 /dev/glustervg/glusterlv - Mount the device using the following commands:
# mkdir -p /export/glusterlv# mount /dev/glustervg/glusterlv /export/glusterlv - Add the device entry to
/etc/fstabto mount the device automatically on every reboot. Run the following command to automatically add the device entry tofstab# echo "/dev/glustervg/glusterlv /export/glusterlv xfs defaults 0 2" >> /etc/fstab
After you provision the storage, you can now use the mount point as brick with existing volumes or create new volumes. For more information on creating volumes, see Chapter 8, Setting up Red Hat Storage Volumes