tree: 448593e56503c87cd6bf0fc346be32b190186396 [path history] [tgz]
  1. src/
  2. .gitignore
  3. build.properties
  4. pom.xml
  5. README.md
contrib/hawq-ambari-plugin/README.md

HAWQ Ambari Plugin

hawq-ambari-plugin helps users install HAWQ and PXF using Ambari.

To ensure that Ambari recognizes HAWQ and PXF as services that can be installed for a specific stack, the following steps are required:

  • Add HAWQ and PXF metainfo.xml files (containing metadata about the service) under the stack to be installed.
  • Add repositories where HAWQ and PXF rpms reside, so that Ambari can use it during installation. This requires updating repoinfo.xml under the stack HAWQ and PXF is to be added.
  • If a stack is already installed using Ambari, add repositories to the existing stack using the Ambari REST API.

The above steps are taken care of by the hawq-ambari-plugin when the ./add-hawq.py command is used.

Source Code

Source code directory structure of the hawq-ambari-plugin is as follows:

hawq-ambari-plugin
+-- README.md
+-- build.properties
+-- pom.xml
+-- src
    +-- main
        +-- resources
            +-- services
            ¦   +-- HAWQ
            ¦   ¦   +-- metainfo.xml
            ¦   +-- PXF
            ¦       +-- metainfo.xml
            +-- utils
                +-- add-hawq.py

build.properties

build.properties contains properties required for building the plugin.

metainfo.xml

metainfo.xml contains the metadata about the service. The metainfo.xml specifies that the service definition is to be inherited from Ambari common-services. HAWQ and PXF common-services code can be found under Apache Ambari repository.

add-hawq.py

add-hawq.py deploys HAWQ and PXF metainfo.xml files under the stack and adds the repositories to Ambari.

Building the plugin

Build Environment: centos6 is the typical operating system used for building.

Properties specified in the build.properties file:

PropertyDescriptionValue
hawq.release.versionRelease version of HAWQ2.0.1
hawq.common.services.versionHAWQ common services code in Ambari to be inherited2.0.0
pxf.release.versionRelease version of PXF3.0.1
pxf.common.services.versionPXF common services code in Ambari to be inherited3.0.0
hawq.repo.prefixRepository name for HAWQ core repositoryhawq
hawq.addons.repo.prefixRepository name for HAWQ Add Ons repositoryhawq-add-ons
repository.versionRepository Version to be used in repository information2.0.1.0
default.stackDefault stack under which, metainfo.xml and repositories have to be addedHDP-2.4

To build the rpm for hawq-ambari-plugin, change the build.properties file with the required parameters and run mvn install command under hawq-ambari-plugin directory:

$ pwd
hawq/contrib/hawq-ambari-plugin
$ mvn clean resources:copy-resources rpm:rpm -Dbuild_number=1

Usage

Installing the hawq-ambari-plugin rpm would lay down the following directory:

/var/lib/hawq
+-- add-hawq.py
+-- staging
    +-- HAWQ
    ¦   +-- metainfo.xml
    +-- PXF
        +-- metainfo.xml

Prerequisite: Ensure that the script is run on the host where Ambari server is running.

Replace <ambari-username> and <ambari-password> with login Ambari credentials.

If hawq-2.0.1.0 and hawq-add-ons-2.0.1.0 repository have been set up on the Ambari server host, run the following command:

$ ./add-hawq.py --user <ambari-username> --password <ambari-password> --stack HDP-2.5

If --stack is not mentioned, HDP-2.4 stack will be used as default parameter.

If hawq-2.0.1.0 and hawq-add-ons-2.0.1.0 repository have been set up on a different host than the Ambari server host, run the following command:

$ ./add-hawq.py --user <ambari-username> --password <ambari-password> --stack HDP-2.5 --hawqrepo http://my.host.address/hawq-2.0.1.0 --addonsrepo http://my.host.address/hawq-add-ons-2.0.1.0

Please restart ambari-server after running the script so that the changes take effect:

$ ambari-server restart