Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

postgresql + ambari server failed to open port 8080

Solved Go to solution

Re: postgresql + ambari server failed to open port 8080

Jay

 

can we use this to check in other way

 

psql --host=master2 --port=8080 --username=ambari --password --dbname=bigdata
Password for user ambari:ambari

 

 

is this syntax is correct ? ?

Michael-Bronson
Highlighted

Re: postgresql + ambari server failed to open port 8080

Super Mentor

@mike_bronson7 

Based on your details i do not think that your Postgres runs on 8080 port (that may be your Ambari Server port)

So if you want to use "psql" utility to connect to Postgres Database then you should be using Postgres Port (default 5432). 

Example:

# psql --host=`hostname -f` --port=5432 --username=ambari  --dbname=ambari
Password for user ambari: bigdata
ambari=> select * from host_version;


# psql --host=localhost --port=5432 --username=ambari  --dbname=ambari
Password for user ambari: bigdata
ambari=> select * from host_version;

.

In order to know which port your Postgres is listening you can try to look at the followig places.

# grep port /var/lib/pgsql/data/postgresql.conf
# ps -ef | grep pgsql | grep ^postgres
# netstat -tnlpa | grep 5432
# netstat -tnlpa | grep $POSTGRES_PID

.

Similarly you can confirm what is the Port in which your Ambari Server is listening for HTTP/HTTPS requests.

#  grep -e 'client.api.ssl.port\|port' /etc/ambari-server/conf/ambari.properties | grep api


Example:
# netstat -tnlpa | grep `cat /var/run/ambari-server/ambari-server.pid`
tcp6       0      0 :::8440                 :::*                    LISTEN      24715/java          
tcp6       0      0 :::8441                 :::*                    LISTEN      24715/java          
tcp6       0      0 :::8080                 :::*                    LISTEN      24715/java  

 

.

.

Re: postgresql + ambari server failed to open port 8080

Dear Jay

 

finally we found the issue

 

it was about the mistake in /etc/hosts file

 

instead of 127.0.0.1 , it was the ip address - 27.0.0.1

 

so we fix it

 

and restart the postgresql and ambari

 

now all are fine 

 

 

Michael-Bronson
Don't have an account?
Coming from Hortonworks? Activate your account here