连接故障的Heroku应用程序与Amazon RDS实例应用程序、实例、故障、Heroku

2023-09-12 21:30:59 作者:泪是没有颜色的血

我使用Amazon RDS为有史以来第一次,我一直在关注Heroku的文档获取使用RDS实例,我的应用程序。到目前为止,我已经创建了一个实例,我已经安装使用格式的插件:

I'm using Amazon RDS for the first time ever and I've been following the heroku docs to get my app using the RDS instance. So far I've created an instance and I have setup the addon using the format:

$ heroku addons:add amazon_rds url=mysql://user:pass@rdshostname.amazonaws.com/databasename

运行的Heroku耙分贝后:迁移我

After running heroku rake db:migrate I got

!捆绑mysql.rb驱动耙   中止!没有这样的文件加载 - MySQL的

!!! The bundled mysql.rb driver rake aborted! no such file to load -- mysql

因此​​,我安装了MySQL的宝石。做同样的事情,我再次得到了错误:

So I installed the MySQL gem. Doing the same thing again I got the error:

无法连接到MySQL服务器上   myapp.cqslpaxxqrok.eu-west-1.rds.amazonaws.com   (110)

Can't connect to MySQL server on 'myapp.cqslpaxxqrok.eu-west-1.rds.amazonaws.com' (110)

我看到有一张纸条有关在美国东部地区的实例是为Heroku的安全组控制访问什么的。我无法用欧洲的实例?

I see there's a note about the instance being in the US-east region for Heroku's security group to control access or something. Can I not use a European instance?

推荐答案

Heroku的改变了它的过程,使Heroku的服务器连接到RDS实例。在接受了这个问题的答案是不正确的了。

Heroku changed its procedure to allow Heroku servers to connect to RDS instances. The accepted answer to this question is not true anymore.

您已经授予的Heroku dynos访问您的RDS实例。推荐的方法做,这是配置RDS实例只接受SSL加密连接和配置安全组为您的实例,从所有IP地址允许进入。

五 Amazon Lightsail 部署LAMP应用程序之迁移到Amazon RDS实例

You have to grant Heroku dynos access to your RDS instance. The recommended way to do this is to configure the RDS instance to only accept SSL-encrypted connections and configure the security group for your instance to permit ingress from all IPs.

previously,Heroku上公布了其AWS账户ID和安全组的名称,以此来访问权限授予一个AWS RDS实例。 此不再推荐使用。

Previously, Heroku published its AWS account ID and security group name as a way to grant access to an AWS RDS instance. This is no longer recommended.

参考: https://devcenter.heroku.com/articles/amazon_rds