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

While Setting up Ambari Server, getting the error: "exit code:3 ambari server not running"

Cloudera Employee
1 ACCEPTED SOLUTION

Accepted Solutions

Expert Contributor

Could you follow below process

1)# sudo service postgresql start

Starting postgresql service:[FAILED]

If failed

2))Moved the data directory to

[root@centos pgsql]# cd /var/lib/pgsql

[root@centos pgsql]# mv -f data/ data_bkp

[root@centos pgsql]# pwd

/var/lib/pgsql

3) Check how your postgresql address how its listening

$ grep listen /var/lib/pgsql/data/postgresql.conf

if 'localhost' change to "*"

4) Start the postgresql database

# sudo service postgresql start ( It should be ok)

Then proceed with install ambari and setup the server.

View solution in original post

3 REPLIES 3

Expert Contributor

Could you follow below process

1)# sudo service postgresql start

Starting postgresql service:[FAILED]

If failed

2))Moved the data directory to

[root@centos pgsql]# cd /var/lib/pgsql

[root@centos pgsql]# mv -f data/ data_bkp

[root@centos pgsql]# pwd

/var/lib/pgsql

3) Check how your postgresql address how its listening

$ grep listen /var/lib/pgsql/data/postgresql.conf

if 'localhost' change to "*"

4) Start the postgresql database

# sudo service postgresql start ( It should be ok)

Then proceed with install ambari and setup the server.

View solution in original post

New Contributor

Hi Abhirup,

In order to solve this issue, please follow the below steps:-

1) Run your ambari-server setup in verbose and you will see where exactly this fails.

INFO: about to run command: /usr/bin/env service postgresql status

Running initdb: This may take upto a minute.

INFO: about to run command: /usr/bin/env service postgresql initdb

About to start PostgreSQL INFO: about to run command: /usr/bin/env service postgresql status

ERROR: Exiting with exit code 3. REASON: Unable to start PostgreSQL server. Exiting Now,

If you manually try and run the below command, you will get the exact cause of the issue.

[root@robin-lab-1 ~]# /usr/bin/env service postgresql initdb Initializing database: mkdir: cannot create directory `/var/lib/pgsql/data/pg_log': File exists [FAILED]

Solution: Go inside /var/lib/pgsql/, backup and remove the data folder and re-run the ambari-server setup.

Explorer

This solution worked for me. Thanks!