One catalog,
several engines.
Four scenarios: how the metastore is accessed and what comes by default, the database in a shared PostgreSQL, the warehouse in Ozone, and the connection with Trino, Spark, Iceberg, and Delta Lake. Each one covers: what changes, the configuration block commented line by line, and the verification.
The tdp-hive-metastore chart connects the metastore to two things in its own values file: PostgreSQL, which stores metadata, and the warehouse, which stores table data. Consumers, such as Trino and Spark, work the other way around: each receives the metastore Thrift address in its own chart's values file.
Your environment
If you fill in your environment details here, the examples and commands on the page use what you provided. The namespace, the release name and the values file are your choices, not the chart's.
Scenarios
- 1 · How it is accessed
- 2 · Shared PostgreSQL
- 3 · Warehouse in Ozone
- 4 · Consumers
The Thrift address consumers receive and where the database and warehouse are by default.
The other components reach Hive Metastore through the Thrift address of the Service <RELEASE_NAME>-metastore, on the port in metastore.port, and each receives that address in its own chart's values file. What the Hive Metastore chart decides is where the database and warehouse are stored: by default, both are in the release itself, in embedded PostgreSQL and a local volume.
The following tabs move the database to shared PostgreSQL (scenario 2) and the warehouse to Ozone (scenario 3), and show where Trino, Spark, Iceberg and Delta Lake receive the address (scenario 4).
The database (postgres.enabled, postgres.external and TDP-Settings.externalDatabase) and warehouse (metastore.type and metastore.s3).
The Thrift address of the <RELEASE_NAME>-metastore Service, on the port in metastore.port.
The database and the warehouse in the release itself
- Trino. Receives the address in hive.metastore.uri, in each catalog definition. (
tdp-trino.catalogs) - Spark. Receives the address in iceberg.catalog.uri and, for Delta tables, in deltaLake.metastoreUri. (
tdp-spark.iceberg.catalog.uri) - Iceberg and Delta Lake. Maintenance jobs receive the address in maintenance.spark.config. (
maintenance.spark.config) - Other clients. Any client supporting the metastore Thrift protocol uses the same address.
- Metastore address. thrift://<RELEASE_NAME>-metastore.<NAMESPACE>.svc.cluster.local, on the port in metastore.port. (
tdp-hive-metastore.metastore.port) - Hive Metastore. Stores databases, tables, partitions and file locations. The chart itself connects the metastore to the database and warehouse.
- Embedded PostgreSQL. The default: a PostgreSQL instance dedicated to the catalog, in the release itself. Chart default:
embedded. (tdp-hive-metastore.postgres.enabled) - Warehouse on a local volume. The default: a volume in the release itself, mounted at the directory in metastore.file.warehouseDir. Chart default:
metastore.type: file. (tdp-hive-metastore.metastore.type)
The address consumers receive
thrift://<RELEASE_NAME>-metastore.<NAMESPACE>.svc.cluster.local:9083
Check that the address responds
The Service endpoints list the metastore pod.
kubectl -n <NAMESPACE> get endpoints <RELEASE_NAME>-metastore
Success criteria
The catalog database in an external instance, such as tdp-postgresql.
In a shared environment, the catalog database is stored in external PostgreSQL, such as the tdp-postgresql chart: this is the recommended approach. You disable embedded PostgreSQL and enable the chart's database hooks, Jobs that Helm runs before installation and each upgrade: one checks that PostgreSQL responds and another creates the database and hive user with a generated password and writes the credentials to the <RELEASE_NAME>-hive-database Secret. With an external database, the chart cannot check the connection limit: adjust it in PostgreSQL itself before installing the metastore.
Embedded PostgreSQL (postgres.enabled: true) and hooks disabled (TDP-Settings.externalDatabase.enabled: false). Both cannot be enabled together: rendering fails.
The address in postgres.external, hooks enabled, recreate: false, and the Secret containing the PostgreSQL administration password in the Hive Metastore namespace.
The metastore on the shared PostgreSQL
- Trino. Receives the address in hive.metastore.uri, in each catalog definition. (
tdp-trino.catalogs) - Spark. Receives the address in iceberg.catalog.uri and, for Delta tables, in deltaLake.metastoreUri. (
tdp-spark.iceberg.catalog.uri) - Iceberg and Delta Lake. Maintenance jobs receive the address in maintenance.spark.config. (
maintenance.spark.config) - Other clients. Any client supporting the metastore Thrift protocol uses the same address.
- Metastore address. thrift://<RELEASE_NAME>-metastore.<NAMESPACE>.svc.cluster.local, on the port in metastore.port. (
tdp-hive-metastore.metastore.port) - Hive Metastore. Stores databases, tables, partitions and file locations. The chart itself connects the metastore to the database and warehouse.
- External PostgreSQL. The chart's hooks check the instance, create the database and hive user, and write the credentials Secret. The connection limit is adjusted on the instance itself. Chart default:
embedded. (tdp-hive-metastore.postgres.enabled) - Warehouse on a local volume. The default: a volume in the release itself, mounted at the directory in metastore.file.warehouseDir. Chart default:
metastore.type: file. (tdp-hive-metastore.metastore.type)
Increase the PostgreSQL connection limit
The shared PostgreSQL default cannot accommodate the metastore pools and other clients.
The metastore alone needs hundreds of connections, in addition to those used by other clients of the same instance. In tdp-postgresql, increase max_connections in the PostgreSQL values file before installing the metastore. The exact calculation, based on replicas and pool size, is in scenario 2 of Hive Metastore Configuration.
1tdp-postgresql:2primary:3 extendedConfiguration: |-4 max_connections = 500
Adds to the default PostgreSQL configuration. Ignored when primary.configuration is set: in that case, put max_connections in primary.configuration.
- extendedConfiguration (linha 3). Adds to the default PostgreSQL configuration. Ignored when primary.configuration is set: in that case, put max_connections in primary.configuration.
- max_connections (linha 4). External PostgreSQL needs at least 400 to 500 connections for the metastore alone, plus other clients such as Superset, Airflow and OpenMetadata.
Success criteria
After applying to the PostgreSQL release, SHOW max_connections; in PostgreSQL shows the new limit. How to apply and check is in scenario 3 of PostgreSQL Configuration.
Check the administration Secret
The database Jobs read the administration password in the Hive Metastore namespace.
tdp-postgresql stores the administration password in the tdp-postgresql-auth Secret, in the postgres-password key. Hive Metastore Jobs read this Secret in their own release's namespace.
kubectl -n <NAMESPACE> get secret tdp-postgresql-auth
Success criteria
Write the Hive Metastore values file
Embedded database disabled, external PostgreSQL address and hooks enabled.
1tdp-hive-metastore:2postgres:3 enabled: false4 external:5 host: "<POSTGRESQL_SERVICE>.<SHARED_NAMESPACE>.svc.cluster.local"6 port: 543278TDP-Settings:9externalDatabase:10 enabled: true11 recreate: false12 externalSecret:13 releaseName: "tdp-postgresql-auth"
Required with hooks: rendering fails if both are enabled.
- Embedded disabled (linha 3). Required with hooks: rendering fails if both are enabled.
- Host (linha 5). The PostgreSQL Service. In tdp-postgresql, it is <POSTGRESQL_RELEASE>-tdp-postgresql, or just <POSTGRESQL_RELEASE> when the release name already contains tdp-postgresql.
- Hooks (linha 10). Check PostgreSQL, create the database and hive user with a generated password, and write the <RELEASE_NAME>-hive-database Secret.
- recreate (linha 11). With true, the database and user are deleted and recreated on each deployment. Keep false to preserve data during upgrades.
- Administration Secret (linha 13). Despite the key name, the value is a Secret name, with the administration password in its postgres-password key.
Without hooks, the chart creates neither the database nor the Secret, and the metastore pod does not start: in that case, create both before installing, as in Security - Hive Metastore.
Apply to the release
Hooks run before installation.
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-hive-metastore \
--version 3.0.3 -n <NAMESPACE> --create-namespace \
-f <VALUES_FILE>
Success criteria
kubectl -n <NAMESPACE> get secret <RELEASE_NAME>-hive-database
kubectl -n <NAMESPACE> get pods
The <RELEASE_NAME>-hive-database Secret exists, with the generated password, and the metastore pod is Running.
If Helm stops at the hooks
The <RELEASE_NAME>-check-db-ready Job is deleted on completion: follow its log while Helm waits, in a second terminal:
kubectl -n <NAMESPACE> logs -f job/<RELEASE_NAME>-check-db-ready
A failed <RELEASE_NAME>-create-db remains in the cluster:
kubectl -n <NAMESPACE> logs job/<RELEASE_NAME>-create-db
Then look up the message in When something goes wrong.
Table data in an S3 Gateway bucket.
This tab moves the warehouse, where table data is stored, from the metastore's local volume to a bucket of the S3 Gateway in tdp-ozone, the S3-compatible interface of Ozone. The lakehouse charts (tdp-spark, tdp-iceberg, tdp-deltalake and tdp-trino) expect the warehouse in S3. With metastore.type: s3, the local warehouse volume is no longer created. The bucket and keys Secret must exist before installation.
metastore.type: file: the warehouse in the <RELEASE_NAME>-hive-warehouse-pvc volume.
metastore.type: s3, the warehouse at metastore.s3.warehouseDir in the metastore.s3.bucket bucket, with keys read from a Secret.
The warehouse in an Ozone bucket
- Trino. Receives the address in hive.metastore.uri, in each catalog definition. (
tdp-trino.catalogs) - Spark. Receives the address in iceberg.catalog.uri and, for Delta tables, in deltaLake.metastoreUri. (
tdp-spark.iceberg.catalog.uri) - Iceberg and Delta Lake. Maintenance jobs receive the address in maintenance.spark.config. (
maintenance.spark.config) - Other clients. Any client supporting the metastore Thrift protocol uses the same address.
- Metastore address. thrift://<RELEASE_NAME>-metastore.<NAMESPACE>.svc.cluster.local, on the port in metastore.port. (
tdp-hive-metastore.metastore.port) - Hive Metastore. Stores databases, tables, partitions and file locations. The chart itself connects the metastore to the database and warehouse.
- Embedded PostgreSQL. The default: a PostgreSQL instance dedicated to the catalog, in the release itself. Chart default:
embedded. (tdp-hive-metastore.postgres.enabled) - Warehouse in S3. Table data is stored in an Ozone S3 Gateway bucket, created before installation. Chart default:
metastore.type: file. (tdp-hive-metastore.metastore.type)
Create the bucket
The Hive Metastore chart does not create the bucket.
Create the warehouse bucket in the Ozone S3 Gateway, as in Integrations - Ozone:
aws s3 mb s3://warehouse --endpoint-url <S3_ENDPOINT>
Prepare the keys Secret
The S3 keys reach the pod through a Secret.
With Ozone security enabled, use the ozone-s3-credentials Secret, created by the Ozone chart. Without it, create your own. With Ozone security disabled, the S3 Gateway accepts any nonempty key pair:
kubectl -n <NAMESPACE> create secret generic s3-credentials \
--from-literal=access-key='<S3_ACCESS_KEY>' --from-literal=secret-key='<S3_SECRET_KEY>'
Other ways to provide keys are in Security - Hive Metastore.
Write the values file
The warehouse points to the Ozone bucket.
1tdp-hive-metastore:2metastore:3 type: s34 s3:5 warehouseDir: s3a://warehouse/hive6 bucket: warehouse7 endpoint: <S3_ENDPOINT>8 existingSecret: s3-credentials9 existingSecretAccessKeyKey: access-key10 existingSecretSecretKeyKey: secret-key
Replaces the local volume. The warehouse PVC is no longer created.
- Warehouse in S3 (linha 3). Replaces the local volume. The warehouse PVC is no longer created.
- Warehouse path (linha 5). The s3a:// path where table data is stored.
- Bucket (linha 6). Created in the previous step.
- Endpoint (linha 7). The Ozone S3 Gateway Service, in the Ozone namespace and on the S3 Gateway port. The name is the Ozone release followed by -s3g-rest: with the default release, tdp-ozone-s3g-rest.
- Keys Secret (linha 8). The Secret created in the previous step. With Ozone security enabled, ozone-s3-credentials, with the aws_access_key_id and aws_secret_access_key keys.
Apply to the release
The same command installs and upgrades.
helm upgrade --install <RELEASE_NAME> oci://registry.tecnisys.com.br/tdp/charts/tdp-hive-metastore \
--version 3.0.3 -n <NAMESPACE> --create-namespace \
-f <VALUES_FILE>
Success criteria
kubectl -n <NAMESPACE> get pvc
kubectl -n <NAMESPACE> get pods
There is no <RELEASE_NAME>-hive-warehouse-pvc PVC and the metastore pod is Running.
Where each consumer receives the metastore address.
The metastore is running, and you want Trino, Spark, and Iceberg and Delta Lake maintenance jobs to register and find tables in it. Nothing changes in the Hive Metastore chart: each consumer receives the Thrift address in its own values file. Spark, Iceberg and Delta Lake chart defaults point to the tdp-hive-metastore release in the tdp namespace. With another release name or namespace, the address changes.
The consumers and the metastore Service
- Trino. Receives the address in hive.metastore.uri, in each catalog definition. (
tdp-trino.catalogs) - Spark. Receives the address in iceberg.catalog.uri and, for Delta tables, in deltaLake.metastoreUri. (
tdp-spark.iceberg.catalog.uri) - Iceberg and Delta Lake. Maintenance jobs receive the address in maintenance.spark.config. (
maintenance.spark.config) - Other clients. Any client supporting the metastore Thrift protocol uses the same address.
- Metastore address. thrift://<RELEASE_NAME>-metastore.<NAMESPACE>.svc.cluster.local, on the port in metastore.port. (
tdp-hive-metastore.metastore.port) - Hive Metastore. Stores databases, tables, partitions and file locations. The chart itself connects the metastore to the database and warehouse.
- Embedded PostgreSQL. The default: a PostgreSQL instance dedicated to the catalog, in the release itself. Chart default:
embedded. (tdp-hive-metastore.postgres.enabled) - Warehouse in S3. Table data is stored in an Ozone S3 Gateway bucket, created before installation. Chart default:
metastore.type: file. (tdp-hive-metastore.metastore.type)
Where each consumer receives the address
| Consumer | Where the address is set | Page |
|---|---|---|
| Trino | hive.metastore.uri, in the hive and iceberg catalog definitions (with iceberg.catalog.type=hive_metastore) | Integrations - Trino |
| Spark | tdp-spark.iceberg.catalog.uri. For Delta tables, tdp-spark.deltaLake.metastoreUri | Integrations - Spark |
| Iceberg | spark.sql.catalog.iceberg.uri, in maintenance.spark.config | Integrations - Iceberg |
| Delta Lake | spark.hadoop.hive.metastore.uris, in maintenance.spark.config | Integrations - Delta Lake |
In all of them, the value is the address from scenario 1:
thrift://<RELEASE_NAME>-metastore.<NAMESPACE>.svc.cluster.local:9083
When something goes wrong
Troubleshooting
Paste the error message or choose a symptom. The answer includes the cause, what to do and the command.
- Rendering fails: postgres.enabled=true cannot be combined with TDP-Settings.externalDatabase.enabled=true. Cause: Embedded PostgreSQL and external database hooks enabled at the same time. What to do: With an external database, set postgres.enabled: false (scenario 2).
- PostgreSQL did not become ready in time. Cause: The check-db-ready Job could not reach PostgreSQL at postgres.external.host and postgres.external.port. What to do: Check the PostgreSQL Service name and namespace in the address (scenario 2).
- create-db Job failed. Cause: The administration Secret does not exist in the Hive Metastore namespace, lacks the postgres-password key, or the password does not match. What to do: Fix the cause and run the same helm upgrade --install: it replaces the failed Job.
- Metastore pod does not start with an external database. Cause: External database without hooks: the chart creates neither the database nor the <RELEASE_NAME>-hive-database Secret. What to do: Enable hooks, or create the database and Secret before installing (Security - Hive Metastore).
- Connections exhausted in shared PostgreSQL. Cause: PostgreSQL max_connections cannot accommodate the metastore pools and other clients of the same instance. What to do: Increase max_connections in PostgreSQL before installing the metastore (scenario 2), using the formula on the configuration page.
- S3 access denied. Cause: Missing bucket, wrong endpoint or wrong S3 keys. With Ozone security disabled, the S3 Gateway accepts any nonempty key pair. What to do: Check the bucket, endpoint and keys Secret (scenario 3).
- Empty Service endpoints. Cause: The metastore pod is not ready, and consumers cannot reach the Thrift address. What to do: The endpoints of <RELEASE_NAME>-metastore must list the metastore pod. Start with the logs.