此内容没有您所选择的语言版本。
3.4. Setting up Red Hat Gluster Storage in Microsoft Azure in ARM Mode
This section provides step-by-step instructions to set up Red Hat Gluster Storage in Microsoft Azure in the Azure Resource Manager mode.
Note
There are two deployment modes in Microsoft Azure: Azure Service Management (ASM) mode (sometimes referred to as Azure Classic) and Azure Resource Manager (ARM) mode. The procedure in this section uses ARM mode and ARM cross-platform command-line interface (Xplat-CLI) commands to deploy a Red Hat Gluster Storage into Microsoft Azure. The Xplat-CLI commands differ slightly between these two deployment modes. If you want to set up the Red Hat Gluster Storage in Microsoft Azure using Azure Service Management (ASM) mode, refer to Section 3.6, “ Appendix - Setting up Red Hat Gluster Storage in Microsoft Azure in ASM Mode”.
To download the Red Hat Gluster Storage Server files using a Red Hat Subscription or a Red Hat Evaluation Subscription:
- Visit the Red Hat Customer Service Portal at https://access.redhat.com/login and enter your user name and password to log in.
- Click Downloads to visit the Software & Download Center.
- In the Red Hat Gluster Storage Server area, click to download the latest version of the
VHDimage. - Navigate to the directory where the file was downloaded and execute the
sha256sumcommand on the file.For example,sha256sum rhgs-azure-3.4-rhel-7-x86_64.tar.gz
$ sha256sum rhgs-azure-3.4-rhel-7-x86_64.tar.gz 2d083222d6a3c531fa2fbbd21c9ea5b2c965d3b8f06eb8ff3b2b0efce173325d rhgs-azure-3.4-rhel-7-x86_64.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow The value generated by thesha256sumutility must match the value displayed on the Red Hat Customer Portal for the file. If they are not the same, your download is either incomplete or corrupt, and you will need to download the file again. If the checksum is not successfully validated after several attempted downloads, contact Red Hat Support for assistance. - Unzip the downloaded file
rhgs-azure-[version].zipto extract the archive contents.For example,tar -xvzf rhgs-azure-3.4-rhel-7-x86_64.tar.gz
# tar -xvzf rhgs-azure-3.4-rhel-7-x86_64.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.4.2. Setting Up New Resources in Microsoft Azure 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
You must install the Azure cross-platform command-line interface (Xplat-CLI) before setting up new resources in Microsoft Azure. The steps to install the Azure Xplat-CLI and set up new resources in Microsoft Azure are provided at https://access.redhat.com/articles/2706961#install-the-azure-cross-platform-cli-2
Before you can upload the Microsoft Azure VHD, you need to have resources for the VM created in Microsoft Azure. All of the following steps are completed from your Microsoft Azure Administration Server.
- Create a resource group.
azure group create -l [azure-region] -n [resource-group]
# azure group create -l [azure-region] -n [resource-group]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a storage account. The following command sets up a few details that allow you to identify the replication option you want to use. Refer to Microsoft's Account Replication Options article at https://azure.microsoft.com/en-us/documentation/articles/storage-redundancy/
azure storage account create --sku-name [LRS, ZRS, GRS, RA-GRS] --kind [Storage, Blob Storage] -l [azure-region] -g [resource-group] [account-name]
# azure storage account create --sku-name [LRS, ZRS, GRS, RA-GRS] --kind [Storage, Blob Storage] -l [azure-region] -g [resource-group] [account-name]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,azure storage account create --sku-name LRS --kind Storage -l eastus -g rhgsarm rhgsstorage
# azure storage account create --sku-name LRS --kind Storage -l eastus -g rhgsarm rhgsstorage info: Executing command storage account create + Checking availability of the storage account name + Creating storage account info: storage account create command OKCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Get the storage account keys to use in the next step.
azure storage account keys list -g [resource-group] [account-name]
# azure storage account keys list -g [resource-group] [account-name]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow Microsoft Azure generates two keys, both of which allow access to your storage container. Microsoft Azure generates two keys for key regeneration purposes. During regeneration, you use one key for secure access, while Microsoft Azure regenerates and creates a new key. Once there is a new key, you switch to that key and regenerate the other key the next time, and so forth. This is like changing your password for your Microsoft Azure storage container. You should do this periodically, but do not do it now because you just created the two keys. For information on keys and key regeneration, refer to Microsoft's Storage Connection Strings. article at https://azure.microsoft.com/en-us/documentation/articles/storage-configure-connection-string/. - Export the key. Copy the key1 string created in the previous step and paste it in the AccountKey= file.
export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=[account-name];AccountKey=[storage-account-key]"
# export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=[account-name];AccountKey=[storage-account-key]"Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=rhgsstorage;AccountKey=ba8zt8LSUznaGX92DV1zWhj3ikrpIQEsZXxmNQcd194JaD/NgSwueVVmPfAjOMptpu3fDR/7olT2smo/9ZON+w=="
# export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=rhgsstorage;AccountKey=ba8zt8LSUznaGX92DV1zWhj3ikrpIQEsZXxmNQcd194JaD/NgSwueVVmPfAjOMptpu3fDR/7olT2smo/9ZON+w=="Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the storage container.
azure storage container create [container-name]
# azure storage container create [container-name]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the Microsoft Azure virtual network.
azure network vnet create -g [resource-group] -l [azure-region] -a [CIDR-address-prefixe-vnet] [vnet-name]
# azure network vnet create -g [resource-group] -l [azure-region] -a [CIDR-address-prefixe-vnet] [vnet-name]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the subnet for the Microsoft Azure virtual network.
azure network vnet subnet create -g [resource-group] -e [vnet-name] -a [CIDR-address-prefix-subnet] [subnet-name]
# azure network vnet subnet create -g [resource-group] -e [vnet-name] -a [CIDR-address-prefix-subnet] [subnet-name]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow Important
The storage connection key persists through the following procedure if you do not shut down your machine. If you shut down prior to completing the procedure, you need to pass your key (-k "[storage-account-key]") in the following commands. You can add your keys to a configuration file to load them each time your machine boots
3.4.3. Uploading the Disk Image to Microsoft Azure 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The disk image can be uploaded and used as a template for creating Gluster Storage nodes. To upload the image to Microsoft Azure, navigate to the directory where the VHD image is stored and run the following command:
azure storage blob upload -t page -a [account-name] --container [container-name] -b [azure-image-name].vhd [path to image-name].vhd
# azure storage blob upload -t page -a [account-name] --container [container-name] -b [azure-image-name].vhd [path to image-name].vhd
Note
This could take some time, depending on how fast your upload speeds are.
For example,
3.4.4. Deploy the Gluster Storage Instances 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Individual Gluster Storage instances in Microsoft Azure can be configured into a cluster. You must first create the instances from the prepared image and then attach the data disks.
When creating the instances, you can use the following two methods of authentication to access the instance.
- Authenticate using SSH keys
- Authenticate using password
- Create the Red Hat Gluster Storage VM.
Note
The vnic-name, public-ip-name, and public-ip-domain-name are created when you run this command. Enter the names you want to use, and they will be created when the command runs. Copy and paste the image URL from the previous step for the -Q option. The -G option generates ssh keys. Note the path to the key-pem file in the resulting displayed details. You need the path to this file to ssh in to your Azure VM.Important
Microsoft Azure virtual machine names can contain letters, digits, a period, and a hyphen. The name cannot start or end with a hyphen, cannot be composed entirely of numbers, or be longer than 512 characters. Refer to Microsoft's Recommended naming conventions for Azure resources article for additional details https://docs.microsoft.com/en-us/azure/guidance/guidance-naming-conventions.Authenticate using SSH keys- Enter the following command to create the Red Hat Gluster Storage instance and authenticate using SSH keys
azure vm create -g [resource-group] -l [azure-region] -f [vnic-name] -y [os-type] -Q [image-url] -G -z [vm-size] -i [public-ip-name] -o [storage-account-name] -R [storage-container-name] -m [public-ip-allocation-method] -w [public-ip-domain-name] -t [public-ip-idletimeout] -F [vnet-name] -j [vnet-subnet-name] -u [admin-name] -n [virtual-machine-name]
azure vm create -g [resource-group] -l [azure-region] -f [vnic-name] -y [os-type] -Q [image-url] -G -z [vm-size] -i [public-ip-name] -o [storage-account-name] -R [storage-container-name] -m [public-ip-allocation-method] -w [public-ip-domain-name] -t [public-ip-idletimeout] -F [vnet-name] -j [vnet-subnet-name] -u [admin-name] -n [virtual-machine-name]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start an SSH session and connect to the running VM using your administrator name and the public key file.
ssh -i [path-to-key-pem] [admin-name@public-ip-address]
# ssh -i [path-to-key-pem] [admin-name@public-ip-address]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,ssh -i /root/.azure/ssh/rhgs72-key.pem clouduser@rhgs72.east.cloudapp.azure.com
# ssh -i /root/.azure/ssh/rhgs72-key.pem clouduser@rhgs72.east.cloudapp.azure.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Authenticate using password- Enter the following command to create the Red Hat Gluster Storage instance and authenticate using password. You must enter the password when prompted.
azure vm create -g [resource-group] -l [azure-region] -f [vnic-name] -y [os-type] -Q [image-url] -z [vm-size] -i [public-ip-name] -o [storage-account-name] -R [storage-container-name] -m [public-ip-allocation-method] -w [public-ip-domain-name] -t [public-ip-idletimeout] -F [vnet-name] -j [vnet-
# azure vm create -g [resource-group] -l [azure-region] -f [vnic-name] -y [os-type] -Q [image-url] -z [vm-size] -i [public-ip-name] -o [storage-account-name] -R [storage-container-name] -m [public-ip-allocation-method] -w [public-ip-domain-name] -t [public-ip-idletimeout] -F [vnet-name] -j [vnet- subnet-name] -u [admin-name] -n [virtual-machine-name]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start an SSH session and connect to the running VM using your administrator name and the password used while creating the instance.
ssh [admin-name@public-ip-address]
# ssh [admin-name@public-ip-address]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,ssh clouduser@rhgs72.east.cloudapp.azure.com
# ssh clouduser@rhgs72.east.cloudapp.azure.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow
- Add a data disk to your newly created virtual machine.
azure vm disk attach-new resource-group vm-name size-in-gb
# azure vm disk attach-new resource-group vm-name size-in-gbCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Perform the above steps of creating instances and attaching disks for all the instances.
- Confirm that the instances have been properly created:
azure vm list -g [resource group]
# azure vm list -g [resource group]Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,
For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- A Microsoft Azure availability set provides a level of fault tolerance to the instances it holds, protecting against system failure or planned outages. This is achieved by ensuring instances within the same availability set are deployed across the different fault and upgrade domains within a Microsoft Azure datacenter.
- When Gluster Storage replicates data between bricks, associate the replica sets to a specific availability set. By using availability sets in the replication design, incidents within the Microsoft Azure infrastructure cannot affect all members of a replica set simultaneously.