Simon
Simon

Reputation: 751

Deploy PostgreSQL to OpenShift Next Gen

I am new to OpenShift and I want to build a Ruby on Rails app backed by a PostgreSQL database. To add the PostgreSQL service, I followed the following steps (please correct me if these are wrong):

  1. Via the OpenShift Web Console in my project, click on Add to project
  2. Search for postgresql
  3. Select the Postgresql-persistent service
  4. Fill the subsequent form with username, password and database name (I don't know if these names must be the same as my local database connection or not)
  5. Click add

Now the service starts building, but it fails with the following log:

--> Scaling postgresql-1 to 1
--> Waiting up to 10m0s for pods in deployment postgresql-1 to become ready
error: update acceptor rejected postgresql-1: pods for deployment "postgresql-1" took longer than 600 seconds to become ready

I'm pretty much lost on this one. Any ideas? Thanks in advance

Upvotes: 0

Views: 160

Answers (2)

Simon
Simon

Reputation: 751

The PostgreSQL service was first recreated using auto-generated fields for username and password, then the config/database.yml file was updated with the following values for the production environment:

host:  <%= ENV['POSTGRESQL_SERVICE_HOST'] %>
port:  <%= ENV['POSTGRESQL_SERVICE_PORT'] %>
database :  <%= ENV['POSTGRESQL_DATABASE'] %>
username:  <%= ENV['POSTGRESQL_USER'] %>
password:  <%= ENV['POSTGRESQL_PASSWORD'] %>

Again many thanks to Dwi Prihandi

Upvotes: 0

Will Gordon
Will Gordon

Reputation: 3573

Simon,

This should be a very intermittent issue that you're seeing. I know OpenShift online had an incident in November, so this may still be related.

Please try again to make sure that you can deploy PostgreSQL now. Thanks!

Upvotes: 1

Related Questions