I have set up Confluence on a LAMP stack on an AWS instance and need to be able to adjust the max_allowed_packet to install addons. I know AWS prohibits editing the my.cnf file and I've installed the RDS client. RDS doesn't seem to see my existing confluence MySQL database for me to assign it to a db group with the larger packet allowance.
Am I missing some option for RDS to see it? Is there another way to do this?
You can adjust max_allowed_packet by modifying an existing, or creating a new RDS parameter group. You will find many familiar configuration settings in parameter groups. If you haven't touched parameter groups before, you'll likely find that yours is named default.mysql5.6 (or your version equivalent) and you will need to create a new one to customize your own settings.
You can create a new parameter group from the:
AWS Console ("Working with parameter groups" describes the creation of parameter groups and modification of individual settings)
CLI (docs: create-db-parameter-group)
API (docs: CreateDBParameterGroup)
You can modify settings from the:
AWS Console (See above.)
CLI (docs: modify-db-parameter-group)
API (docs: ModifyDBParameterGroup)
When you change from the default parameter group to a custom parameter group, you will need to reboot the RDS instance for the switch to take effect. After that, you will only need to reboot for individual settings if they have the "static" parameter type. max_allowed_packet is a dynamic parameter type, which means that the change will take effect immediately once you make it.
Related
After spending hours trying to debug this problem, I've come out empty-handed.
I'm new to AWS, so it's possible I might be missing something here, but it seems I've exhausted all possibilities based on what I've read online.
So the idea is, I want to create a RDS instance. I'm new to cloud computing as a whole, but how I understand it, this instance is essentially the storage of my relational database on the cloud. Then I connect the DBMS of my liking to it on my local machine. I tried with both Postgresql and MySQL, but both ran into the same issue. Note, when I say I used the two aforementioned DB engines, I made sure that in each case, I set them as the engine when creating the RDS instance. I then configured the security group accordingly.
What I've done:
I've created an admin user as per the aws docs.
I created a security group in the VPC that has the following inbound rule (In this case, I intend to create a RDS instance with MySQL as the engine):
I created an RDS instance with MySQL as the engine, made sure it had public accessibility, and made sure the security group of the VPC was the one I created.
I then tried connecting to the database via both MySQL Workbench and pgAdmin, but both ran into the same issue. I tried using my IP as the source for the security group inbound rule – that didn't work. I then set the source to 0.0.0.0/0, which I understand is all sources; that also unfortunately didn't work.
Any ideas what else I could be doing wrong here? Thanks.
Well, seems I managed to figure it out, albeit indirectly.
I gave up working with AWS and decided to try MongoDB. When connecting to MongoDB Atlas, once again, I couldn't connect. I read up the troubleshooting page in the docs and saw that they recommend you use an outgoing port tester to check if you can reach them from the port they use (27017 in their case). I tested it and found that it wasn't working. I checked to see if it had to do with my firewall (I'm on mac); I disabled it but it didn't do anything. I disabled my VPN (ProtonVPN) and it turned out that it was what was causing the issue. But that's not all there is to it. Although the outgoing port test was working, I still couldn't successfully connect to the DB. So I went to configure the inbound IP address rules so that it would accept from any source, and that was the final fix needed.
I have an existing production database which only has 5GB of space, which is not enough. I would like to increase this size, however AWS does not let you do this with SQL databases. How should I do this?
I tried creating a snapshot and making a new database with it however I could not set the database size for some reason.
Is there a solution for this?
RDS instances have a set of settings exposed that you can modify. For RDS instances running MySQL, allocated storage size is one of these settings.
To modify a DB instance running the MySQL engine from the AWS web console (from linked documentation):
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
In the navigation pane, click Instances.
Select the check box for the DB instance that you want to change, click Instance Actions and then click Modify.
In the Modify DB Instance dialog box, modify [the setting labeled "Allocated Storage"].
At the bottom of the Modify DB instance dialog, there is a checkbox labeled "apply immediately." If this checkbox is selected, the change will begin immediately and your RDS instance will enter the modifying state. No further modifications can be made to the instance settings during this time. Your database should not experience downtime while these changes are being made, but performance will be degraded. If you do not select this checkbox, the change will be applied during your RDS instance's next maintenance window.
Note that altering other settings and applying immediately can result in downtime, depending on what you want to change. Check this documentation for a full list.
You can alternatively perform this operation programmatically, via:
API: ModifyDBInstance
CLI: aws rds modify-db-instance
Upgrading a MySQL DB instance can be tricky but easy to achieve through the following steps.
1. Ensure that running an updated version of MySQL Engine(not deprecated).
Trying to upgrade a deprecated MySQL Version via the AWS Console(UI) results in an error message."
"Cannot find version 5.... for mysql (Service: AmazonRDS; Status Code:
400; Error Code: InvalidParameterCombination; Request ID:........"
Even Snapshot Restore is most likely to run for several mins/hours without any success.
2.Use AWS CLI
Use 'modify-db-instance' command to scale the storage size[1] and applied the version upgrade on your DB instance.
Here's the example command:
aws rds modify-db-instance \
--db-instance-identifier <RDS_identifier> \
--allocated-storage <storage_size> \
--apply-immediately
You may also refer to this guide on to install AWS CLI toll: Installing the AWS Command Line Interface - [https://docs.aws.amazon.com/cli/latest/userguide/installing.html][1]
3.After the successful upgrade, optionally modify/upgrade your MySQL version to a non depreciated Version via the AWS Console(UI).
Using CloudFormation, I'm trying to figure out a few use cases.
The first case is having an existing AWS RDS MySQL server, how to create a database, tables, and a user account though a CloudFormation template.
After looking at the Cloudformation docs, I thought there could be a
AWS::RDS::DBInstance property that would allow me to do this action; however, though I couldn't find how to specify a database host source (or I may have misread it) that would allow.
aws-properties-rds-database-instance
then, looking at the Cloudformation RDS templates from AWS, I saw an fn::join command that stood out. Would my first case be done with fn::join?
"UserData": { "Fn::Base64": { "Fn::Join": ["", [....
Next, in the second case, I'm also having trouble finding how using an existing RDS MySQL server, load a scheme from a MySQL mysqldump.
I've looked at the docs in the link above for answers but not quite sure. I noticed AWS templates mostly allow you to create resources.
Lastly, to solve the above two cases, I've also been reading that it could or should(?) be done using a two tool approach by way of using an AWS CloudFormation template and calls to Chef.
Thoughts?
Short answer is : you can't, right now, automatically run SQL queries at instance creation (in the future, who knows...).
I would use the following way to resolve this classic problem:
Use an EC2 to run the MySQL code you need (not sure if you need to put a "DependsOn" clause in the EC2, since you will have to refer to the RDS endpoint with a GetAtt, which will probably put an implicit DependsOn clause). You put this in the user data or any script you want, as long as you pass the RDS endpoint somehow. Of course, you will need the MySQL client package installed on your EC2.
As you wrote, CloudFormation allows you to create AWS resources, but populationg those resources is up to you. Once again, a MySQL client will do the trick (since a MySQL dump is no more than SQL code in a file, same as your initial requirement).
Using Chef or Puppet will not solve your problem alone, since both need an agent installed on an EC2, you cannot run your agent in the RDS server. So you can have an EC2 using a Chef or Puppet agent, which will in turn launch the MySQL script, but this will not give you much more than the previous solution
we are using Amazon RDS linux server for MYSQL. what is the way to change my.cnf file variable values ??
i am trying to change innodb_log_file_size variable. Can you please update me which is the best way to change?
So please help me on this
Thank you in Advance
Create a new DB paramater group with your required values and attach to your RDS.
You cannot change that value in Aurora, the storage engine is different than rds mysql or standard mysql and optimized internally. No need to worry about changing it.
I'm facing similar issue where I need to change the value of global variable in my Amazon Aurora Serverless cluster.
As you can see in the above documentation screenshot the innodb_log_file_size is not a dynamic variable so it won't be available in the DB Parameter Group.
Values of these kind of non dynamic global variables can only be changed by modifying MySQL config files (my.cnf) or by modifying server startup command.
Since you are using Amazon RDS MySQL there users don't have access to config files so no you cannot modify the value of innodb_log_file_size global variable, This functionality is not available in Amazon RDS as of now.
I tried to create a deterministic, MySQL data read function in my database on a shared hosting in GoDaddy (Linux). But while creating the function I got the following error.
#1419 - You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
I have contacted GoDaddy Tech Support and they mentioned that I need Super User privilege to do this and they won't be able to grant that to me on a shared hosting. So I am planning to move everything to Amazon Web Services.
Before I do, does anyone know if Amazon RDS will allow the creation of this MySQL function or is there any possibility I can run into the same problems there as well? I had run into the same problem creating DB Triggers on Godaddy as well and worked around using Stored Procedure.
Thanks for your help.
Yes I know for a fact that you can change the log_bin_trust_function_creators parameter in Amazon RDS.
RDS has a thing called parameter groups. If you want to change a setting, you create a new parameter group, change the parameters you want (in this case, set log_bin_trust_function_creators to 1) and then launch an instance (or modify an already launched instance) and set the instance's parameter group to the one you just created.
Hope this helps.