Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

ambari-server was lost after uninstalling postgresql

ambari-server was lost after uninstalling postgresql

New Contributor

I have installed Ambari with stand-alone database. I have invested a lot of time in setting the cluster (Spark dependencies for many projects, Yarn configurations, etc). I run ambari-server as root, HDP version is 2.6.3.0-235, OS is Ubuntu 16.04

I had experienced problems in stating the ambari-server (service ambari-server start), specifically, there were connection problems related to postgres. I found postgres-9.5 installed on that system and removed it (apt-get remove postgres-9.5).

Now, all the problems have started, after I have done that, ambari-server service was no longer available. The problem I got:

Failed to start ambari-server.service: Unit ambari-server.service not found.

Now, I have tried running ambari-server install again and hope it would repair the problem (I saw ambari-server files at many locations on the machine but the service definition was missing).

I have stumbled upon the problems:

apt-get install ambari-server
# resulted in the following error:
Some packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies: ambari-server : Depends: postgresql (>= 8.1) but it is not going to be installedE: Unable to correct problems, you have held broken packages.
apt-get upgrade ambari-server
# resulted in the following error:
Some packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies: postgresql : Depends: postgresql-11 but it is not going to be installedE: Broken packages

I tried manually installing postgres 9.5 as before and I still get the error:

Depends: postgresql (>= 8.1)

I was not able to install postgres-11 due to missing dependencies (libicu52) not found.

What can I do to fix it?

1 REPLY 1

Re: ambari-server was lost after uninstalling postgresql

Hi @Anton P ,

It will be almost impossible to recover ambari if you have not taken any database backup before this operation.

If you have taken ambari database backup , your safest option will be

> Setup/spin a new ubuntu cluster
> Install ambari there (fresh installation) 
> perform ambari-server setup too , but dont start it yet.
>login to postgress database as postgress user :
  > DROP DATABASE AMBARI;
  > CREATE DATABASE AMBARI
> exit the postgres
> Now execute : psql -U ambari ambari < ~/ambari_backup.sql
> Start ambari.
 --it will have all the configured stuff back.

Source : https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.2/bk_ambari-administration/content/ch_amb_re...

If you have not taken any database backup , i am afraid there will be lot of tasks as your database is vanished. its always better to contact Hortonworks Support Team to recover your cluster if its production and impating the production jobs.

Please accept this answer if you found it helpful.