Support Questions

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

Ambari 2.6.1.5 setup error on Ubuntu 16

avatar
Explorer

Following the instruction from https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.1.5/bk_ambari-installation/content/set_up_the_a...

Package was installed successfully, but failed when creating schema and user with "ambari-server setup". Here is the message

root@msl-dpe-perf75:/usr/local# ambari-server setup
Using python  /usr/bin/python
Setup ambari-server
Checking SELinux...
WARNING: Could not run /usr/sbin/sestatus: OK
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (root):
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
==============================================================================
Enter choice (1): 1
JDK already exists, using /var/lib/ambari-server/resources/jdk-8u112-linux-x64.tar.gz
Installing JDK to /usr/jdk64/
Successfully installed JDK to /usr/jdk64/
JCE Policy archive already exists, using /var/lib/ambari-server/resources/jce_policy-8.zip
Installing JCE policy...
Checking GPL software agreement...
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? y
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL / MariaDB
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
[7] - BDB
==============================================================================
Enter choice (1): 1
Database admin user (postgres): 
Database name (ambari): 
Postgres schema (ambari): 
Username (ambari): 
Enter Database Password (bigdata): 
Default properties detected. Using built-in database.
Configuring ambari database...
Checking PostgreSQL...
Configuring local database...
Configuring PostgreSQL...
Backup for pg_hba found, reconfiguration not required
Creating schema and user...
ERROR: Failed to execute command:['ambari-sudo.sh', 'su', 'postgres', '-', '--command=psql -f /var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql -v username=\'"ambari"\' -v password="\'bigdata\'" -v dbname="ambari"']
ERROR: stderr:psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
ERROR: stdout:
failed to execute queries ...retrying (1)
Creating schema and user...
ERROR: Failed to execute command:['ambari-sudo.sh', 'su', 'postgres', '-', '--command=psql -f /var/lib/ambari-server/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql -v username=\'"ambari"\' -v password="\'bigdata\'" -v dbname="ambari"']
ERROR: stderr:psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
ERROR: stdout:
failed to execute queries ...retrying (2)
Creating schema and user...
ERROR: Exiting with exit code 2. 
REASON: Running database init script failed. Exiting.
root@msl-dpe-perf75:/usr/local# 

Can anyone suggest how to resolve the error?

1 ACCEPTED SOLUTION

avatar

@Harry Li

It is likely the postgresql service was not started. Try to manually start it and re-run ambari-server setup.

service postgresql start

View solution in original post

1 REPLY 1

avatar

@Harry Li

It is likely the postgresql service was not started. Try to manually start it and re-run ambari-server setup.

service postgresql start