We all know MySQL InnoDB ClusterSet, a solution that links multiple InnoDB Clusters and Read Replicas asynchronously to easily generate complex MySQL architectures and manage them without burdensome commands. All this thanks to the MySQL Shell’s AdminAPI. This is an example of MySQL InnoDB ClusterSet using two data centers: Let’s explore how we can automate […]
I could have set MySQL between parenthesis in the title as this article is more about how to use OpenTofu to deploy on OCI.
I will explain how to install OpenTofu and how to use it to deploy on OCI. I will also mention what are the required changes be able to use my previous Terraform deployment files.
As an example, let’s use the modules to deploy WordPress with MySQL HeatWave Database Service: oci-wordpress-mds.
Installing OpenTofu
If like me you are using a RPM based Linux distro, you can find the necessary information to create the yum repository on OpenTofu’s website:
$ sudo su -
# cat >/etc/yum.repos.d/opentofu.repo <<EOF
[opentofu]
name=opentofu …
[Read more]
To continue our journey to Moodle on Oracle Cloud Infrastructure using Ampere compute instances and MySQL HeatWave Database Service [1] [2], in this article we will see how to scale our architecture using multiple Moodle instances, High Availability for the Database and Read Scale-Out.
This is the architecture we will deploy:
The same principles can be applied to other projects, not just Moodle.
Multiple Compute Instances & MySQL HeatWave High Availability
The first step is to use again the Stack to deploy the initial resources. We must insure that we use a MySQL Shape that has at least 4 OCPUs to …
[Read more]In the previous post, we saw how to quickly deploy Moodle to Oracle Cloud Infrastructure on Ampere compute instances and using MySQL HeatWave.
In this post, we will explore some other features and the benefits of running on OCI and MySQL HeatWave to extend our architecture dedicated to Moodle in the Cloud.
Read Replicas
Moodle natively offers the possibility of distributing the load between reads and writes. When using MySQL HeatWave Database Service, adding read replicas is also a very easy task. Let’s see how we can benefit from it.
To be able to use MySQL HeatWave Read Replicas, the MySQL shape must have at least 4 OCPUs.
Let’s modify the moodle stack and deploy it again but this time we choose a bigger shape for MySQL:
When everything is ready, …
[Read more]If you want to deploy Moodle on OCI, you can use Ampere compute instances as application server and MySQL HeatWave Database Service to store the data.
Depending on your requirements, MySQL HeatWave can provide High Availability and Query Acceleration.
In this post, we will see the easiest and fasted way to deploy the following basic architecture:
In OCI to quickly deploy an architecture and all the required resources, it’s recommended to use a Stack (Terraform recipes and modules).
So deploy all the resources we need (VCN, Subnets, Security Lists, Internet Gateways, Compute Instances…) we just need to click on the following button:
…
[Read more]I already wrote on how to deploy WordPress on OCI using MySQL HeatWave, the MySQL Database Service in Oracle Cloud Infrastructure:
- Using MySQL Database Service for WordPress
- Deploying WordPress on OCI with MySQL Database Service: the easy way !
- Deploy WordPress on OCI using MDS – updated version
- Deploy WordPress on OCI with MySQL Database Service using Read Replicas
- …
Let’s continue our journey of deploying the MySQL Database System
on OCI with Terraform.
This time we will see how we can use a backup (see [1] and [2]) as a source (initial data) for a new
instance.
Within the oci_mysql_mysql_db_system
it’s possible
to define a source detailing how to provision the initial
data of the db system.
Let’s deploy a new MySQL Database Instance using a manual backup we made earlier:
We can also find the backup’s ocid using the oci
cli
command:
$ oci mysql backup list …
[Read more]
Recently I wrote an article on how to define a backup policy for
MySQL Database Service in OCI using Terraform. We saw that it
was possible to define tags (defined_tags
and
freeform_tags
) in the backup_policy
section of a oci_mysql_mysql_db_system
resource.
However, it seems that these tags are never used for manual or automated backups in the MySQL Database Service backup process. In the strategy implemented on OCI, the backups inherit the tags from the MySQL DB system itself.
This means that if you want to have some custom tags on your backups, you need to specify them in the MySQL Database resource like this (on line 12):
resource "oci_mysql_mysql_db_system" "MDSinstance" {
admin_password = var.admin_password
admin_username = …
[Read more]
Let’s continue the discovery of the MySQL Database Resource when deploying on Oracle Cloud Infrastructure using Terraform.
Last week, we saw how to create custom configurations and define user variables. Today we will see how we can define a backup policy and a maintenance window.
Backup Policy
In the oci_mysql_mysql_db_system
resource, we will
add a new section called backup_policy
like this:
backup_policy {
is_enabled = "true"
retention_in_days = "3"
window_start_time = "01:00-00:00"
freeform_tags = {"backup_defined_by"="Terraform"}
pitr_policy {
is_enabled = "true"
}
}
This part of code (you can see in a working Terraform architecture sample), enables backup, sets the retention days to 3. It also defines the starting time …
[Read more]With Terraform OCI provider 4.90.0 (released August 24th, 2022), we have added the possibility to specify the value of editable configuration variables directly from Terraform.
These variables must be defined in a resource of type
oci_mysql_mysql_configuration
like
this:
resource "oci_mysql_mysql_configuration" "mds_mysql_configuration" {
#Required
compartment_id = var.compartment_ocid
shape_name = var.mysql_shape
…
[Read more]