pmckeown
pmckeown

Reputation: 4209

How can I restart my openshift postgres cartridge?

My app has fallen over as it can't connect to the postgres DB and when I try to connect to the DB via ssh and psql I get the following message:

psql: could not connect to server: Connection refused
         Is the server running on host "<GEAR_ID>-<NAMESPACE>.rhcloud.com" (<IP_ADDRESS>) and accepting
         TCP/IP connections on port <PORT_NUMBER>?

Running rhc app show --state prints:

Cartridge jbossas-7, haproxy-1.4 is started
Cartridge postgresql-9.2 is started

also, running rhc app show shows nothing unusual.

I can't telnet to the above IP_ADDRESS & POST_NUMBER, which kinda looks like communication has been broken between the 2 gears.

Any ideas?

Upvotes: 4

Views: 2709

Answers (3)

Colonel Mustard
Colonel Mustard

Reputation: 31

I had the same problem. Using pg_ctl instead of the rhc commands fixed it for me.

$ rhc ssh <appname>
[...rhcloud.com ...]\> pg_ctl restart
pg_ctl: old server process (PID: 20034) seems to be gone
starting server anyway
server starting

Upvotes: 2

pmckeown
pmckeown

Reputation: 4209

Ok, so I managed to work around this issue but man it was a PITA.

Since I couldn't find any useful help on the web around this problem, I've ended up creating a new app based on my old one, and using pg_dump and psql to save and restore the db from the old application into my new app.

I'm still none-the-wiser as to why the original app was no longer able to communicate from the main jboss gear to the postgresql gear, even though the postgres server was up and running.

Perhaps (hopefully) someone from openshift will want to look into this. If so I'll keep my old broken app around for a while.

Upvotes: 0

user2879327
user2879327

Reputation:

To restart your entire application:

rhc app restart <app_name>

TO restart just your postgresql cartridge:

rhc cartridge restart <cart_type> --app <app_name> 

You can get the cart type by running

rhc app show <app_name> --gears

And looking for the cartridge name under the "cartridges" heading

Upvotes: 1

Related Questions