Support Questions

Find answers, ask questions, and share your expertise

Ambari-server setup searches postgres in wrong location

avatar
Explorer

i am installing ambari-server with RHEL7.3 but unfortunately it fails, when I run it with verbose: `ambari-server setup -v` I am getting the following error:

Traceback (most recent call last):
File "/usr/sbin/ambari-server.py", line 951, in <module>
mainBody()
File "/usr/sbin/ambari-server.py", line 921, in mainBody
main(options, args, parser)
File "/usr/sbin/ambari-server.py", line 873, in main
action_obj.execute()
File "/usr/sbin/ambari-server.py", line 78, in execute
self.fn(*self.args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/ambari_server/serverSetup.py", line 1144, in setup
_setup_database(options)
File "/usr/lib/python2.6/site-packages/ambari_server/serverSetup.py", line 960, in _setup_database
dbmsAmbari.setup_database()
File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration.py", line 150, in setup_database
self._setup_local_database()
File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration_linux.py", line 479, in _setup_local_database
retcode, out, err = self._configure_postgres()
File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration_linux.py", line 748, in _configure_postgres
PGConfig._configure_pg_hba_postgres_user()
File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration_linux.py", line 727, in _configure_pg_hba_postgres_user
pg_hba_conf_file_content_in = sudo.read_file(PGConfig.PG_HBA_CONF_FILE)
File "/usr/lib/python2.6/site-packages/resource_management/core/sudo.py", line 144, in read_file
with open(filename, "rb") as fp:
IOError: [Errno 2] No such file or directory: '/var/lib/pgsql/data/pg_hba.conf'

As you can see Ambari searches the conf file in '/var/lib/pgsql/data/pg_hba.conf' where its actual location is: '/var/lib/pgsql/9.2/data/pg_hba.conf'

I couldn't find any Ambari config for specifying that path, any help would be really appreciated.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Anton P

If you a re using Non Default Postgres (here we see that you are using Postgres 9.5) in that case while doing the ambari-server setup you MUST choose the Option [4] PostgreSQL Instead of Option 1 (Embedded)

Enter advanced database configuration [y/n] (n)? y
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere

.

Also if you want to use Non Default Postgres then you should configre it prior to setup ambari as :

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.2.0/bk_ambari-administration/content/using_amba...

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@Anton P

If you a re using Non Default Postgres (here we see that you are using Postgres 9.5) in that case while doing the ambari-server setup you MUST choose the Option [4] PostgreSQL Instead of Option 1 (Embedded)

Enter advanced database configuration [y/n] (n)? y
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere

.

Also if you want to use Non Default Postgres then you should configre it prior to setup ambari as :

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.2.0/bk_ambari-administration/content/using_amba...

avatar
Master Mentor

@Anton P

Also you should refer to the Support Matrics if you are planning to move to production with this version of Postgres:

NOTE: Database Requirement https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.2/bk_support-matrices/content/ch_matrices-amb...

*** Use of an existing PostgreSQL 9.4 is only supported with HDP 2.5 or later.

.

avatar
Master Mentor

@Anton P

Did it work?

avatar
Explorer

It was exactly the issue, only the version I had installed is 9.2.

I followed the instructions for the pre-installed database and it worked perfectly.

Thanks alot.