Closed fkchang closed 11 years ago
In the case of Cedar (I assume you're on Cedar because you're using Unicorn), you can actually use a DATABASE_URL like this:
mysql2://user:pass@host/database?sslca=staging/ca-cert.pem&sslkey=staging/client-key.pem&sslcert=staging/client-cert.pem
In such a case, heroku_external_db shouldn't even be necessary. It is necessary on Bamboo because Bamboo's database.yml generator will ignore the extra parameters at the end of the URL, but on Cedar it will add anything you put as a URL parameter into the config.
I think that did it, I had to change pathnames a bit. Does this mean that if I have the heroku_external_db gem, I'm connecting 2x - it worked commenting out those lines, and now w/the fixed DATABASE_URL, the unicorns spin up?
Thanks
Yeah, I think so. With Cedar you shouldn't really need heroku_external_db anymore. I'm planning to investigate that further and update the README to reflect that fact.
We have a Rails 3.2 app we are trying to migrate to unicorn on heroku. The heroku recommended config bombs out because it's trying to hit DATABASE_URL instead of EXTERNAL_DATABASE_URL. So per the advice from heroku (have a ticket there for this issue, they recommended we file here because we're using this gem) I set DATABASE_URL to match EXTERNAL_DATABASE_URL. That failed with a
2013-07-09T17:29:18.847565+00:00 app[web.1]: Mysql2::Error (Access denied for user 'root'@'ip-10-119-51-78.ec2.internal' (using password: YES)):
which implies to me that it wasn't getting all the authentication issue, so I set matching DATABASE_* to these fields we have set
EXTERNAL_DATABASE_CA: staging/ca-cert.pem EXTERNAL_DATABASE_CERT: staging/client-cert.pem EXTERNAL_DATABASE_KEY: staging/client-key.pem
But that doesn't apparently work. Heroku redirected me here after I told them that.
I'm thinking we can't be the only people running an external mysql DB on heroku on unicorn and there's got to be a config. It apparently runs on our staging instance w/the ActiveRecord lines commented out, but I'm hesitant to diverge from Heroku recommended config on production w/o knowing everything.
our unicorn.rb below with the ActiveRecord calls commented out