MySQL Deployment in Azure

1. Access Azure Services

Log into Microsoft Azure account

  1. Access All services

2. Create Azure Database for MySQL Flexible Servers

  1. Access Databases
  2. Select Azure Database for MySQL flexible servers, [Create]

3. Select Service Type

  1. Select Flexible server, [Create]
    • Selecting this option will allow you to chose the MySQL version later on

4. Configure Flexible Server

  1. Fill the details of your Flexible Server configuration
    • Optionally, click Configure Server link in the Compute+Storage section and tune the server size according to your needs.
  2. [Next: Networking]

 

^ Note: The High availability setting should not be chosen. High availability requires GTID_MODE parameter to be enabled, which is not compatible with Metric Insights. 

5. Configure Networking

Access Networking

  1. Set Connectivity method to 'Public access (allowed IP addresses)'
  2. Click [+Add 0.0.0.0 - 255.255.255.255] to allow access to your database outside of Azure
    • If you have your own static IP or IP range on the server where the MI app will be hosted, you may fill out the Firewall rule form instead
  3. If you need access from Azure, activate the Allow public access from any Azure service within Azure to this server checkbox
  4. [Review and create], check the settings, then [Create]

6. Access Server Parameters

You will be redirected to the Overview page, once deployment is finished:

  1. [Go to resource]
  2. [Server parameters]

7. Configure Server Parameters

  1. Enter require_secure_transport in the search string, set its value to 'OFF',
  2. [Save], then choose Save without restart.

Do the same for all the parameters from the table below, according to the DB RAM size.

  • For the sql_mode parameter, additionally, uncheck NO_ZERO_IN_DATE and NO_ZERO_DATE modes.
Key RAM AMOUNT
16 GB 32 GB 64 GB
sql_mode NO_ENGINE_SUBSTITUTION
log_bin_trust_function_creators 1
performance_schema OFF
max_heap_table_size 1610612736
join_buffer_size 8388608 16777216 16777216
sort_buffer_size 8388608 8388608 8388608
table_definition_cache 8192 16384 16384
table_open_cache 16384
table_open_cache_instances 1
tmp_table_size 536870912
innodb_buffer_pool_size 4294967296 10737418240 10737418240
innodb_file_per_table 1
innodb_adaptive_hash_index 0
optimizer_search_depth 12
thread_stack 1048576
connect_timeout 10
wait_timeout 28800
innodb_open_files 2048
max_connections 400
innodb_lock_wait_timeout 600
innodb_purge_threads 1
max_allowed_packet 107341824
gtid_mode 0
require_secure_transport OFF

NOTE: See Fine-Tuning MySQL Parameters for details.

7.1. Set Low Priority Updates

It is possible to set LOW_PRIORITY_UPDATES value on the session level only. To set it for every connection to the server, please set init_connect parameter to SET LOW_PRIORITY_UPDATES=1;

NOTE: init_connect parameter can be used to change parameters that do not require SUPER pivilege(s) at the session level.

8. Restart MySQL Server

Access Overview

After all server parameters have been configured, [Restart] MySQL server.

9. Find Server Address

After the restart is completed, you can use your new database server. The server address is located under the Essentials section. Use it along with admin user login and password (see Configure Flexible Server for details) to run the installation against your Azure DB.

10. Run MI Installer

Run the MI application installation via the following command:

./installer.py --components web,seed,data-analyzer,dataprocessor,monitoring --db-hostname <Your Azure DB Hostname> --db-user <Admin User> --db-password <Admin User Password>