3.3. Using Oozie with PostgreSQL

To set up PostgreSQL for use with Oozie:

  1. On the Ambari Server host, stage the appropriate PostgreSQL connector for later deployment.

    1. Install the connector.

      RHEL/CentOS/Oracle Linux

      yum install postgresql-jdbc*

      SLES

      zypper install -y postgresql-jdbc
    2. Copy the connector .jar file to the Java share directory.

      cp /usr/share/pgsql/postgresql-*.jdbc3.jar /usr/share/java/postgresql-jdbc.jar
    3. Confirm that .jar is in the Java share directory.

      ls /usr/share/java/postgresql-jdbc.jar
    4. Change the access mode of the .jar file to 644.

      chmod 644 /usr/share/java/postgresql-jdbc.jar
    5. Execute the following command:

      ambari-server setup --jdbc-db=postgres --jdbc-driver=/usr/share/java/postgresql-connector-java.jar
  2. Create a user for Oozie and grant it permissions.

    • Using the PostgreSQL database admin utility:

      echo "CREATE DATABASE $OOZIEDATABASE;" | psql -U postgres
      echo "CREATE USER $OOZIEUSER WITH PASSWORD '$OOZIEPASSWORD';" | psql -U postgres
      echo "GRANT ALL PRIVILEGES ON DATABASE $OOZIEDATABASE TO $OOZIEUSER;" | psql -U postgres
    • Where $OOZIEUSER is the Oozie user name, $OOZIEPASSWORD is the Oozie user password and $OOZIEDATABASE is the Hive database name.


loading table of contents...