Configuring Polaris admin Tool to PostgreSQL

Describes how to configure PostgreSQL metastore to Polaris.

Configuring Polaris Server to PostgreSQL

  1. Change polaris.persistence.type to relational-jdbc in <polaris_home>/server/config/application.properties:
    polaris.persistence.type=relational-jdbc
  2. Add quarkus.datasource.jdbc.url to application.properties:
    quarkus.datasource.jdbc.url=jdbc:postgresql://<HOSTNAME>:5432/
  3. Configure credentials for metastore access using one of the following ways:
    1. Update application.properties:

      Add quarkus.datasource.username and quarkus.datasource.password variables to application.properties:
      quarkus.datasource.username=postgres
      quarkus.datasource.password=password
      OR
    2. Update env variables:

      Add QUARKUS_DATASOURCE_USERNAME and QUARKUS_DATASOURCE_PASSWORD variables to <polaris_home>/server/config/polaris-env.sh:
      export QUARKUS_DATASOURCE_USERNAME=postgres
      export QUARKUS_DATASOURCE_PASSWORD=password
      OR
    3. Use Hadoop credentials provider:

      1. Add quarkus.datasource.username and quarkus.datasource.password to the Keystore:
        hadoop credential create quarkus.datasource.username -value postgres -provider localjceks://file/opt/mapr/polaris/polaris-1.0.1/server/config/polariscreds.jceks
        hadoop credential create quarkus.datasource.password -value password -provider localjceks://file/opt/mapr/polaris/polaris-1.0.1/server/config/polariscreds.jceks
      2. Add POLARIS_CREDS_STORE variable to polaris-env.sh
        export POLARIS_CREDS_STORE=localjceks://file/opt/mapr/polaris/polaris-1.0.1/server/config/polariscreds.jceks

Configuring PostgreSQL metastore for Polaris Admin Tool

  1. Add quarkus.datasource.jdbc.url to <polaris_home>/admin/config/application.properties:
    quarkus.datasource.jdbc.url=jdbc:postgresql://<HOSTNAME>:5432/
  2. Configure credentials for metastore access using one of the following ways:
    1. Use Hadoop credentials provider. If the server is configured to use the Hadoop credentials provider, the admin tool automatically uses the Hadoop configuration. If Hadoop server is already configured, proceed to Step 3.

      OR

    2. Add quarkus.datasource.username and quarkus.datasource.password to application.properties:
      quarkus.datasource.username=postgres
       quarkus.datasource.password=password
  3. To use PostgreSQL as metastore, perform bootstrap initialization using admin tool. Realm must be the same as in application.properties:
    <polaris_home>/bin/admin bootstrap --realm=<realm> -c=<realm,admin_name,secret>
    For example:
    <polaris_home>/bin/admin bootstrap --realm=POLARIS -c=POLARIS,admin,secret