Ambari
  1. Ambari
  2. AMBARI-1792

Postgres init commands change on Fedora 16+

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Fedora 16 (and higher)

      Description

      Migration to systemd instead of initd began in Fedora 15 and the postgres version changed to 9 in Fedora 16. As a consequence, in Fedora 16+ the postgres initdb commands have changed and the /usr/sbin/ambari-server.py script cannot initialize the database.

      Fortunately, there is a Fedora project (cumin) which has dealt with this exact issue from a shell script and should yield a patch

      1. AMARI-1792.patch
        0.9 kB
        Trevor McKay

        Activity

        Trevor McKay created issue -
        Mahadev konar made changes -
        Field Original Value New Value
        Fix Version/s 1.3.1 [ 12324292 ]
        Hide
        Mahadev konar added a comment -

        Thats good to know Trevor. Want to upload a patch here for the server scripts to fix this issue?

        Show
        Mahadev konar added a comment - Thats good to know Trevor. Want to upload a patch here for the server scripts to fix this issue?
        Hide
        Trevor McKay added a comment -

        Yes, will do.

        Show
        Trevor McKay added a comment - Yes, will do.
        Mahadev konar made changes -
        Assignee Trevor McKay [ tmckay ]
        Hide
        Mahadev konar added a comment -

        Thanks Trevor!

        Show
        Mahadev konar added a comment - Thanks Trevor!
        Yusaku Sako made changes -
        Fix Version/s 1.3.1 [ 12324292 ]
        Hide
        Trevor McKay added a comment -

        Oops, this fell off my radar. I'll try to put a patch up soon.

        Show
        Trevor McKay added a comment - Oops, this fell off my radar. I'll try to put a patch up soon.
        Hide
        Trevor McKay added a comment -

        Patch to use postgresql-setup for database initialization if it exists

        Show
        Trevor McKay added a comment - Patch to use postgresql-setup for database initialization if it exists
        Trevor McKay made changes -
        Attachment initdb.patch [ 12600591 ]
        Hide
        Trevor McKay added a comment -

        In Fedora 18+, there is actually a patch that will issue /usr/bin/postgresql-setup initdb if service postgresql initdb is issued.

        But, using postgresql-setup if it is there in ambari-server is safer. First of all it still works pre-F18, and second of all it will continue to work if the compatibility patch is removed from Fedora for some reason (or another distro has the same issue)

        Show
        Trevor McKay added a comment - In Fedora 18+, there is actually a patch that will issue /usr/bin/postgresql-setup initdb if service postgresql initdb is issued. But, using postgresql-setup if it is there in ambari-server is safer. First of all it still works pre-F18, and second of all it will continue to work if the compatibility patch is removed from Fedora for some reason (or another distro has the same issue)
        Mahadev konar made changes -
        Fix Version/s 1.4.1 [ 12324902 ]
        Hide
        Mahadev konar added a comment -

        Trevor before we commit this - can you please test this on rhel5/rhel6?

        Show
        Mahadev konar added a comment - Trevor before we commit this - can you please test this on rhel5/rhel6?
        Hide
        Trevor McKay added a comment -

        Patches both ambari-server and ambari-server.py

        Show
        Trevor McKay added a comment - Patches both ambari-server and ambari-server.py
        Trevor McKay made changes -
        Attachment initdb.patch [ 12601198 ]
        Trevor McKay made changes -
        Attachment initdb.patch [ 12600591 ]
        Hide
        Trevor McKay added a comment -

        Tested database setup on RHEL6.4, init succeeds and database tables are present.

        Show
        Trevor McKay added a comment - Tested database setup on RHEL6.4, init succeeds and database tables are present.
        Mahadev konar made changes -
        Fix Version/s 1.5.0 [ 12325019 ]
        Fix Version/s 1.4.1 [ 12324902 ]
        Hide
        Trevor McKay added a comment -

        This patch creates a default profile which includes the ambari-web build and causes ambari-server to read from ambari-web/public during generation of an rpm.

        It also adds a new profile "static-web" which skips the ambari-web build and causes ambari-server to read from ambari-web/static.

        (ambari-web/static is just a suggestion for a location, the path for static content in the source tree could be anywhere)

        Show
        Trevor McKay added a comment - This patch creates a default profile which includes the ambari-web build and causes ambari-server to read from ambari-web/public during generation of an rpm. It also adds a new profile "static-web" which skips the ambari-web build and causes ambari-server to read from ambari-web/static. (ambari-web/static is just a suggestion for a location, the path for static content in the source tree could be anywhere)
        Trevor McKay made changes -
        Attachment static-web.patch [ 12609480 ]
        Hide
        Trevor McKay added a comment -

        oops, wrong browser window, disregard previous comment

        Show
        Trevor McKay added a comment - oops, wrong browser window, disregard previous comment
        Trevor McKay made changes -
        Attachment static-web.patch [ 12609480 ]
        Trevor McKay made changes -
        Attachment initdb.patch [ 12601198 ]
        Hide
        Trevor McKay added a comment -

        Updated to trunk

        Show
        Trevor McKay added a comment - Updated to trunk
        Trevor McKay made changes -
        Attachment AMARI-1792.patch [ 12617477 ]
        Hide
        Trevor McKay added a comment -

        Retested updated patch on Fedora and RHEL 6.

        Show
        Trevor McKay added a comment - Retested updated patch on Fedora and RHEL 6.
        Hide
        Trevor McKay added a comment -

        Note, tested the changed fragment on RHEL5 as well. But, standard RHEL5 uses /sbin/service postgresql start anyway so it fail. There are lots of other broken things for RHEL5 in ambari-server.py (python version)

        Show
        Trevor McKay added a comment - Note, tested the changed fragment on RHEL5 as well. But, standard RHEL5 uses /sbin/service postgresql start anyway so it fail. There are lots of other broken things for RHEL5 in ambari-server.py (python version)
        Hide
        Chad Roberts added a comment -

        +1

        Show
        Chad Roberts added a comment - +1
        Hide
        Chad Roberts added a comment -

        Committed to trunk.

        Show
        Chad Roberts added a comment - Committed to trunk.
        Hide
        Chad Roberts added a comment -

        commit 764ea58e19daac317ab9d2f1bbb7d3a92fce1aed
        Author: Chad Roberts <croberts@redhat.com>
        Date: Fri Dec 6 16:39:28 2013 -0500

        AMBARI-1792. Postgres init commands change on Fedora 16+ (Trevor McKay via croberts).

        Show
        Chad Roberts added a comment - commit 764ea58e19daac317ab9d2f1bbb7d3a92fce1aed Author: Chad Roberts <croberts@redhat.com> Date: Fri Dec 6 16:39:28 2013 -0500 AMBARI-1792 . Postgres init commands change on Fedora 16+ (Trevor McKay via croberts).
        Chad Roberts made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        246d 1h 40m 1 Chad Roberts 06/Dec/13 21:42

          People

          • Assignee:
            Trevor McKay
            Reporter:
            Trevor McKay
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development