fusionauth-containers icon indicating copy to clipboard operation
fusionauth-containers copied to clipboard

problem with loading fusionauthdb on RDS

Open richb201 opened this issue 3 years ago • 2 comments

I have been battling with getting fa to work with mysql rds. I am using fusionauth/fusionauth-app:1.19.7

When I use this DATABASE_URL: jdbc:mysql://database-2.cwymdn16cxes.us-east-1.rds.amazonaws.com;dbname=fusionauthdb and I look in the docker logs, I see a huge number or errors.

for example:

2021-02-27 12:23:59.094 PM ERROR com.inversoft.maintenance.db.JDBCMaintenanceModeDatabaseService - Configuration [database.url] is invalid. It must begin with either jdbc:mysql: or jdbc:postgresql:
2021-02-27 12:23:59.102 PM ERROR com.inversoft.maintenance.db.JDBCURL - Could not parse jdbcString [jdbc:mysql://database-2.cwymdn16cxes.us-east-1.rds.amazonaws.com;dbname=fusionauthdb]

If I instead use this one: DATABASE_URL: jdbc:mysql://database-2.cwymdn16cxes.us-east-1.rds.amazonaws.com:3306/fusionauthdb the errors go away, but the rds times out with this message after about 10 minutes:

mysqli::real_connect(): (HY000/1129): Host '69.124.176.183' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

Either way, I am trying to run fa in docker on my laptop and access the dbase on rds. When I type localhost:9011 the system always goes into maint mode as if it can't see the existing rds fusionauthdb.

I have another installation on EC2 that can access this same fusionauthdb fine. Any ideas on why the rds is timing out from the localhost but not from EC2 when accessing fusionauthdb?

richb201 avatar Feb 27 '21 12:02 richb201

The answers of this questions may vary. I would suggest you look into the RDS size and see how many concurrent connections are supported.

nick-kostov avatar Aug 25 '22 09:08 nick-kostov

I'm not sure how you have everything setup, but this could be caused by AWS security groups. If the EC2 is allowed to connect to the RDS in your security group, then that would be way it works fine. However, if your security group is blocking traffic from the outside, that could be causing the errors.

You'll want to ensure that you are able to connect to MySQL using the MySQL command line tools from your laptop. This will ensure that the RDS is accessible. This command should work:

mysql -uroot -p -hdatabase-2.cwymdn16cxes.us-east-1.rds.amazonaws.com mysql

You might need to adjust it based on the real host name, username, and database name.

voidmain avatar Aug 25 '22 13:08 voidmain