Installing Stored Procedures on HAWQ

Follow these steps to install Team Studio stored procedures within a HAWQ database.

Perform this task on the server side withing HAWQ.

Prerequisites

  • HAWQ must be installed and running.
  • The database administrator must own the database_setup directory and all the content in it.

Procedure

  1. Verify that the master node can communicate with theTeam Studio server.
    1. Modify the file /etc/hosts on the Team Studio server to include the HAWQ master node IP address and hostname.
    2. Modify the file /etc/hosts on the HAWQ master node to include the Team Studio IP address and hostname.
  2. On the HAWQ master host, create a folder called /home/gpadmin/database_setup.
  3. Use secure copy (SCP) to transfer $CHORUS_HOME/alpine-current/database_setup.zip from the Team Studio server to the HAWQ master node.

    Place it in the folder /home/gpadmin/database_setup.

  4. Unzip the database_setup.zip file.

    This generates several folders.

    unzip /home/gpadmin/database_setup/database_setup.zip
    1. If the HAWQ database administrator does not possess the ownership of this directory, then issue the chown command to reassign the ownership.
      # chown -R gpadmin:gpadmin /home/gpadmin/database_setup/
  5. Log in to the system as the HAWQ administrator (for example, gpadmin) on the HAWQ master host.
    # su - gpadmin
  6. Set the search path to include the public schema.
  7. Navigate to the database_setup/HAWQ directory.
    $ cd /home/gpadmin/database_setup/HAWQ
  8. Run the Team Studio installer (the .bin file).
    $ sh alpine_miner_installer_HAWQ.bin
    1. Read and accept the license agreement.
    2. Specify the HAWQ installation path. The setup places the required shared library in the directory $HAWQHOME/lib/postgres/.
    3. Specify if the installer should copy the shared library to the segment hosts. Enter y for multi-node clusters.
    4. If you entered y, then enter the full path to the file containing the segment host names.

      You can create your own host file. For example, create a file /tmp/hostfile and add all the segment host names or IP addresses one after the other in the file, similar to the following.

      segmenthost1
      segmenthost2
      segmenthost3
      /path/to/hostfile_gpinitsystem 
      (or /tmp/hostfile)
    5. Specify the default database to install the Team Studio functions.
    6. Specify the port on which the HAWQ database is running.
    7. Specify if you would like to create the Team Studio demo database.
    8. Verify the shared library exists on each segment node.
  9. Modify the file /var/lib/pgsql/data/pg_hba.conf to allow users access to the appropriate databases.

    Using the miner_demo database as an example, add the following lines to the end of pg_hba.conf.

    local miner_demo miner_demo trust
    host miner_demo miner_demo 192.168.1.0/24 password
  10. Reload the HAWQ database to activate the changes made in the configuration file.
    $ gpstop -u