Friday , April 26 2024

SQL Managed Instance Setup With Azure Arc

In this article, I will be answering the question of how we can simply deploy Azure Managed Instance on the data controller we created in the previous section.

We will be using AZDATA to create a Managed Instance.

As the first step, we connect to the data controller with the following line of code.

Picture1: Data Controller Login

After successfully logging in, you can install SQL Managed Instance on kubernetes with the following line of code.

It can run fast or slow in kubernetes clusters of different sizes, but in my example, an Azure Managed instance was created in an average of 3 minutes.

Picture2: Creating Managed Instances with AZDATA

If you want to set up Managed Instance with a little more adjustment or configuration, you can use the following lines of code.

cores-limit (-cl) : Determines the number of cores to be assigned to Azure Managed Instance.

cores-request (-cr) : It allows the number of cores to be assigned and the amount of request on a GB basis.

memory-limit (-ml): Allows the amount of memory to be assigned to be determined on a GB basis.

memory-request (-mr): Allows the amount of memory to be assigned to be determined on a GB basis.

path : It allows you to specify the path information of your special json files that you will use during the installation phase.

replicas : Specifies how many replicas should be.

storage-class-backups (-scb): Allows you to select a specific kubernetes storage class for your backups.

storage-class-data (-scd) : Lets you choose a specific kubernetes storage class for your data

storage-class-data-logs (-scdl) : Allows you to select a specific kubernetes storage class for your database log files.

storage-class-logs (-scl) : Allows you to select a specific kubernetes storage class for log files.

volume-size-backups (-vsb) : It determines the size of the backup disk.

volume-size-data (-vsd): Specifies the size of the database data disk.

volume-size-data-logs (-vsdl) : Allows you to determine the disk size of the database log files.

volume-size-logs (-vsl): Your log files allow you to determine the disk size.

dev: Allows you to specify whether the Managed Instance is for development.

We saw in the picture2 notification that Managed Instace was deployed. Let’s see the managed instance list with the following line of code.

Picture3: Managed Instance – MI – List

As seen in Picture3, we can see the IP address, name, replica information and status that we will need to connect to Azure Managed Instance.

If we refresh the Data Controller screen in Azure Data Studio, we can see the Managed Instance we have created.

Picture4: MI List on ADS

When you click on the Instance information you see in Picture4, you can see that it shows us the Azure Managed Instance IP address information that we can connect to via SQL Server Management Studio or Azure Data Studio.

You can also see the IP addresses of Managed Instance’s Kibana and Grafana services. You can easily monitor Managed Instance using both Kibana and Grafana.

From here, your user login information for Kibana and Grafana is the username and password you provided when creating the data controller.

Picture5: Azure Data Studio – MI connection information

Now that we have learned the IP address of Azure Managed Instance, let’s quickly connect via sqlcmd, create a new database and view it from Azure Data Studio.

Picture6: Learning MI Version information

Let’s create a database with the following lines of code as we establish a connection and query the version information.

Picture 7: Creating the DMC database

I quickly refresh the Managed Instance screen in Azure Data Studio to check that the database is created.

Picture8: Displaying the DMC database

If you want to delete the Managed Instance we created, you can use the following line of code.

Picture9: Delete Managed Instance

Managed Instance has been deleted, but it should not be forgotten that pvc is left behind!

Picture10: list of persistent volumes

After we get the pvc list, we can use the following lines of code to perform the deletion.

Picture11: Pvc Removal Process

 

Loading

About Çağlar Özenç

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories