SQL Server High Availability Instances for Linux on Azure Quick Start Guide
This quick start guide describes how to set up and configure a Microsoft SQL Server HA (FCI) with shared disk solution for DxEnterprise running in Azure. Using this guide, the user will create an availability set and virtual machines, configure Azure shared disks, and create and configure an Azure load balancer that will allow access to the resources assigned to the DxEnterprise Vhost.
Setup Virtual Machines
Create the Availability Set
Log in to the Azure Management Portal.
Search for Availability Sets using the top search bar, then select Add.
Assign the availability set to a resource group and give it a name.
Select Review + Create in the bottom-left corner, then select Create.
Create the Virtual Machines
Search for DxEnterprise in the top search bar and select one of the DxEnterprise offers available under Marketplace.licensing
DxEnterprise for Availability Groups (AGS) comes pre-configured with a pay-as-you-go license. If you do not want to use that image, select DxEnterprise (BYOL) instead.
For BYOL images, a valid DxEnterprise license will be required later in this guide. A fully featured Developer Edition is available free for non-production use. To purchase DxEnterprise software for production workloads, visit the DH2i Store.
Under Select a software plan, choose an operating system and select Create.
Configure a virtual machine template and assign it to the availability set.
Assign the VM to the same resource group as the availability set and give it a name.
Under Instance Details > Availability options, select Availability set.
A new drop-down box will appear. Select the availability set created in step 4 of the previous section.
Set up an authentication type.
Under Networking, select Create New and set the SKU of the public IP address to standard.caution
There is an option under network settings to place the virtual machine behind an existing load balancing solution. Do not select this option.
Select Review + Create, then Create.
Repeat steps 1-3 for any additional VMs.
The availability set has been created with VMs assigned to it. Return to the Azure homepage by selecting Microsoft Azure in the top-left corner.
Setup DxEnterprise and Install SQL Server
Reference the Azure Marketplace Image for Linux Quick Start Guide for instructions on starting DxEnterpise, activating a node, and creating a cluster.
Install Microsoft SQL Server on each node.
This section describes how to present storage to the cluster nodes. DxEnterprise supports any storage that is SCSI-3 Persistent Reservation compliant. The examples provided below are specific to Azure Shared Disks.
Please ensure proper presentation of storage to nodes. If storage not managed by the DxEnterprise cluster is presented to the nodes, it is possible to overwrite or corrupt data held on that storage.
Create and Configure Azure Shared Disk
On July 16, 2020, Microsoft announced the general availability of Azure Shared Disks. Azure Shared Disks is the industry’s first shared block storage in the cloud. Azure Shared Disks are available both on Ultra Disks and Premium SSDs.
There are various limitations for Azure disks that can be used as shared disks. For example, the VMs and the disks must be residing in the same Availability Zone for regions that support Availability Zones, Availability Sets, or Proximity Placement Groups. It is important to provision resources appropriately as they cannot be changed after creation.
Before an Azure shared disk can be used, the VMs must have its Ultra disk feature enabled. From the Azure Portal, go to the Disk property for each VM and enable Ultra Disk Compatibility.tip
The ultra disk feature can also be enabled via the Azure CLI:
az vm update -g <resource_group> -n <vm_name> --set additionalCapabilities.ultraSSDEnabled=1
To deploy an Azure disk (e.g. Ultra Disk) as a shared disk that is shareable across multiple VMs, modify the
max-sharesparameter to a value greater than 1.
az disk create -g <resource_group> -n <disk_name> --size-gb <desired_size> -l <location> --sku UltraSSD_LRS --max-shares <number_of_VMs_sharing>
Once the shared disk is created with
max-sharesset to a value greater than 1, it can be attached to the VMs via the Azure CLI:
az vm disk attach --resource-group <resource_group> --vm-name <vm_name> --name <disk_name>
Configure Disks in DxEnterprise
DxEnterprise leverages native file system (NTFS/ext4/xfs) and shared storage technology to coordinate access to a pool of disk resources in the cluster. Managing a disk puts that disk under DxEnterprise control.
To manage a disk, use the command
dxcli get-diskscan be used to look up a
dxcli add-disk 50842140-be32-d3a7-45d4-3999bf3ad3a8 "Cluster Disk 1"
Create a volume on the managed disk using the command
dxcli create-volume 50842140-be32-d3a7-45d4-3999bf3ad3a8,1073741824
Format a volume on the managed disk using the command
dxcli get-disk-detail <disk_label>may be used to look up a volume ID of interest.
dxcli format-volume 3409ed39-60c1-4f49-8186-dfface26e2a1 EXT4 Volume1 4096 quick_format:true compression:false
Assign a mount point to the volume using the command
dxcli set-mountpoint 3409ed39-60c1-4f49-8186-dfface26e2a1 /mnt/volume1
Create and Configure a DxEnterprise Vhost
DxEnterprise uses Virtual Hosts (Vhosts) to provide failover support and high availability. A Vhost virtualizes the network name and IP address associated to a particular SQL Server Instance, file share, and/or service. Instead of using the network name and IP address of a physical server, a Vhost is created and assigned a unique name/virtual IP-address pair. Clients access the databases associated with an instance via the Vhost name or IP address; they do not need to know which node is running the SQL instance.
To add a Vhost to the DxEnterprise cluster, use the command
When a Vhost is configured, the user will need to specify at least one node to participate in the Vhost. It is recommended to create A and PTR records for each Vhost in DNS for resolution as well as add Vhost entries to each node’s local hosts file.
dxcli cluster-add-vhost vhost1 192.168.1.10 dxemssql1,dxemssql2
Assign the disks to the Vhost using the command
A diskgroup is a logical set of disks that are added to a Vhost. When a disk is added to a Vhost diskgroup, the disk will be set online on the active node and offline on all other nodes. If there is a failure of a disk within the diskgroup, the Vhost will failover onto the next available node in the cluster.
dxcli vhost-set-diskgroup VHOST1 50842140-be32-d3a7-45d4-3999bf3ad3a8
OPTIONAL: Encrypt the SQL Server sysadmin password for DxEnterprise using the
dxcli encrypt-text. The encrypted password will be used to add the SQL instance in the next step.note
This step is only required if the SQL Server sysadmin (SA) account credentials will be provided in the next step.
dxcli encrypt-text p@ssw0rd
Add a SQL instance to the Vhost using the command
Assigning a SQL Server instance to a Vhost creates a managed instance. When a SQL Server instance is added to a Vhost, DxEnterprise virtualizes the network name and IP address associated with the SQL Server instance creating a Virtual SQL Server instance. Clients can then access the Virtual SQL Server instance via the Vhost\instance name.
dxcli add-instance vhost1\mssqlserver 1433 /mnt/volume1/data /mnt/volume1/log sa 6pnFaDrRS+W/F+dkRuPKAA==
Optional: Configure an Azure Load Balancer
To configure an Azure Load Balancer, please see the Azure Load Balancer Quick Start Guide.