In this lab, we will follow the steps below to set up and test a MySQL cluster with GFS2 (Global File System 2) on AWS, integrating it with a WordPress instance. The lab involves working with AWS services such as EC2, EBS, NLB (Network Load Balancer), System Manager, and CloudWatch.
Create a Virtual Private Network (VPC): Set up a VPC in AWS to house the infrastructure components.
Provision Two EC2 Instances: Deploy two EC2 instances within the created VPC. These instances will be used to install GFS2 and configure the MySQL cluster.
Create a Shared EBS Volume: Establish an Elastic Block Store (EBS) volume to be shared between the two EC2 instances.
Install and Configure GFS2: Perform the installation of GFS2 on both EC2 instances for shared file storage.
Install and Configure MySQL Cluster: Set up MySQL on both instances to form a MySQL cluster.
Provision an Internal Network Load Balancer (NLB): Configure an NLB to forward traffic on the default MySQL port (3306) to the MySQL target group.
Set Up a WordPress Instance: Deploy an EC2 instance for WordPress, configured to connect to the MySQL cluster through the NLB endpoint.
Create AWS System Manager Automation Runbook: Develop a runbook to automate troubleshooting steps for switching to the secondary MySQL instance.
Establish AWS System Manager Incident Manager Response Plan: Build a response plan in AWS System Manager Incident Manager to execute the automation runbook.
Set Up AWS CloudWatch Alarms: Create an alarm in CloudWatch to trigger the Incident Manager in case the primary MySQL instance fails the health check.
Test the Fail-over Mechanism: Perform a fail-over test by stopping the primary MySQL instance and verifying access to the WordPress instance continues.