Can't connect to PostgreSQL via pgAdmin III

The OpenShift forums have been retired.
You can still read and search them, but for help, please post a question on Stack Overflow.

I get "connection refused" when I copy/paste the IP address and port# provided during the setup of the cartridge and try to connect. Is there some other process I need to follow in order to enable external connections?

Looks like you need to forward those ports to your local client: https://www.openshift.com/blogs/getting-started-with-port-forwarding-on-openshift

rhc port-forward -a {appName}

Ok thanks.

hi i got problem in port forwarding.. this is the msg i got when i do forward..

Checking available ports...
Binding httpd -> 127.7.196.1:8080...
Binding postgres -> 127.7.196.1:5432...
Forwarding ports, use ctl + c to stop
D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/net-ssh-2.6.0/lib/net/ssh/service/forward.rb:68:in `initialize': Permission denied - bind(2) (Errno::EACCES)
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/net-ssh-2.6.0/lib/net/ssh/service/forward.rb:68:in `new'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/net-ssh-2.6.0/lib/net/ssh/service/forward.rb:68:in `local'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/lib/rhc/commands/port-forward.rb:56:in `block (3 levels) in run'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/lib/rhc/commands/port-forward.rb:54:in `each'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/lib/rhc/commands/port-forward.rb:54:in `block (2 levels) in run'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/net-ssh-2.6.0/lib/net/ssh.rb:193:in `start'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/lib/rhc/commands/port-forward.rb:52:in `block in run'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/net-ssh-2.6.0/lib/net/ssh.rb:193:in `start'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/lib/rhc/commands/port-forward.rb:30:in `run'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/lib/rhc/commands.rb:103:in `block (3 levels) in to_commander'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/command.rb:180:in `call'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/command.rb:155:in `run'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/lib/rhc/command_runner.rb:30:in `run!'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/lib/rhc/cli.rb:40:in `start'
        from D:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/rhc-0.98.16/bin/rhc:62:in `<top (required)>'
        from D:/Program Files/Ruby193/bin/rhc:23:in `load'
        from D:/Program Files/Ruby193/bin/rhc:23:in `<main>'

any idea? i am also trying to connect postgre with pgAdminIII

pls help

Port forwarding requires that each of those ports be open on your local client. Can you check to see if ports 8080 or 5432 are available? (e.g., stop your local postgres instance of you have one running).

HTHs;
~Nam

Thz Nam, I was running a service postgres data on 5432.. When i stop the service, i can do port forward.

Glad you to are here in these forums :)

Glad I can help. Thank you for posting your questions and logs to the forums. I'm sure this will also help others.

Hi, I couldn't connect to Postgre via pgAdmin III neither... I tried port forwarding, I've get this...

Checking available ports... Forwarding ports Service Connect to Forward to ======= ================ ==== ================ haproxy 127.7.160.2:8080 => 127.7.160.2:8080 haproxy 127.7.160.3:8080 => 127.7.160.3:8080 java 127.7.160.1:8080 => 127.7.160.1:8080 Press CTRL-C to terminate port forwarding

There is no postgre for me ... Can you help me? My application is running, without problem.

Thank you

Istvan

We have a forum thread that covers how to run port-forwarding manually for scalable applications here: https://www.openshift.com/forums/openshift/how-to-port-forward-a-scaled-application

HTHs; ~Nam

I have problem to connect to the server via pgAdmin on my local machine. I did rhc port-forwarding.

I get message:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "127.12.xx.xx" and accepting TCP/IP connections on port 5432?

I try to ping a host and its reachable . Is this port-forward everything we should do or I am misssing something ?? Thanks

SOLVED.

It was right in the front of my eyes :S "To connect to a service running on OpenShift, use the LOCAL address"

Great! Glad its working for you.