Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

unable to start postgres for ambari

avatar
Master Guru

I am trying to start ambari and it fails while starting postgres on the sandbox.

[root@sandbox ~]# ambari-server restart Using python /usr/bin/python2 Restarting ambari-server Using python /usr/bin/python2 Stopping ambari-server Ambari Server is not running Using python /usr/bin/python2 Starting ambari-server Ambari Server running with administrator privileges. Running initdb: This may take upto a minute. About to start PostgreSQL ERROR: Exiting with exit code 3. REASON: Unable to start PostgreSQL server. Status stopped. . Exiting

I tried to start postgres

[root@sandbox ~]# service postgresql start Starting postgresql service: [FAILED]

Then I ran a postgres status:

[root@sandbox ~]# service postgresql status postmaster is stopped

I am not sure how to start postmaster. I tried

[root@sandbox ~]# pg_ctl start pg_ctl: cannot be run as root Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.

Any other ideas?

19 REPLIES 19

avatar
Super Guru
su - postgres
pg_ctl status
pg_ctl start

avatar
Master Guru

@Jitendra Yadav thanks for your response. It did not work.

avatar
Super Guru

I didn't expected it to work 🙂 , just shared because you had issue with pg_ctl start pg_ctl with root.

can you please check postgres logs on below location and see if there is any clue?

/var/lib/pgsql/data/pg_log

avatar
Master Guru

@Jitendra Yadav I looked at the logs and all I found is this:

CONTEXT: line 79 of configuration file "/var/lib/pgsql/data/pg_hba.conf"

FATAL: could not load pg_hba.conf

Any ideas?

avatar

Sunile, is there anything interesting in /var/lib/pgsql/pgstartup.log?

avatar
Explorer

Please check /tmp permissions then restart ambari server.

avatar
Explorer

Also select Enter advanced database configuration [y/n] (n)? y

avatar
Master Guru

5491-2016-07-04-23-08-00.jpg

@Mudit Kumar tmp permissions look good. How do I enter advanced database configuration? And why?

avatar
Master Guru

@slachterman I check the pgstartup.log and see this:

runuser: cannot set groups: Operation not permitted runuser: cannot set groups: Operation not permitted runuser: cannot set groups: Operation not permitted runuser: cannot set groups: Operation not permitted