11

MySQL Database Service Replication: easy deployment with Terraform

 2 years ago
source link: https://blogs.oracle.com/mysql/mysql-database-service-replication%3a-easy-deployment-with-terraform
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

MySQL Database Service Replication: easy deployment with Terraform

Recently, we discovered how to setup Disaster Recovery in OCI MySQL Database Service using inbound/outbound replication.

In this article we will see how we can deploy MDS replication architecture very easily using Terraform and OCI Resource Manager.

The current modules available as example on my github (https://github.com/lefred/oci-mds-multi-region) allows you to deploy architectures like these:

We can deploy replica for a single MySQL Instance or for a MySQL HA Instance.

Let’s see how do deploy such solution using OCI Resource Manager Stack.

To start, just click on this button below:

This will open the OCI dashboard console and load the Terraform modules. You need to acknowledge the Oracle Terms of Use:

And you can provide a different name if you want:

Then we need to fill the required variables, only 5 !

For this example, I will create 2 MDS instances. The Source will be in London and the Replica in Amsterdam:

selection_047.png

I’m fine with the proposed shape selection, so I leave the default values:

selection_048.png

After clicking on Next, I can see the summary and I just click on Create:

selection_049.png

Now, I need to wait while all resources are provisioned in OCI…

selection_050.png

After a while, we will get something like this if all succeeded:

selection_051.png

In the outputs section, we can see the necessary information to connect to our system:

selection_052.png

As you can see, a compute instance with MySQL Shell is also deployed on each region.

In this example, if we go in the Amsterdam region, we can see a MDS instance having an active replication channel from London:

selection_053.png

As you can see, it was very easy to deploy such architecture with a connection between 2 regions in OCI and enable MySQL replication and it took about 8 minutes only:

selection_054.png

In the next article, I will show you how to deploy an architecture like this using Terraform manually from your laptop.

Enjoy MySQL and MySQL Database Service on OCI !


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK