Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ sidebar_label: AWS RDS

# How to apply the Recommended Configuration for AWS RDS

Use Parameter Groups to apply the recommended configuration. Follow the steps below:
Use Parameter Groups to apply the recommended configuration. Follow the steps below.

For Amazon Aurora MySQL or Aurora PostgreSQL, update both the instance DB parameter group and the DB cluster parameter group when Releem recommendations target cluster parameters. AWS-managed default groups cannot be modified.

## Step 1: Modify the Parameter Group in AWS RDS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ Please exclude "releem" user from MySQLGovernor.
If your server is managed through WHM/cPanel, use the [WHM/cPanel installation guide](/releem-agent/installation-guides/whm-cpanel) for setup-specific troubleshooting, including how to verify that cPanel MySQL auto-adjust settings are disabled.

### AWS RDS
[Common issues for AWS RDS](/releem-agent/installation-guides/cloud-managed-aws-rds-automatic-installation#common-issues-for-aws-rds)
[Common issues for AWS RDS MySQL and Aurora MySQL](/releem-agent/installation-guides/cloud-managed-aws-rds-automatic-installation#common-issues-for-aws-rds)

[Common issues for AWS RDS PostgreSQL and Aurora PostgreSQL](/releem-agent/installation-guides/postgresql-manual-linux#common-issues-for-aws-rds-and-aurora-postgresql)


## Releem Agent Installation Errors
Expand Down
5 changes: 4 additions & 1 deletion docs/getting-started/step-2-add-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ Click the "Add Server" button to start the setup process.
Choose the type of database server you are adding:
- [MySQL on Linux Server: Automatic Agent Installation (Linux)](/releem-agent/installation-guides/self-managed-servers-automatic-installation) – Automatic installation for MySQL instances running on Linux-based servers.
- [MySQL on Linux Server: Advanced Agent Installation](/releem-agent/installation-guides/self-managed-servers-manual-installation-linux) – Manual installation for MySQL instances running on Linux-based servers. Use this guide if you don't have a MySQL root user, or if MySQL is installed on a different IP address, or if you want to create a Releem user manually.
- [PostgreSQL on Linux Server: Automatic Agent Installation](/releem-agent/installation-guides/postgresql-manual-linux) – Automatic installation for PostgreSQL instances running on Linux-based servers.
- [PostgreSQL on Linux Server: Manual Agent Installation](/releem-agent/installation-guides/postgresql-manual-linux) – Manual installation for PostgreSQL instances running on Linux-based servers.
- [PostgreSQL in Docker](/releem-agent/installation-guides/postgresql-manual-linux) – Manual installation for PostgreSQL instances running in Docker containers.
- [PostgreSQL on AWS RDS and Aurora](/releem-agent/installation-guides/postgresql-manual-linux) – For managed PostgreSQL databases hosted on Amazon RDS or Aurora.
- [WHM/cPanel](/releem-agent/installation-guides/whm-cpanel) – Recommended installation path for database servers managed through WHM/cPanel.
- [MySQL on Linux Server: Manual Installation in Docker](/releem-agent/installation-guides/self-managed-servers-docker-installation) – Manual installation for MySQL instances running in Docker containers.
- [Self-Managed Server (Windows)](/releem-agent/installation-guides/self-managed-servers-manual-installation-windows) – For MySQL instances running on Windows.
- [MySQL on AWS RDS: CloudFormation installation](/releem-agent/installation-guides/cloud-managed-aws-rds-automatic-installation) – For managed MySQL databases hosted on AWS.
- [MySQL on AWS RDS and Aurora: CloudFormation installation](/releem-agent/installation-guides/cloud-managed-aws-rds-automatic-installation) – For managed MySQL databases hosted on Amazon RDS or Aurora.
- [MySQL on GCP Cloud SQL: Manual installation](/releem-agent/installation-guides/cloud-managed-gcp-cloud-sql-automatic-installation) – For managed MySQL databases hosted on GCP.
- [MySQL in Kubernetes](/releem-agent/installation-guides/installation-in-kubernetes) – If your MySQL instance is deployed in a Kubernetes cluster.

Expand Down
10 changes: 10 additions & 0 deletions docs/releem-agent/configuration-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ aws_rds_db="[RDS_INSTANCE_NAME]"
# AWS RDS parameter group name
aws_rds_parameter_group="releem-agent"

# AWS RDS / Aurora cluster parameter group name. Required for Aurora; leave empty for non-Aurora RDS
aws_rds_cluster_parameter_group=""

#GCP project ID for Cloud SQL instance
gcp_project_id="my-project-123"

Expand Down Expand Up @@ -78,6 +81,12 @@ pg_port="5432"
# PostgreSQL SSL mode: false = disable, true = require
pg_ssl_mode=false

# Command to restart PostgreSQL service
pg_restart_service="/bin/systemctl restart postgresql"

# Path to copy the recommended PostgreSQL config
pg_cnf_dir="/etc/postgresql/releem.conf.d"

# Command to restart MySQL service
mysql_restart_service="/bin/systemctl restart mysql"

Expand Down Expand Up @@ -134,6 +143,7 @@ releem_region=""
- For MySQL, the `mysql_password` field should contain the password for the user specified in `mysql_user`.
- For PostgreSQL, the `pg_password` field should contain the password for the user specified in `pg_user`.
- PostgreSQL monitoring is enabled when `pg_user` and `pg_password` are configured.
- For Aurora, set `aws_rds_cluster_parameter_group` to the custom DB cluster parameter group attached in AWS. Leave it empty for non-Aurora RDS. The configured instance and cluster group names must match the groups attached in AWS.
- Set `query_optimization=true` to enable SQL query optimization features where supported.
- Use `databases_query_optimization` to specify which databases to monitor for query optimization (leave empty for all databases).
- The `releem_region` field can be set to `EU` for European data storage or left empty for default storage.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
---
id: cloud-managed-aws-rds-automatic-installation
title: AWS RDS
title: RDS
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Cloud-Managed AWS RDS Automatic Installation

# Cloud-Managed AWS RDS and Aurora MySQL Automatic Installation

Use this instruction to install Releem Agent automatically via CloudFormation to AWS Fargate, or manually on an EC2 instance. Releem Agent will run in a container on AWS Fargate or directly on the EC2 instance, depending on your choice.

To configure automatic applying of recommended configuration please sign in to your AWS account and do the following steps:
- In the Amazon RDS console, create a Parameter Group for the version of your database named “releem-agent".
- Modify the database by specifying in “DB parameter group” the Parameter group created in the previous step.
- Reboot the database if required to apply the changes.

The requirements for RDS instance:
- Enhanced monitoring to collect system performance metrics.
Releem supports Amazon RDS MySQL, Amazon RDS MariaDB, and Amazon Aurora MySQL. Configure one Agent for each DB instance endpoint.

## Parameter groups

To apply recommended configuration automatically, sign in to your AWS account and prepare custom parameter groups. AWS-managed default groups cannot be modified and are not valid onboarding targets.

**Amazon RDS MySQL or MariaDB (non-Aurora):**
- Create a custom DB parameter group for your database version, for example `releem-agent`.
- Attach it to the instance as **DB parameter group**.
- Leave the cluster parameter group empty.
- Reboot the instance if AWS requires it.

**Amazon Aurora MySQL:**
- Create a custom DB parameter group for the instance and a custom DB cluster parameter group for the cluster.
- Attach both groups in AWS. The names you configure for Releem must match the groups attached in AWS.
- Both groups must be ready before the Agent applies recommendations. A recommendation can target either group.
- Only the Agent that targets the writer modifies cluster parameters. That Agent needs `rds:ModifyDBClusterParameterGroup` permission.

The requirements for the RDS or Aurora instance:
- Enhanced Monitoring to collect system performance metrics.
- Performance Insights to collect MySQL performance metrics.
- Performance Schema to collect MySQL performance metrics. Please change the following variable in the Parameter Group and reboot the database instance:
- Performance Schema to collect MySQL performance metrics. Change the following variables in the custom parameter group and reboot the database instance if required:

```ini
performance_schema=ON
slow_query_log=ON
Expand All @@ -38,25 +51,31 @@ You have the following options to install Releem Agent:
- ecr:GetDownloadUrlForLayer
- ecr:BatchGetImage
- rds:ModifyDBParameterGroup
- rds:ModifyDBClusterParameterGroup

To move forward just do the following steps:
1. Create read-only user "releem" in MySQL using the [instruction](/releem-agent/mysql-permissions). To enable Automatic SQL Query Optimization please add [Additional Permissions](/releem-agent/mysql-permissions#additional-database-permissions-required).

2. Open the [CloudFormation Quick Create page](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateUrl=https://releem.s3.amazonaws.com/v2/releem-agent-cloudformation.yml&stackName=releem-agent) in your browser, check that the correct region is selected, and fill in the following fields:
- Image: Releem Agent Docker image in the `releem/releem-agent:[version]` format. Use the latest version available on [Docker Hub](https://hub.docker.com/r/releem/releem-agent/tags).
- APIKey: Releem API Key from the [Profile page](https://app.releem.com/profile?menu=profile) in the Releem Customer Portal.
- DBID: RDS DB Instance ID. If you're using a cluster, please set the instance name you would like to tune.
- DBID: RDS DB Instance ID. For Aurora, set the instance name you want to monitor, not the cluster endpoint. Deploy one stack per instance.
- DatabaseType: leave `mysql` (default) for RDS MySQL, MariaDB, and Aurora MySQL.
- DBUser: User to collect metrics from the SQL server, that we added in the step 1.
- DBPassword: Password for user
- DBSSLMode: set `true` when the instance requires SSL.
- SecurityGroupIDs: Releem Agent SecurityGroups to connect to RDS. Please Allow All Outbound traffic for Releem Agent Security Group.
- SubnetIDs: Releem Agent container should be able to connect to RDS.
- QueryOptimization: set True if Releem Agent should collect additional information for Automatic SQL Query Optimization.
- DBParameterGroup: Parameter Group name which Releem will use to set recommendations for RDS instance. Default name is "releem-agent".
- DBParameterGroup: Custom DB parameter group attached to the instance. Required for RDS and Aurora instance parameters.
- DBClusterParameterGroup: Custom DB cluster parameter group attached to Aurora. Required for Aurora. Leave empty only for non-Aurora RDS.

`DatabaseType` defaults to `mysql` and exposes MySQL (`DB_*`) credentials to the container. Select `postgresql` only for Aurora PostgreSQL; see [PostgreSQL](/releem-agent/installation-guides/postgresql-manual-linux).

3. Next, click "Create Stack".

</TabItem>
<TabItem value="ec2" label="EC2">
</TabItem>
<TabItem value="ec2" label="EC2">

Use this instruction to install Releem Agent manually on the EC2 instance to tune AWS RDS. Releem Agent will automatically collect metrics and recommend configuration.
To move forward just do the following steps:
Expand All @@ -73,7 +92,8 @@ You have the following options to install Releem Agent:
"cloudwatch:Get*",
"logs:Get*",
"ec2:Describe*",
"rds:ModifyDBParameterGroup"
"rds:ModifyDBParameterGroup",
"rds:ModifyDBClusterParameterGroup"
],
"Resource": "*",
"Effect": "Allow"
Expand All @@ -82,24 +102,34 @@ You have the following options to install Releem Agent:
}
```

3. Run Installation command as a root user on the server:
```ini
3. Run Installation command as a root user on the server.

**Amazon RDS MySQL or MariaDB:**

```bash
RELEEM_INSTANCE_TYPE="aws/rds" RELEEM_AWS_REGION="[AwsRegion]" RELEEM_AWS_RDS_DB="[AwsRdsDBidentifier]" RELEEM_AWS_RDS_PARAMETER_GROUP="releem-agent" RELEEM_MYSQL_PASSWORD='[Password]' RELEEM_MYSQL_LOGIN='releem' RELEEM_DB_MEMORY_LIMIT=0 RELEEM_API_KEY=[Key] RELEEM_CRON_ENABLE=1 RELEEM_QUERY_OPTIMIZATION=true bash -c "$(curl -L https://releem.s3.amazonaws.com/v2/install.sh)"
```

**Amazon Aurora MySQL:** add `RELEEM_AWS_RDS_CLUSTER_PARAMETER_GROUP` with the custom cluster parameter group name. Set `RELEEM_AWS_RDS_DB` to the instance identifier, not the cluster endpoint. Repeat the installation for each instance you want to monitor. Only the writer Agent applies cluster parameter recommendations.

```bash
RELEEM_INSTANCE_TYPE="aws/rds" RELEEM_AWS_REGION="[AwsRegion]" RELEEM_AWS_RDS_DB="[AwsRdsDBidentifier]" RELEEM_AWS_RDS_PARAMETER_GROUP="releem-agent" RELEEM_AWS_RDS_CLUSTER_PARAMETER_GROUP="releem-agent-cluster" RELEEM_MYSQL_PASSWORD='[Password]' RELEEM_MYSQL_LOGIN='releem' RELEEM_DB_MEMORY_LIMIT=0 RELEEM_API_KEY=[Key] RELEEM_CRON_ENABLE=1 RELEEM_QUERY_OPTIMIZATION=true bash -c "$(curl -L https://releem.s3.amazonaws.com/v2/install.sh)"
```

**Parameters:**
- `RELEEM_AWS_REGION` - AWS region name
- `RELEEM_AWS_RDS_DB` - RDS instance name.
- `RELEEM_AWS_RDS_PARAMETER_GROUP` - Parameter Group name which Releem will use to set recommendations for RDS instance. Default name is "releem-agent".
- `RELEEM_AWS_RDS_DB` - RDS or Aurora instance identifier.
- `RELEEM_AWS_RDS_PARAMETER_GROUP` - Custom DB parameter group name. Required.
- `RELEEM_AWS_RDS_CLUSTER_PARAMETER_GROUP` - Custom DB cluster parameter group name. Required for Aurora. Omit for non-Aurora RDS.
- `RELEEM_MYSQL_LOGIN` - MySQL User name to collect MySQL metrics
- `RELEEM_MYSQL_PASSWORD` - MySQL User password to collect MySQL metrics
- `RELEEM_DB_MEMORY_LIMIT` - Change parameter in case there are other software installed on the server. Default value is 0 means use all memory.
- `RELEEM_API_KEY` - API Key. Get it from Profile page in Releem Customer Portal.
- `RELEEM_QUERY_OPTIMIZATION` - set 'true' if Releem Agent should collect additional information for Automatic SQL Query Optimization.


</TabItem>
<TabItem value="docker" label="EC2 Docker">
</TabItem>
<TabItem value="docker" label="EC2 Docker">
Use this instruction to install Releem Agent manually on the EC2 instance in Docker container to tune AWS RDS. Releem Agent will automatically collect metrics and recommend configuration.

To move forward just do the following steps:
Expand All @@ -116,7 +146,8 @@ You have the following options to install Releem Agent:
"cloudwatch:Get*",
"logs:Get*",
"ec2:Describe*",
"rds:ModifyDBParameterGroup"
"rds:ModifyDBParameterGroup",
"rds:ModifyDBClusterParameterGroup"
],
"Resource": "*",
"Effect": "Allow"
Expand All @@ -142,6 +173,8 @@ You have the following options to install Releem Agent:
-e RELEEM_QUERY_OPTIMIZATION=true \
releem/releem-agent:[version]
```

For Aurora MySQL, add `-e AWS_RDS_CLUSTER_PARAMETER_GROUP="releem-agent-cluster"` (or `RELEEM_AWS_RDS_CLUSTER_PARAMETER_GROUP`). Run one container per instance. Only the writer container applies cluster parameter recommendations.

**Docker Compose**

Expand All @@ -165,6 +198,7 @@ You have the following options to install Releem Agent:
AWS_REGION: "[AWS_REGION]"
AWS_RDS_DB: "[AWS_RDS_DB]"
AWS_RDS_PARAMETER_GROUP: "releem-agent"
AWS_RDS_CLUSTER_PARAMETER_GROUP: "releem-agent-cluster"
RELEEM_QUERY_OPTIMIZATION: true

# You can duplicate docker compose services to launch multiple agents by changing the name, container_name, and environment.
Expand All @@ -178,28 +212,32 @@ You have the following options to install Releem Agent:
DB_PASSWORD: "[DB_PASSWORD]"
INSTANCE_TYPE: "aws/rds"
AWS_REGION: "[AWS_REGION]"
AWS_RDS_DB: "[AWS_RDS_DB]"
AWS_RDS_DB: "[AWS_RDS_DB_READER]"
AWS_RDS_PARAMETER_GROUP: "releem-agent"
AWS_RDS_CLUSTER_PARAMETER_GROUP: "releem-agent-cluster"
RELEEM_QUERY_OPTIMIZATION: true
```

Leave `AWS_RDS_CLUSTER_PARAMETER_GROUP` empty or omit it for non-Aurora RDS.

***Parameters:***
- `RELEEM_API_KEY`: API Key. Get it from Profile page in Releem Customer Portal.
- `RELEEM_HOSTNAME` - Server hostname, which should display in the Releem Dashboard.
- `DB_USER`: MySQL User name to collect MySQL metrics
- `DB_PASSWORD`: MySQL User password to collect MySQL metrics
- `AWS_REGION`: AWS region name
- `AWS_RDS_DB`: RDS instance name.
- `AWS_RDS_PARAMETER_GROUP`: Parameter Group name which Releem will use to set recommendations for RDS instance. Default name is "releem-agent".
- `AWS_RDS_DB`: RDS or Aurora instance identifier.
- `AWS_RDS_PARAMETER_GROUP`: Custom DB parameter group name. Required.
- `AWS_RDS_CLUSTER_PARAMETER_GROUP` / `RELEEM_AWS_RDS_CLUSTER_PARAMETER_GROUP`: Custom DB cluster parameter group name. Required for Aurora.
- `RELEEM_QUERY_OPTIMIZATION` - set 'true' if Releem Agent should collect additional information for Automatic SQL Query Optimization.

Please use the latest version of Releem Agent. You can find the latest version of Releem Agent by clicking on the [link](https://hub.docker.com/r/releem/releem-agent/tags).

</TabItem>
</TabItem>
</Tabs>


## Common Issues for AWS RDS
## Common Issues for AWS RDS {#common-issues-for-aws-rds}

To check Releem Agent logs please open CloudWatch -> Log Groups and then select Releem Agent log group.

Expand Down Expand Up @@ -229,3 +267,10 @@ To check Releem Agent logs please open CloudWatch -> Log Groups and then select
7. Performance_schema_ variables aren't being applied on AWS RDS
- Amazon RDS only applies performance_schema_* variables when performance_schema is explicitly set to 1 in the Parameter Group. By default, it's set to 0, even though Performance Insights enables it automatically at the database level.
- Solution: Set performance_schema from 0 to 1 in your Parameter Group, save the changes, and reboot your RDS instance.

8. Aurora apply fails because the cluster parameter group is missing or does not match
- Create a custom DB cluster parameter group, attach it to the cluster, and set `DBClusterParameterGroup` / `AWS_RDS_CLUSTER_PARAMETER_GROUP` to that exact name.
- AWS-managed default groups cannot be modified.

9. Cluster parameters are not applied on a reader
- Only the Agent targeting the writer modifies cluster parameters. Keep an Agent on the writer instance.
Loading