2010-10-19 72 views
2

我使用Amazon RDS爲有史以來第一次,我一直在關注Heroku的文檔來得到使用RDS實例我的應用程序。到目前爲止,我已經創建了一個實例,我已經安裝使用格式的插件:麻煩連接的Heroku應用程序與Amazon RDS實例

$ heroku addons:add amazon_rds url=mysql://user:[email protected]/databasename 

運行的Heroku耙分貝後:遷移我

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

因此,我安裝了MySQL寶石。做同樣的事情,我再次得到了錯誤:

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

我看到有一張紙條有關在美國東部地區的實例是爲Heroku的安全組來控制訪問什麼的。我不能使用歐洲實例嗎?

回答

2

的Heroku改變了程序,讓Heroku的服務器連接到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 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

5

不,您不能使用歐洲實例。 Heroku目前僅在美國東部地區提供,並且您需要能夠將Heroku添加到您的安全區域以使RDS實例正常工作,我想這需要您位於同一區域。更重要的是,由於延遲和安全原因,您希望與Heroku位於同一區域(否則您的數據庫流量將通過Internet傳輸)。