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.

Unable to start Ambari

Unable to start Ambari

Explorer

Dear Community,

 

I have configured Ambari with the Database Postgres Option 4 with default values.When I tried to start it then I got fatal error : connection refused.

 

I checked the ports :

[root@luapp698 bin]# netstat -ltnp | grep postgres
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 15503/postgres
tcp6 0 0 ::1:5432 :::* LISTEN 15503/postgres

 

the pg_hba.conf is configured as

 

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident

 

the /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

10.48.142.27 server1.internal.com server1

the /var/lib/pgsql/data/postgresql.conf is configured 

#listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)

The error message 

Using python /usr/bin/python2.7
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start.........Unable to determine server PID. Retrying...
......Unable to determine server PID. Retrying...

 

WARNING: ConnectException occurred while connecting to server1internal.com:5432
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)

 

SEVERE: Connection error:
org.postgresql.util.PSQLException: Connection to server1.internal.com:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:245)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:452)
at org.postgresql.Driver.connect(Driver.java:254)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:207)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:760)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:265)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:731)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:205)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:305)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)
at com.google.inject.persist.jpa.JpaPersistService.begin(JpaPersistService.java:77)
at com.google.inject.persist.jpa.AmbariJpaPersistService.begin(AmbariJpaPersistService.java:28)
at org.apache.ambari.server.orm.AmbariLocalSessionInterceptor.invoke(AmbariLocalSessionInterceptor.java:40)
at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:77)
at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
at org.apache.ambari.server.orm.dao.MetainfoDAO$$EnhancerByGuice$$80aba585.findByKey(<generated>)
at org.apache.ambari.server.checks.DatabaseConsistencyCheckHelper.checkDBVersionCompatible(DatabaseConsistencyCheckHelper.java:230)
at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:1104)
Caused by: java.net.ConnectException: Connection refused (Connection refused)

 

 

Could you please assist?

Shall I modify the etc/hosts?

 

Thanks and Regards

Asma

8 REPLIES 8

Re: Unable to start Ambari

Cloudera Employee

I'm not sure which versions you are using, but it does appear that your pg_hba.conf is not going to allow the connections. Check these articles and see if they help.

https://docs.cloudera.com/HDPDocuments/Ambari-2.7.4.0/bk_ambari-installation/content/postgres-remote...

 

https://docs.cloudera.com/HDPDocuments/Ambari-2.7.4.0/bk_ambari-installation/content/configuring_ipt...

 

If you haven't made these changes, I would point you to this document, as well, so you can confirm you have completed the PostgreSQL setup steps.

https://docs.cloudera.com/HDPDocuments/Ambari-2.7.4.0/administering-ambari/content/amb_using_ambari_...

Re: Unable to start Ambari

Explorer

Hello

 

I have tried everything but now I got this error message

 

WARNING: SQLException occurred while connecting to luapp698.lu.ema.ad.pwcinternal.com:5432
org.postgresql.util.PSQLException: FATAL: role "ambari" does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2566)
at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:131)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:210)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:452)
at org.postgresql.Driver.connect(Driver.java:254)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:207)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:760)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:265)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:731)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:205)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:305)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)
at com.google.inject.persist.jpa.JpaPersistService.begin(JpaPersistService.java:77)
at com.google.inject.persist.jpa.AmbariJpaPersistService.begin(AmbariJpaPersistService.java:28)
at org.apache.ambari.server.orm.AmbariLocalSessionInterceptor.invoke(AmbariLocalSessionInterceptor.java:40)
at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:77)
at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
at org.apache.ambari.server.orm.dao.MetainfoDAO$$EnhancerByGuice$$80aba585.findByKey(<generated>)
at org.apache.ambari.server.checks.DatabaseConsistencyCheckHelper.checkDBVersionCompatible(DatabaseConsistencyCheckHelper.java:230)
at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:1104)

 

 

 

My files :

 

vi /var/lib/pgsql/data/pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 0.0.0.0/0 trust
# IPv6 local connections:
host all all ::/0 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident

and 

# vi /var/lib/pgsql/data/postgresql.conf

# - Connection Settings -

listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)

 

Ambari version : 2.7.4

 

Thanks in advance

Re: Unable to start Ambari

Cloudera Employee

It seems you have not created the Ambari user.

 

Can you please share the instructions from which you working? If appears that you are using incomplete instructions or you are missing some setup steps.

 

One of the links I provided included settings for the PostgreSQL configuration files. Please verify you have made those changes. 

Unable to login to Ambari

Explorer

Dear Community,

 

I have started the ambari single server successfully. But when I tried to login I got error like username/password are not correct. 

Although I kept default values, In the log files I have this error  

 

User not found: ambari
2019-11-11 18:13:45,429 INFO [ambari-client-thread-33] AmbariAuthenticationEventHandlerImpl:137 - Failed to authenticate ambari: The user does not exist in the Ambari database

 

However , I am connectinf to the DB

psql -h servername -U ambari -d ambari -W
Password for user ambari:
psql (9.2.24)
Type "help" for help.

ambari=> ^C

 

Any idea please?

 

Thanks

 

 

Re: Unable to login to Ambari

Super Mentor

@asmarz 

One of the possible reason might be that your ambari server might be trying to connect to a wrong DB host.

So can you please share the output of the following command:

# grep jdbc /etc/ambari-server/conf/ambari.properties

Above command should show the DB URL. Please confirm if the DB Hostname & Port used is correct .
Also  "server.jdbc.user.passwd" property should tell what is the pasword. It may point to a file where the DB password is stored) please confirm if that is correct.

 

Re: Unable to login to Ambari

Explorer

thanks problem fixed

Highlighted

Re: Unable to login to Ambari

Super Mentor

@asmarz  Good to know that the issue is resolved. 
If your question is answered then, Please make sure to mark the answer as the accepted solution which might be helpful for others.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Re: Unable to login to Ambari

Super Mentor

@asmarz 
As the issue is resolved so it will be best to close this thread by marking it Solved.

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