Home [Hosting HPC in Azure] 2.2 -- MySQL Flexible Server
Post
Cancel

[Hosting HPC in Azure] 2.2 -- MySQL Flexible Server

How to Deploy a MySQL Flexible Server?

Create MySQL Flexible Server

  1. Go to Azure Portal -> MySQL Flexible Server -> Advance Create

  2. Basic information:

    At the time I was setting up the MySQL server, the smaller compute engine ran out. This lead to deployment failure. So I set up the MySQL server in different region, and then do VNet peering.

    • When picking the region, make sure the region you select provide this service. If there is no VMs, then Azure won’t notify you until you get deployment failure. (Which is horrible.)
      1
      2
      
       az provider show -n Microsoft.DBforMySQL --query "resourceTypes[?resourceType=='flexibleServers'].locations"
       az mysql flexible-server list-skus --location <location> -o yaml
      
    • In Authentication, choose MySQL authentication only. Remeber the administrator login and password, they are the Database user and Database password.
  3. Networking:

    FormHow to
    Connectivity methodPrivate access
    Database port3306 (set by default)
    Virtual networkVNet and Subnet for MySQL Flexible Server
    SubnetVNet and Subnet for MySQL Flexible Server
  4. Private DNS integration:

    FormHow to
    Private DNS zoneLet Azure create new one

VNet and Subnet for MySQL Flexible Server

After creating the VNet, Add a subnet:

FormHow to
Subnet purposeDefault
Namemysql-subnet
Subnet DelegationSelect Microsoft.DBforMySQL/flexibleServers

Make sure the VNet this MySQL server is at can do peering with the VNet where the cluster is, if MySQL server and the cluster are not in the same VNet.

It is best that we create the VNet and subnet in a separate window and make sure it can do peering (See VNet peering).

Create Database for the Cluster

  1. Go to Azure Portal -> MySQL Flexible Server, select the server and go to Databases -> Add

  2. Create a database, and get the Databases name

Make Sure Private DNS Can be Searched in the VNet

Go to Azure Portal -> Private DNS Zones -> Virtual Network Links -> Add

  • Select the virtual network
  • Enable auto registration

Log in to scheduler, and make sure we can find the private DNS of the MySQL flexible server:

1
nslookup <private dns>

Download SSL Certificate

Go to Azure Portal -> MySQL Flexible Server -> Networking -> Download SSL Certificate (name.crt.pem)

Upload the certificate and rename it to /sched/<cluster-name>/AzureCA.pem.

We need this when setting up Slurm.

Change Server Parameter

Go to Azure Portal -> MySQL Flexible Server -> Server Parameters

The recommended value (see Slurm Doc):

ParameterValue
innodb_buffer_pool_size5% ~ 50% of the available memory on the SQL server, or at least 4GB.
innodb_lock_wait_timeout900 seconds to allow some potentially extended queries
This post is licensed under CC BY 4.0 by the author.