Skip to main content

AWS MySQL

SleakOps facilitates the integration of MySQL databases through Amazon RDS (Relational Database Service). Amazon RDS for MySQL is a fully managed service that simplifies database setup, operation, and scaling. By leveraging SleakOps for this integration, you can efficiently manage MySQL databases within your EKS (Elastic Kubernetes Service) environment, ensuring robust, scalable, and reliable data storage solutions for your applications.

How does SleakOps manage MySQL credentials?

When you create a MySQL dependency in SleakOps, it automatically generates a Vargroup for your database. This Variable Group securely stores the MySQL credentials and other important configuration details, such as the database endpoint and user access information. You’ll be able of manage them from Vargroups section.

What is Multi-AZ deployment and should I enable it?

Multi-AZ (Availability Zone) deployment ensures high availability and failover support by replicating your database in another availability zone. It’s recommended for production environments to prevent downtime. Keep in mind that it increases costs.

Can I change the MySQL version after the database is deployed?

No, the database engine version cannot be changed after deployment. You would need to create a new MySQL instance with the desired version and migrate your data. Or change it manually into the AWS Console.

What happens if I need more storage for my MySQL database?

You can adjust the storage size when configuring your database. If you need more storage after deployment, you can scale modifying the settings in AWS as at the moment SleakOps does not allow it.

How do I create a MySQL database dump?

To create a dump of your MySQL database, use the following command:

sh
mysqldump -h MYSQL_ADDRESS -u MYSQL_USERNAME -p MYSQL_PASSWORD > dump.sql

Replace MYSQL_ADDRESS, MYSQL_USERNAME, and MYSQL_PASSWORD with the appropriate values. For additional information on creating a MySQL dump, refer to the official MySQL documentation. Another option is creating it directly from the AWS Console and then import it. See Restoring to a DB instance.

How do I import an existent dump using docker?

For more details: MySQL Dump Documentation
To import a database dump into your MySQL RDS instance:

  1. Connect to the VPN: Ensure you are connected to the VPN of the AWS account where the RDS instance is located.
  2. Run Docker Container (Recommended):
  • Install Docker on your local machine if not already installed.
  • Run a MySQL Docker container with the following command:
sh
docker run -it --name mysql-container -v ./initial_data/:/tmp/data/ -e MYSQL_ROOT_PASSWORD=MYSQL_PASSWORD -d mysql bash
  • Attach to the container’s terminal:
sh
docker exec -t -i mysql-container bash
  • Import the dump file:
sh
mysql -h MYSQL_ADDRESS -u MYSQL_USERNAME -p < /tmp/data/dump.sql

Replace MYSQL_ADDRESS, MYSQL_USERNAME, and MYSQL_PASSWORD with your RDS instance details.

How do I import an existent dump to my local machine ?

Alternatively, you can use a MySQL client installed on your local machine to import the dump.

mysql -h MYSQL_ADDRESS -u MYSQL_USERNAME -p MYSQL_PASSWORD < /tmp/data/dump.sql

What should I do if I encounter connection issues with my MySQL database?

  • Ensure the database endpoint, username, and password are correct.
  • Verify that your security groups and firewall rules allow access.
  • Ensure the database is running and has enough resources (CPU, memory). Otherwise, contact us.

What is an RDS Read Replica?

An RDS Read Replica is a read-only copy of your primary database instance in Amazon RDS. It helps distribute read-heavy workloads and improves the performance and scalability of your database by offloading read operations from the primary database.
RDS Read Replicas are ideal when you need to:

  • Offload read-heavy operations from your primary instance.
  • Scale your read operations as your application grows.
  • Distribute database reads across multiple geographic locations.
  • Have a backup solution that can quickly be promoted to a primary instance in case of failure.
info

Keep in mind that Read replicas have a delay performing updates.

How do I configure a Read Replica in SleakOps?

In SleakOps, when creating a read replica for your RDS database, you will need to provide the following information:

  • Name of the replica
  • Replica Instance Class, which determines the instance type for the replica.
  • Replica Publicly Accessible, to decide if the replica should have a public IP or be accessible only within your private network.

Can I delete a replica?

At the moment, the only way is to delete the dependency.

info

Set up your MySQL

1. Add MySQL as a Dependency

To integrate MySQL with SleakOps:

  1. In the SleakOps console, go to the "Dependencies" section
  2. Choose "MySQL" from the list of available dependency types. For more detail see Dependencies: Integrating Databases, Caching, and Messaging Services.

2. Set up your MySQL.

You will access the following form:

mysql-create-p1

Here the parameters that SleakOps allows you to customize during the creation:

AttributeDescription
Database Engine VersionSelect the specific version of the MySQL database engine you wish to use. This ensures compatibility with your application requirements. Example: MySQL 8.0.2, MySQL 5.7.1
Database Instance ClassDefine the instance class that specifies the hardware configuration for your MySQL database. This controls CPU, memory, and network performance. Example: db.m6g.large, db.t3.medium. See AWS detail.
Database StorageSpecify the amount of storage allocated for the database. Example: 100 GB, 500 GB.
UsernameProvide the master username for the MySQL database. This is the main user with administrative privileges. Example: admin, root.
PasswordPassword for the master user to access the database.
Multi-Availability ZoneEnable or disable Multi-AZ deployment. This ensures high availability and failover support by replicating the database across multiple availability zones. Recommended for production environments.
Automated BackupConfigure automated backups for the MySQL database. This ensures data protection by enabling daily snapshots and transaction log backups. Set up the Backup Retention Period and the Backup Window. Recommended for production environments.
Backup Retention PeriodSet the number of days to retain automated backups.
Backup WindowPeriod of time while the backup will be done.
warning

SleakOps allow the creation of replicas only during the creation of the dependency.

After that basic data, you need to decide if a replica will be created. To do that:

  1. Into the form, look for the section Definition of RDS Read Replicas and click on + Add Item.
  2. Complete the following data:
SettingDescription
NameA name for the replica
Replica Instance ClassDefine the instance class that specifies the hardware configuration for your MySQL database. This controls CPU, memory, and network performance. Example: db.m6g.large, db.t3.medium.
Replica Publicly AccessibleDecide if the replica should have a public IP or be accessible only within your private network.

3. Customize your variable’s name for your MySQL data base.

As explained, when a dependency is created, SleakOps generates a vargroup to hold all the needed attributes. In this step you can change the name of the attributes in case it is needed. SleakOps completes the values automatically. After this step, your dependency is created.

mysql-create-outputs