Support Questions
Find answers, ask questions, and share your expertise

unable to start ambari-server , postgresql failed to start

Highlighted

unable to start ambari-server , postgresql failed to start

Expert Contributor

i have this log :

Error injecting constructor, java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  at org.apache.ambari.server.orm.DBAccessorImpl.<init>(DBAccessorImpl.java:77)
  while locating org.apache.ambari.server.orm.DBAccessorImpl
  while locating org.apache.ambari.server.orm.DBAccessor
    for field at org.apache.ambari.server.orm.dao.DaoUtils.dbAccessor(DaoUtils.java:36)
  at org.apache.ambari.server.orm.dao.DaoUtils.class(DaoUtils.java:36)
  while locating org.apache.ambari.server.orm.dao.DaoUtils
    for field at org.apache.ambari.server.orm.dao.TopologyRequestDAO.daoUtils(TopologyRequestDAO.java:31)
  at org.apache.ambari.server.orm.dao.TopologyRequestDAO.class(TopologyRequestDAO.java:31)
  while locating org.apache.ambari.server.orm.dao.TopologyRequestDAO
    for field at org.apache.ambari.server.topology.PersistedStateImpl.topologyRequestDAO(PersistedStateImpl.java:56)
Caused by: java.lang.RuntimeException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
        at org.apache.ambari.server.orm.DBAccessorImpl.<init>(DBAccessorImpl.java:103)
        at org.apache.ambari.server.orm.DBAccessorImpl$$FastClassByGuice$$86dbc63e.newInstance(<generated>)
        at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
        at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
        at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
        at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
        at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
        at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
        at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
        at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:116)
        at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:110)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
        at com.google.inject.internal.InjectionRequestProcessor$StaticInjection.injectMembers(InjectionRequestProcessor.java:110)

10 REPLIES 10
Highlighted

Re: unable to start ambari-server , postgresql failed to start

@Mourad Chahri

Can you check if the postgres service is running -

$ /etc/init.d/postgresql status

Re: unable to start ambari-server , postgresql failed to start

@Mourad Chahri

if postgresql is down then start it.

/etc/init.d/postgresql start.

Highlighted

Re: unable to start ambari-server , postgresql failed to start

Expert Contributor

yes postgresql is down and failed to start

Highlighted

Re: unable to start ambari-server , postgresql failed to start

@Mourad Chahri Can you pass the logs if the postgresql is still not starting ?

Highlighted

Re: unable to start ambari-server , postgresql failed to start

Explorer

you know where to logs ?

Highlighted

Re: unable to start ambari-server , postgresql failed to start

@ Mourad chahri

can you provide the postgresql logs so we can find the solution for the issue.

Highlighted

Re: unable to start ambari-server , postgresql failed to start

@Mourad Chahri

Can you please check the "ambari.properties" to see if you are using the correct postgres instance?

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

server.jdbc.user.name=ambari
server.jdbc.postgres.schema=ambari
server.jdbc.user.passwd=/etc/ambari-server/conf/password.dat
server.jdbc.database=postgres
server.jdbc.database_name=ambari

If you are using embedded Postgres then please check if it is listening on port 5432 (default port or not)

Example:

# netstat -tnlpa | grep 5432

tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 1480/postmaster
tcp 0 0 127.0.0.1:5432 127.0.0.1:47837 ESTABLISHED 7753/postgres
tcp 0 0 127.0.0.1:5432 127.0.0.1:37801 ESTABLISHED 31055/postgres
tcp 0 0 127.0.0.1:5432 127.0.0.1:47842 ESTABLISHED 7756/postgres
tcp 0 0 127.0.0.1:5432 127.0.0.1:47846 ESTABLISHED 7763/postgres    
Highlighted

Re: unable to start ambari-server , postgresql failed to start

@Mourad Chahri if the above does not resolve the issue then please do a fresh ambari server yum install.

Highlighted

Re: unable to start ambari-server , postgresql failed to start

Expert Contributor

yes that what i did it but not fresh install , i didnt reset ambari-server and it's work