Configuring Polaris admin Tool to PostgreSQL
Describes how to configure PostgreSQL metastore to Polaris.
Configuring Polaris Server to PostgreSQL
- Change
polaris.persistence.typetorelational-jdbcin<polaris_home>/server/config/application.properties:polaris.persistence.type=relational-jdbc -
Add
quarkus.datasource.jdbc.urltoquarkus.datasource.jdbc.url=jdbc:postgresql://:5432/<polaris_db>:quarkus.datasource.jdbc.url=jdbc:postgresql://<HOSTNAME>:5432/<polaris_db>where
<polaris_db>is name of the database in PostgreSQL. - Configure credentials for metastore access using one of the following ways:
-
Update
application.properties:Addquarkus.datasource.usernameandquarkus.datasource.passwordvariables to<polaris_home>/server/config/application.properties:
ORquarkus.datasource.username=postgres quarkus.datasource.password=password -
Update env variables:
AddQUARKUS_DATASOURCE_USERNAMEandQUARKUS_DATASOURCE_PASSWORDvariables to<polaris_home>/server/config/polaris-env.sh:
ORexport QUARKUS_DATASOURCE_USERNAME=postgres export QUARKUS_DATASOURCE_PASSWORD=password -
Use Hadoop credentials provider:
- Add
quarkus.datasource.usernameandquarkus.datasource.passwordto 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 - Add
POLARIS_CREDS_STOREvariable topolaris-env.shexport POLARIS_CREDS_STORE=localjceks://file/opt/mapr/polaris/polaris-1.0.1/server/config/polariscreds.jceks
- Add
-
Configuring PostgreSQL metastore for Polaris Admin Tool
- Add
quarkus.datasource.jdbc.urltopolaris_home>/admin/config/application.properties:quarkus.datasource.jdbc.url=jdbc:postgresql://<HOSTNAME>:5432/<polaris_db>where
<polaris_db>is name of the database in PostgreSQL. - Configure credentials for metastore access using one of the following ways:
- 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
- Add
quarkus.datasource.usernameandquarkus.datasource.passwordto<polaris_home>/admin/config/application.properties:quarkus.datasource.username=postgres quarkus.datasource.password=password
- 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.
- To use PostgreSQL as metastore, perform bootstrap initialization
using admin tool. Realm must be the same as in
<polaris_home>/admin/config/application.properties:
For example:<polaris_home>/bin/admin bootstrap --realm=<realm> -c=<realm,admin_name,secret><polaris_home>/bin/admin bootstrap --realm=POLARIS -c=POLARIS,admin,secret