Home Forums HDP on Linux – Installation Ambari fails, postgresSQL fails

This topic contains 20 replies, has 14 voices, and was last updated by  Dave 5 months ago.

  • Creator
    Topic
  • #17453

    petri koski
    Member

    Hello,

    I am trying to install Ambari server. When I do ambari-server setup postgres fails to start. I did yum install postgress etc. in order to “older” version but no luck, because I read 9.x versio is installed and only 8.xx is needed.. I am still unable to start Postgres. I am using Centos 6, 64bit ..

Viewing 20 replies - 1 through 20 (of 20 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #54149

    Dave
    Moderator

    Hi Chad,

    HDP 1.2 is very old.
    Postgres is installed by ambari as a dependency so it takes default values.
    However you can use MySQL, Oracle or Postgres as a backend if you have a look at the latest documentation.

    If you want to open a new post about the issue you are having then I will be happy to help,

    Dave

    Collapse
    #54146

    cvvs
    Participant

    Seth, this is a deal breaker. Hard-coded, non-configurable paths a no-no. It’s not a bug, it’s horrible design, and it’s over a year old.

    Additionally, the link you provided is NOT AT ALL relevant to Maxim’s post… not even a tiny bit relevant.

    Collapse
    #46643

    Saisiva Sababathy
    Participant

    Default properties detected. Using built-in database.
    Checking PostgreSQL…
    Running initdb: This may take upto a minute.
    About to start PostgreSQL
    ERROR: Exiting with exit code 1. Reason: Unable to start PostgreSQL server. Exiting

    Installed postgres sql 9.3 and removed, made the changes to ambari-server.py and created ln … but still no luck any help here is really appreciated

    Collapse
    #34387

    Hi there,

    Will you get this issue fixed at some point?
    I’m on a RHEL 6.2 and as Maxim Mikheev mentioned 4 months ago, it just can’t work as it’s currently scripted the wrong way.
    Line 123 of /usr/sbin/ambari-server.py file instantiates PG_HBA_DIR = “/var/lib/pgsql/data/” which is wrong.

    On my machine data folder can be find under /var/lib/pgsql/9.2/ meaning that the soft link trick doesn’t work.

    Regards,

    Charles

    Collapse
    #25583

    Seth Lyubich
    Keymaster

    Hi Maxim,

    Thanks for your feedback. We will take a look at your suggestions. However, here is a link with the supported OS:

    http://docs.hortonworks.com/HDPDocuments/HDP1/HDP-1.2.3.1/bk_using_Ambari_book/content/ambari-chap1-2.html#ambari-chap1-2-2

    Can you please let us know if you were able to complete installation?

    Thanks,
    Seth

    Collapse
    #25548

    I have the same issue. Many operations system install postrgre data dir in the different location.

    The “bug” is in the file: /usr/sbin/ambari-server.py
    It has a line:
    PG_HBA_DIR = “/var/lib/pgsql/data/”
    The problem is that amazon linux ami installs it to a folder: “/var/lib/pgsql9/data”
    So the hard coding a path is an issue. It need to be taken from postgre by command like

    psql -c “show hba_file”

    Unfortunately you need to know the user and password which ambari used for installation.

    The temporary work a round could be soft links:
    sudo locate pg_hba.conf # get actual path to file in my case it was: /var/lib/pgsql9/data/pg_hba.conf
    sudo ln -s /var/lib/pgsql9 /var/lib/pgsql

    The another option is to use this command:
    cat /etc/init.d/postgresql | grep “PGDATA=”
    In my case it returns: PGDATA=/var/lib/pgsql9/data

    Can anyone update the code in repository?

    Collapse
    #21907

    Sasha J
    Moderator

    Good to know you solve the problem!

    Have a good one.

    Sasha

    Collapse
    #21904

    Lance Fang
    Participant

    This issue is solved by installing postgres’s packages

    Collapse
    #21903

    Lance Fang
    Participant

    Yi,

    Apologized for my ignorants, but do you have the steps on how? Appreciate any helps ..

    Collapse
    #21902

    Yi Zhang
    Moderator

    Hi Lance,

    It looks like yum can’t find postgres in your repository. You can either make sure your repo provides it, or install postgres* packages manually.

    Thanks,
    Yi

    Collapse
    #21901

    Lance Fang
    Participant

    Help!!!!

    I am hitting this exact problem and I don’t believe I have any postgressql installed. Please show me steps on how install

    ==
    [root@dwbi-durl-gphd0 ~]# yum install ambari-server
    Loaded plugins: product-id, security, subscription-manager
    Updating certificate-based repositories.
    Unable to read consumer identity
    Setting up Install Process
    Resolving Dependencies
    –> Running transaction check
    —> Package ambari-server.noarch 0:1.2.2.5-1 will be installed
    –> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server-1.2.2.5-1.noarch
    –> Finished Dependency Resolution
    Error: Package: ambari-server-1.2.2.5-1.noarch (Updates-ambari-1.x)
    Requires: postgresql-server >= 8.1
    You could try using –skip-broken to work around the problem
    You could try running: rpm -Va –nofiles –nodigest
    [root@dwbi-durl-gphd0 ~]#
    ==

    [root@dwbi-durl-gphd0 ~]# rpm -qa postg*
    [root@dwbi-durl-gphd0 ~]#

    Collapse
    #18350

    There are three things I would try. First, I’d try erasing packages and reinstalling. If using a VM or instance on AWS, erasing and reinstalling and bringing down the Ambari rpm is not too difficult or time consuming. I’d try erasing PostgreSQL and Ambari. The information at this link shows files I would target for erase:

    http://docs.hortonworks.com/HDPDocuments/HDP1/HDP-1.2.2/bk_using_Ambari_book/content/ambari-chap1-5-1.html

    Second, I might try using rpm to get a specific version of PostgrSQL Here is info on the PostgreSQL site about this:

    http://yum.postgresql.org/repopackages.php

    http://yum.postgresql.org/packages.php

    Third, if I was using a VM or AWS instance, I’d spin up a new instance and try for a fresh install, tweaking thing a little bit, like, for example, selecting a different version of the OS to get a different AMI. This can take as little as an hour to get to the point of the ambari-server setup command.

    Collapse
    #18284

    Phillip,

    Postgres is already installed on my system:

    [root@localhost ~]# yum install postgresql
    Loaded plugins: rhnplugin, security, subscription-manager
    This system is receiving updates from Red Hat Subscription Management.
    This system is not registered with RHN Classic or RHN Satellite.
    You can use rhn_register to register.
    RHN Satellite or RHN Classic support will be disabled.
    rhel-5-client-rhev-agent-rpms | 2.8 kB 00:00
    rhel-5-desktop-beta-source-rpms | 2.6 kB 00:00
    rhel-5-desktop-rpms | 3.7 kB 00:00
    Setting up Install Process
    Package postgresql-8.1.23-6.el5_8.x86_64 already installed and latest version
    Nothing to do

    [root@localhost ~]# rpm -qa postg*
    postgresql-8.1.23-6.el5_8
    postgresql-libs-8.1.23-6.el5_8

    ————-

    Attempt to install Amberi:

    [root@localhost ~]# yum install ambari-server
    Loaded plugins: rhnplugin, security, subscription-manager
    This system is receiving updates from Red Hat Subscription Management.
    This system is not registered with RHN Classic or RHN Satellite.
    You can use rhn_register to register.
    RHN Satellite or RHN Classic support will be disabled.
    rhel-5-client-rhev-agent-rpms | 2.8 kB 00:00
    rhel-5-desktop-beta-source-rpms | 2.6 kB 00:00
    rhel-5-desktop-rpms | 3.7 kB 00:00
    Setting up Install Process
    Resolving Dependencies
    –> Running transaction check
    —> Package ambari-server.noarch 0:1.2.1.2-1 set to be updated
    –> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server
    –> Processing Dependency: python26 for package: ambari-server
    –> Running transaction check
    —> Package ambari-server.noarch 0:1.2.1.2-1 set to be updated
    –> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server
    —> Package python26.x86_64 0:2.6.8-2.el5 set to be updated
    –> Processing Dependency: libpython2.6.so.1.0()(64bit) for package: python26
    –> Processing Dependency: libffi.so.5()(64bit) for package: python26
    –> Running transaction check
    —> Package ambari-server.noarch 0:1.2.1.2-1 set to be updated
    –> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server
    —> Package libffi.x86_64 0:3.0.5-1.el5 set to be updated
    —> Package python26-libs.x86_64 0:2.6.8-2.el5 set to be updated
    –> Finished Dependency Resolution
    ambari-server-1.2.1.2-1.noarch from Updates-ambari-1.x has depsolving problems
    –> Missing Dependency: postgresql-server >= 8.1 is needed by package ambari-server-1.2.1.2-1.noarch (Updates-ambari-1.x)
    Error: Missing Dependency: postgresql-server >= 8.1 is needed by package ambari-server-1.2.1.2-1.noarch (Updates-ambari-1.x)
    You could try using –skip-broken to work around the problem

    ———

    Could this be due to yum installing Postgres 8.1 instead of 8.4 since 8.4 had worked for you?

    Collapse
    #18275

    At Petri,Marty. Please cut and paste command lines and output for this command. Show us what you have installed.

    rpm -qa postg*

    Also, be sure that you’re setting up Ambari after installing it. The command to set it up is:

    ambari-server setup

    The setup up process will prompt you twice with questions. Use keyboard input ‘n’ for first question and ‘y’ for second question.

    Collapse
    #18258

    I am also trying to install Ambari Server and running into a Postgres problem. I am on a RHEL 5.9 server 64 bit and am getting the following error from the Amberi install:

    –> Finished Dependency Resolution
    ambari-server-1.2.1.2-1.noarch from Updates-ambari-1.x has depsolving problems
    –> Missing Dependency: postgresql-server >= 8.1 is needed by package ambari-server-1.2.1.2-1.noarch (Updates-ambari-1.x)
    Error: Missing Dependency: postgresql-server >= 8.1 is needed by package ambari-server-1.2.1.2-1.noarch (Updates-ambari-1.x)

    I do not see any occurrences of postgres when running – rpm -qa | grep postgres*

    When I run -service postgresql start
    I get back – postgresql: unrecognized service

    I assume that the ambari install will download the dependency when it is found to be missing correct?

    Just in case the Amberi install will not automatiaclly download its dependencies I just installed Postgres via – yum install postgresql – just to see if that would make a difference and it did not.

    It had installed 8.1.23-6.el5_8 for me BTW.

    Any suggestions?

    Collapse
    #17711

    I spun up a new instance this afternoon and was able to successfully complete the ambari-server setup command. If you are still having trouble, first try removing PostgresSQL 9.1 using the command:

    yum erase postgresql91

    Then try installing postgreSQL 8.4 via:

    yum install postgresql

    This did install PostgreSQL 8.4 for me. Then, the ambari-server setup command completed.

    I installed Ambari server before messing with the PostgreSQL version. If you rerun the Ambari install after removing PostgreSQL, version 9 will reinstall.

    Note: Within minutes of executing yum install ambari-server this afternoon, different versions of PostgreSQL came down. Maybe the code fix for the problem was implemented.

    Collapse
    #17570

    tedr
    Moderator

    Hi Petri,

    Have you had a chance to try Phillip’s or Larry’s suggestions?

    Thanks,
    Ted.

    Collapse
    #17532

    Another thing to check. Have your tried starting Postgres from the command prompt?

    Try this command. If it’s installed, you’ll see something like this:

    [user@ip-10-253-1-1 ~]$ service postgresql start
    Starting postgresql service: [ OK ]
    [user@ip-10-253-1-1 ~]$

    To check if Postgres is running:

    [user@ip-10-253-1-1 ~]$ service postgresql status
    postmaster (pid 4681) is running…
    [user@ip-10-253-1-1 ~]$

    If it’s not installed, you’ll see something like this:

    [user@ip-10-67-8-1 ~]$ service postgresql start
    postgresql: unrecognized service
    [user@ip-10-67-8-1 ~]$

    -Phil

    Collapse
    #17531

    Make sure Postgres is installed. Use this command to see what version or versions of Postgres are installed on your instance:

    rpm -qa | grep postgres*

    If PostgreSQL is not installed, you won’t receive any output from the command. Your terminal will look like this:

    [user@ip-10-12-1-1 ~]$ rpm -qa postg*
    [user@ip-10-12-1-1 ~]$

    If one or more versions are installed, you’ll see something like this:

    [user@ip-10-12-61-179 ~]$ rpm -qa postg*
    postgresql91-libs-9.1.5-3PGDG.rhel6.x86_64
    postgresql-libs-8.4.13-1.el6_3.x86_64
    postgresql91-server-9.1.5-3PGDG.rhel6.x86_64
    postgresql91-9.1.5-3PGDG.rhel6.x86_64
    postgresql-8.4.13-1.el6_3.x86_64
    postgresql-server-8.4.13-1.el6_3.x86_64
    [user@ip-10-12-61-179 ~]$

    -Phil

    Collapse
    #17455

    Larry Liu
    Moderator

    Hi, Petri,

    Thanks for trying HDP

    Can you please try to remove postgres? Then try ambari-server reset. After clean up, please try again.

    Larry

    Collapse
Viewing 20 replies - 1 through 20 (of 20 total)