World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
title: "Iceberg REST Catalog Service" slug: "/iceberg-rest-service" keywords: - Iceberg REST catalog license: "This software is licensed under the Apache License version 2."
Overview
The Apache Gravitino Iceberg REST server implements the Apache Iceberg REST API specification.
Access the Iceberg REST endpoint at http://$ip:$port/iceberg/.
The Iceberg REST server and the main Gravitino server expose different interfaces and manage different table types:
| Item | Gravitino Iceberg REST server | Gravitino server |
|---|---|---|
| Interfaces | Iceberg REST API spec | Gravitino unified interfaces |
| Managed table type | Iceberg table only | JDBC, Hive, Iceberg, Hudi, Paimon, etc |
Tables created by other engines that publish Iceberg metadata through this service, for example Paimon
tables with metadata.iceberg.storage set to rest-catalog, are served as the producing engine published
them, so that engine's visibility rules still apply. For Paimon primary-key tables, see
Iceberg compatibility.
Capabilities
The Iceberg REST server provides:
- Apache Iceberg 1.11 REST API support for most namespace, table, and view operations.
- Hierarchical namespaces.
- Hive, JDBC, and REST catalog backends.
- Credential vending for S3, GCS, OSS, and ADLS.
- S3, HDFS, OSS, GCS, ADLS, and custom storage support.
- Event listeners and audit logging.
- OAuth2 and HTTPS.
- Access control in auxiliary mode.
- Pluggable metrics storage.
- Table metadata and scan plan caches.
The following Iceberg REST API features are not implemented:
- Multi-table transactions.
- View registration.
Deployment
Deployment Modes
Choose one of these deployment modes:
| Mode | Package | Classpath | Access control |
|---|---|---|---|
| Standalone server | Gravitino Iceberg REST server package | libs |
No |
| Standalone server | Gravitino server package | iceberg-rest-server/libs |
No |
| Auxiliary service | Gravitino server package | iceberg-rest-server/libs |
Yes |
Package Build
For instructions on building and installing the Gravitino server package, see Build Gravitino and Install Gravitino.
Build the standalone Iceberg REST server package:
./gradlew compileIcebergRESTServer -x test
Create the compressed package in the distribution directory:
./gradlew assembleIcebergRESTServer -x test
Package Layout
The standalone Iceberg REST server package has the following layout:
|── ...
└── distribution/gravitino-iceberg-rest-server
|── bin/
| └── gravitino-iceberg-rest-server.sh # Gravitino Iceberg REST server Launching scripts.
|── conf/ # All configurations for Gravitino Iceberg REST server.
| ├── gravitino-iceberg-rest-server.conf # Gravitino Iceberg REST server configuration.
| ├── gravitino-env.sh # Environment variables, etc., JAVA_HOME, GRAVITINO_HOME, and more.
| └── log4j2.properties # log4j configuration for the Gravitino Iceberg REST server.
| └── hdfs-site.xml & core-site.xml # HDFS configuration files.
|── libs/ # Gravitino Iceberg REST server dependencies libraries.
|── logs/ # Gravitino Iceberg REST server logs. Automatically created after the server starts.
|── scripts/ # SQL scripts for database initialization.
Configuration
Standalone and auxiliary deployments use different configuration files:
- Standalone server:
gravitino-iceberg-rest-server.conf. - Auxiliary service:
gravitino.conf.
Both files use the same Iceberg REST configuration items.
The gravitino.auxService.iceberg-rest. prefix is deprecated.
If both gravitino.auxService.iceberg-rest.key and gravitino.iceberg-rest.key are present, gravitino.iceberg-rest.key takes precedence.
The following sections use the gravitino.iceberg-rest. prefix.
The server-level gravitino.fetchFile.blockUnsafeRemoteUri configuration controls whether remote files such as Kerberos keytabs may resolve to unsafe addresses. It defaults to true. Configure it in gravitino-iceberg-rest-server.conf for standalone mode or gravitino.conf for auxiliary mode.
Service Configuration
Auxiliary Service
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.auxService.names |
The auxiliary service name of the Gravitino Iceberg REST catalog service. Use iceberg-rest. |
(none) | Yes |
gravitino.iceberg-rest.classpath |
The classpath of the Gravitino Iceberg REST catalog service. Use iceberg-rest-server/libs, iceberg-rest-server/conf for the regular Iceberg dependencies or iceberg-rest-server-experiment/libs, iceberg-rest-server-experiment/conf for the experimental dependencies. It supports both absolute and relative paths. |
(none) | Yes |
These settings apply only to gravitino.conf.
Do not add them to the standalone server configuration.
The auxiliary service name and all Iceberg REST configuration keys remain the same when using the experimental dependencies. Only select the experimental classpath:
gravitino.auxService.names = iceberg-rest
gravitino.iceberg-rest.classpath = iceberg-rest-server-experiment/libs, iceberg-rest-server-experiment/conf
The selected directory is prepended to the Iceberg REST auxiliary service classpath. Only one of
the regular and experimental directories can be active at a time. The selection takes effect when
Iceberg classes are absent from the Gravitino server's base classpath; the binary distribution is
packaged this way. The service logs the loaded Iceberg version and code source during startup so
the effective runtime can be verified. The experimental directory uses the Datastrato Iceberg
distribution published under the com.datastrato Maven group. Its version is pinned by
datastrato-iceberg in gradle/libs.versions.toml, independently of the regular Iceberg version.
HTTP Server
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.host |
The host of the Gravitino Iceberg REST catalog service. | 0.0.0.0 |
No |
gravitino.iceberg-rest.httpPort |
The port of the Gravitino Iceberg REST catalog service. | 9001 |
No |
gravitino.iceberg-rest.minThreads |
The minimum number of threads in the thread pool used by the Jetty web server. minThreads is 8 if the value is less than 8. |
Math.max(Math.min(Runtime.getRuntime().availableProcessors() * 2, 100), 8) |
No |
gravitino.iceberg-rest.maxThreads |
The maximum number of threads in the thread pool used by the Jetty web server. maxThreads is 8 if the value is less than 8, and maxThreads must be greater than or equal to minThreads. |
Math.max(Runtime.getRuntime().availableProcessors() * 4, 400) |
No |
gravitino.iceberg-rest.threadPoolWorkQueueSize |
The size of the queue in the thread pool used by Gravitino Iceberg REST catalog service. | 100 |
No |
gravitino.iceberg-rest.stopTimeout |
The amount of time in ms for the Gravitino Iceberg REST catalog service to stop gracefully. For more information, see org.eclipse.jetty.server.Server#setStopTimeout. |
30000 |
No |
gravitino.iceberg-rest.idleTimeout |
The timeout in ms of idle connections. | 30000 |
No |
gravitino.iceberg-rest.requestHeaderSize |
The maximum size of an HTTP request. | 131072 |
No |
gravitino.iceberg-rest.responseHeaderSize |
The maximum size of an HTTP response. | 131072 |
No |
gravitino.iceberg-rest.includeErrorStackTrace |
Whether error responses include server-side stack traces. Set this to false in new deployments because responses can expose internal implementation details. |
true |
No |
gravitino.iceberg-rest.metrics.enabled |
Whether standalone mode serves metrics endpoints. Ignored in auxiliary mode; use the Gravitino server endpoint there. Enable only on a trusted network. | false |
No |
gravitino.iceberg-rest.customFilters |
Comma-separated list of filter class names to apply to the APIs. | (none) | No |
gravitino.iceberg-rest.trustedProxies |
Comma-separated list of IP addresses or CIDR blocks of reverse proxies whose X-Forwarded-For header is trusted when recording the client address in audit events. |
(none) | No |
gravitino.iceberg-rest.advertised-uri |
The public endpoint reported to clients that discover the service through the Gravitino server. Must be an absolute http/https URI with a host and no query or fragment. |
(none) | No |
The filter in customFilters should be a standard javax servlet filter.
Specify filter parameters by setting configuration entries in the style gravitino.iceberg-rest.<class name of filter>.param.<param name>=<value>.
trustedProxies works as described for
gravitino.server.webserver.trustedProxies. When it is
empty, X-Forwarded-For is ignored and the TCP peer address is recorded. The service listens on its
own port even in auxiliary mode, so set this key separately from the Gravitino server's.
Set gravitino.iceberg-rest.advertised-uri when clients such as the Trino connector reach the service through a reverse proxy whose scheme, host, port or path differs from the listener's, for example https://iceberg.example.com/iceberg/.
An explicit port must be in the range 1-65535; an invalid value makes discovery requests fail instead of advertising an unreachable endpoint.
It only affects the advertised endpoint, not the listener; when unset, the endpoint is derived from host, httpPort/httpsPort and enableHttps.
This setting applies only to the auxiliary service.
Asynchronous Table Purge
By default, dropping a table with purgeRequested=true is synchronous: the catalog entry and the table files are removed before the DELETE returns.
When the Iceberg REST service runs inside Gravitino (as an auxiliary service), a client can instead request asynchronous purge by adding the header X-Gravitino-Async-Purge: true to DELETE ...?purgeRequested=true. The drop then returns 204 No Content once the table is removed from the catalog, and the files are deleted in the background. The table is gone from LIST immediately, but recreating it (createTable / registerTable with the same name) returns 409 Conflict until the file cleanup finishes.
The header name is case-insensitive (per the HTTP standard), but its value must be exactly true. Any other value, or no header, uses the synchronous default, so standard Iceberg clients are unaffected. Asynchronous purge is only available in auxiliary mode; in standalone mode the header is ignored.
The settings below tune the background workers and are optional.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.async-cleanup.worker-threads |
Worker pool size per server. Each worker claims and runs cleanup jobs from the shared backend table. | 2 |
No |
gravitino.iceberg-rest.async-cleanup.delete-threads |
Server-wide file-delete pool size shared by cleanup jobs. | 4 |
No |
gravitino.iceberg-rest.async-cleanup.delete-batch-size |
Number of files per bulk-delete batch. | 1000 |
No |
gravitino.iceberg-rest.async-cleanup.poll-interval-secs |
Worker polling interval in seconds. This also controls retry pacing for pending jobs. | 5 |
No |
gravitino.iceberg-rest.async-cleanup.heartbeat-timeout-secs |
Age in seconds after which a running job with no fresh heartbeat can be reclaimed by another worker. | 300 |
No |
gravitino.iceberg-rest.async-cleanup.max-attempts |
Number of failed attempts before a cleanup job is marked FAILED. |
5 |
No |
gravitino.iceberg-rest.async-cleanup.retention-hours |
Retention time for terminal SUCCEEDED or FAILED cleanup rows before pruning. |
720 |
No |
Idempotency Key
The Iceberg REST spec defines an optional Idempotency-Key header on mutation endpoints so that a client can safely retry a request whose response it never saw. When enabled and the header is present, the server reserves the key, executes the mutation, and stores the response for replay while the record remains available.
Support is disabled by default. Once enabled, the reuse window is advertised as idempotency-key-lifetime in GET /v1/config; per the spec, clients must assume idempotency is unsupported when that field is absent.
The header applies to the create, update, drop, register, and rename endpoints for tables, namespaces, and views. Its value must be a UUIDv7 in string form (RFC 9562); anything else returns 400 Bad Request. Keys must be globally unique: reusing one with a different HTTP method, path, or query returns 409 Conflict, and so does a retry that arrives while the first request is still running (with a Retry-After header). Successful and deterministic terminal 4xx responses are stored and replayed, while 5xx, 401, 403, and 419 responses release the key so the client can retry with it.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.idempotency-enabled |
Whether to honor the Idempotency-Key header. When false, the header is ignored and no lifetime is advertised. |
false |
No |
gravitino.iceberg-rest.idempotency-key-lifetime |
The client reuse window for a key, an ISO-8601 duration such as PT30M. Advertised to clients as idempotency-key-lifetime. |
PT30M |
No |
gravitino.iceberg-rest.idempotency-store-type |
The store holding idempotency records: in-memory, jdbc in auxiliary mode, or the fully-qualified class name of an IdempotencyStore implementation. |
in-memory |
No |
gravitino.iceberg-rest.idempotency-max-entries |
The maximum number of records retained by the in-memory store. Records beyond it are evicted before their reuse window elapses. | 10000 |
No |
Limitations:
- Request identity covers the HTTP method, path, and query parameters. It does not compare request bodies or behavior-changing headers such as
X-Iceberg-Access-Delegation. Reusing a key on the same URL with a changed body or header replays the first response; it does not apply the changed request. Always generate a new key for a different logical operation. Request validation runs before replay, so a retry with an invalid body can return400 Bad Requesteven if the key already has a stored success. - Replay preserves the status and JSON body but omits response headers such as
ETag. Load the table again if the client needs its current ETag. - The catalog mutation and response persistence are not one transaction. A crash, serialization failure, lost reservation, or post-commit failure can leave a successful mutation without a replayable response. When saving a terminal response fails, the manager keeps any existing reservation until expiry and returns the original mutation response. Retries receive
409withRetry-Afterwhile an unfinalized reservation remains. Expiry, eviction, or a released reservation treats the key as never seen and can permit re-execution. - The in-memory store reclaims expired entries through Caffeine. The JDBC store schedules bounded cleanup as described below. Custom stores must enforce expiry on reads/reservations and arrange their own cleanup.
:::caution
Enabling idempotency-enabled=true with the default idempotency-store-type=in-memory on more than one replica does not provide cluster-wide deduplication: retries can execute a mutation twice. The in-memory store is node-local and not durable. A retry routed to another replica, or to a replica that restarted, finds no record and re-executes the mutation, and its size bound can evict a record before its reuse window elapses, including an in-flight reservation. A retry can then run concurrently with the original mutation. Use it for single-node deployments, development, and testing.
:::
JDBC Idempotency Storage
The jdbc idempotency store persists request reservations and response bodies in Gravitino's
relational entity store. Replicas connected to the same database share records, and finalized
responses survive Iceberg REST service restarts. Set gravitino.iceberg-rest.idempotency-enabled=true
and gravitino.iceberg-rest.idempotency-store-type=jdbc to enable durable request replay on the
mutation endpoints described above.
Use this backend in auxiliary mode, with an initialized relational entity store. Standalone Iceberg REST servers cannot use it. It reuses Gravitino's connection pool and supports H2, MySQL, and PostgreSQL. For multiple replicas, use the same shared MySQL or PostgreSQL database; separate local H2 databases do not provide cross-replica deduplication.
Create one store instance per Iceberg REST service instance and share it across requests. Each store starts its own cleanup scheduler; creating stores per request adds redundant purge work and database lock contention. Close the store when stopping the service to shut down its scheduler.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.idempotency-store-type |
Select jdbc for durable storage, in-memory for node-local storage, or a custom implementation class. |
in-memory |
No |
gravitino.iceberg-rest.idempotency-cleanup-interval |
Time between bounded JDBC cleanup passes, as an ISO-8601 duration of at least one millisecond. | PT5M |
No |
Initialize a new database with the 2.0.0 schema or apply the 1.3.0-to-2.0.0 upgrade before selecting
jdbc. An existing development 2.0.0 database created before this table was added must also apply
the iceberg_idempotency_meta table and the expiry index from the matching database's schema
script. Store initialization fails if iceberg_idempotency_meta is missing. The table is additive
and does not modify catalog metadata.
When switching from an earlier development build that used iceberg_idempotency_key_meta or
query_digest, drain in-flight mutations and let existing reuse windows expire before changing
the schema. Update all replicas to the current request binding format together. On MySQL, the
current request_uri column uses MEDIUMTEXT to accommodate long request targets.
The store interface and record type are in org.apache.gravitino.iceberg.service.idempotency in
the Iceberg REST server JAR. Rebuild custom stores from earlier development versions against this
package and update reserve to return whether the key was acquired. If an earlier configuration
names the built-in in-memory store by its old class name, use the in-memory alias.
Reservations are atomic across replicas. After release or purge, the same key is treated as never
seen and reserved again, matching common HTTP Idempotency-Key stores. Clients SHOULD NOT reuse a
key after the advertised lifetime. The table stores the HTTP method separately from request_uri,
which contains the encoded path followed by the sorted, encoded query string when present.
Expiry is enforced on reads, finalization, and reservation attempts; reusing an expired key does not depend on the cleanup schedule. Each cleanup pass deletes at most 100 batches of 1,000 expired rows, and transient failures are retried on the next pass.
:::warning Clock synchronization is required for safe replay
All replicas sharing the JDBC store must maintain synchronized system clocks, for example through
NTP or chrony. Monitor clock offset and synchronization health. Stop the Iceberg REST service on an
unsynchronized replica until its clock is corrected so neither requests nor its cleanup task can
expire records early. A fast clock can reclaim or purge a key while another replica still considers
it live, allowing the mutation to execute again within that
replica's reuse window. This affects replay safety, not just cleanup timing. The store does not add
a clock-skew grace period; changing the cleanup interval does not prevent early reclaim by
reserve().
:::
:::warning The reuse window must outlast the mutation
There is no heartbeat or in-flight lease renewal. Configure idempotency-key-lifetime to exceed
the maximum elapsed time from starting reservation through completing the mutation and persisting
its response, plus maximum clock skew and a safety margin. Include database lock waits, backend
retries, serialization time, and JVM pauses in that bound; typical or percentile latency is not
sufficient. A client or HTTP timeout does not necessarily stop an already-running catalog mutation.
Once the deadline passes, another replica may reclaim the key while the original mutation is still running. If a duration or clock-skew bound cannot be enforced, do not rely on this mechanism for at-most-once execution. Reconcile catalog state before retrying outside the reuse window, and do not use a new key to bypass an existing reservation for the same logical operation. :::
If reservation or replay lookup fails, the server returns 503 Service Unavailable with
Retry-After and does not execute the mutation in that attempt. The reservation may still have
committed before a connection failure, so it is retained and a retry with the same key may receive
409 until the reservation expires. Retry with the same key within the advertised window; after
the window, inspect catalog state before deciding whether to execute the operation again. A generic
mutation 5xx can still have an uncertain catalog outcome and must not be treated as proof that
nothing changed.
The 100,000-row cleanup cap applies to each pass, and remaining expired rows wait for later passes. Monitor expired-row backlog and database storage growth; shorten the cleanup interval if cleanup falls behind, while checking database load and lock waits. Cleanup lag does not extend record validity because expiry is checked on access.
Durable storage does not make catalog mutations and response persistence one transaction. Failed response persistence leaves any reservation in place until expiry, but cannot recover a missing response after a crash. Idempotency records do not fence catalog side effects. A request running beyond its reuse window can overlap a retry.
Catalog Backend Configuration
:::info The Gravitino Iceberg REST catalog service uses the memory catalog backend by default. Specify a Hive, JDBC or REST catalog backend for production environment. :::
Hive Backend Configuration
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.catalog-backend |
The Catalog backend of the Gravitino Iceberg REST catalog service. Use the value hive for the Hive catalog backend. |
memory |
Yes |
gravitino.iceberg-rest.uri |
The Hive metadata address, such as thrift://127.0.0.1:9083. |
(none) | Yes |
gravitino.iceberg-rest.warehouse |
The warehouse directory of the Hive catalog, such as /user/hive/warehouse-hive/. |
(none) | Yes |
gravitino.iceberg-rest.catalog-backend-name |
The catalog backend name passed to underlying Iceberg catalog backend. Catalog name in JDBC backend is used to isolate namespace and tables. | hive for Hive backend, jdbc for JDBC backend, memory for memory backend |
No |
For Kerberos-secured Hive Metastore and HDFS, see Backend Authentication.
JDBC Backend Configuration
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.catalog-backend |
The Catalog backend of the Gravitino Iceberg REST catalog service. Use the value jdbc for the JDBC catalog backend. |
memory |
Yes |
gravitino.iceberg-rest.uri |
The JDBC connection address, such as jdbc:postgresql://127.0.0.1:5432 for Postgres, or jdbc:mysql://127.0.0.1:3306/ for mysql. |
(none) | Yes |
gravitino.iceberg-rest.warehouse |
The warehouse directory of JDBC catalog. Set the HDFS prefix if using HDFS, such as hdfs://127.0.0.1:9000/user/hive/warehouse-jdbc |
(none) | Yes |
gravitino.iceberg-rest.catalog-backend-name |
The catalog name passed to underlying Iceberg catalog backend. Catalog name in JDBC backend is used to isolate namespace and tables. | jdbc for JDBC backend |
No |
gravitino.iceberg-rest.jdbc-user |
The username of the JDBC connection. | (none) | No |
gravitino.iceberg-rest.jdbc-password |
The password of the JDBC connection. | (none) | No |
gravitino.iceberg-rest.jdbc-initialize |
Whether to initialize the meta tables when creating the JDBC catalog. | true |
No |
gravitino.iceberg-rest.jdbc-driver |
com.mysql.jdbc.Driver or com.mysql.cj.jdbc.Driver for MySQL, org.postgresql.Driver for PostgreSQL. |
(none) | Yes |
gravitino.iceberg-rest.jdbc-schema-version |
The schema version of the JDBC catalog. Defaults to V1 to enable view support. Set to V0 only if you need to opt out of view support. Once the underlying database is migrated to V1, this property is no longer required on subsequent restarts. |
V1 |
No |
gravitino.iceberg-rest.jdbc.strict-mode |
Whether the JDBC catalog runs in strict mode. Defaults to true so that creating a table or view in a namespace that does not exist fails with NoSuchNamespace (HTTP 404), matching the Iceberg REST specification. Set to false to restore the legacy behavior of implicitly creating the namespace. |
true |
No |
If you have a JDBC Iceberg catalog prior, you must set catalog-backend-name to keep consistent with your Jdbc Iceberg catalog name to operate the prior namespace and tables.
Use gravitino.iceberg-rest.jdbc-user and gravitino.iceberg-rest.jdbc-password to authenticate the JDBC catalog metadata store. When the warehouse is on Kerberos-secured HDFS, set gravitino.iceberg-rest.authentication.type to kerberos and configure the Kerberos properties in Backend Authentication to access warehouse paths.
:::caution
Download the corresponding JDBC driver to the iceberg-rest-server/libs directory.
If you are using multiple JDBC catalog backends, setting jdbc-initialize to true may not take effect for RDBMS like Mysql, you should create Iceberg meta tables explicitly.
You can initialize the metadata tables using the scripts provided in the ${GRAVITINO_HOME}/scripts/ directory:
- MySQL:
${GRAVITINO_HOME}/scripts/mysql/iceberg-jdbc-schema-mysql.sql - PostgreSQL:
${GRAVITINO_HOME}/scripts/postgresql/iceberg-jdbc-schema-postgresql.sql - H2:
${GRAVITINO_HOME}/scripts/h2/iceberg-jdbc-schema-h2.sql
For example:
# MySQL
mysql -h <host> -u <username> -p <database> < ${GRAVITINO_HOME}/scripts/mysql/iceberg-jdbc-schema-mysql.sql
# PostgreSQL
psql -h <host> -U <username> -d <database> -f ${GRAVITINO_HOME}/scripts/postgresql/iceberg-jdbc-schema-postgresql.sql
When using H2, the JDBC connection URL must include ;DATABASE_TO_LOWER=TRUE (e.g., jdbc:h2:<path>;DATABASE_TO_LOWER=TRUE). By default, H2 converts unquoted identifiers to uppercase, whereas Iceberg looks up metadata in lowercase. Without DATABASE_TO_LOWER=TRUE, Iceberg fails to detect existing columns such as iceberg_type and attempts an ALTER TABLE, which fails if the database user only has DML permissions.
:::
REST Backend Configuration
Use the REST backend to proxy another Iceberg REST catalog server (IRC2). The Gravitino Iceberg REST service acts as IRC1 and forwards catalog operations to IRC2.
By default, when the backend catalog is a REST catalog, IRC1 skips authorization and behaves as a proxy. IRC2 handles authorization. If you want IRC1 to keep authorization checks, set gravitino.iceberg-rest.disable-rest-authz=false.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.catalog-backend |
The Catalog backend of the Gravitino Iceberg REST catalog service. Use the value rest for the REST catalog backend. |
memory |
Yes |
gravitino.iceberg-rest.uri |
The Iceberg REST catalog URI (IRC2), such as http://127.0.0.1:9001/iceberg. |
(none) | Yes |
gravitino.iceberg-rest.warehouse |
The catalog name in the Iceberg REST spec. Set to a specific catalog name, or leave empty to use the default catalog on IRC2. | (none) | No |
gravitino.iceberg-rest.rest-client-connection-timeout-ms |
The HTTP connection timeout in milliseconds for IRC1 requests to the REST catalog backend. | 10000 |
No |
gravitino.iceberg-rest.rest-client-socket-timeout-ms |
The HTTP socket timeout in milliseconds for IRC1 requests to the REST catalog backend. | 60000 |
No |
gravitino.iceberg-rest.data-access |
Data access mode exposed to Iceberg REST clients via /v1/config. Supported values: vended-credentials, remote-signing. |
(none) | No |
gravitino.iceberg-rest.disable-rest-authz |
Whether IRC1 disables authorization when the target backend catalog is a REST catalog. Set to false if you want IRC1 to enforce authorization before proxying. |
true |
No |
IRC1 configuration example if IRC2 using HDFS storage:
gravitino.iceberg-rest.catalog-backend = rest
gravitino.iceberg-rest.uri = http://127.0.0.1:9001/iceberg
IRC1 configuration example if IRC2 using S3 storage:
gravitino.iceberg-rest.catalog-backend = rest
gravitino.iceberg-rest.uri = http://127.0.0.1:9001/iceberg
gravitino.iceberg-rest.s3-access-key-id = xx
gravitino.iceberg-rest.s3-secret-access-key = xx
gravitino.iceberg-rest.s3-region = xx
gravitino.iceberg-rest.credential-providers = s3-secret-key
gravitino.iceberg-rest.header.X-Iceberg-Access-Delegation = vended-credentials
IRC1 must also configure S3 configurations if the client side requests credential vending.
:::caution
If IRC2 does not enforce authorization, keeping gravitino.iceberg-rest.disable-rest-authz=true can leave operations unprotected. Set it to false to enforce authorization in IRC1.
:::
Service account connection
By default IRC1 forwards each user's access token to IRC2, so IRC2 must trust the same identity provider and authorize every user itself. To federate a catalog that cannot do that, such as a managed catalog that accepts only its own API token, connect IRC1 to IRC2 as a service account. IRC1 then presents one configured credential on every request to IRC2 and authorizes each user against Gravitino's own grants before anything is proxied. A catalog connected as a service account always enforces authorization in IRC1, whatever disable-rest-authz is set to, and IRC1 refuses to serve it when authorization is disabled. Because IRC2 vends storage credentials for the service account rather than for the calling user, such a catalog also always issues storage credentials through Gravitino, as described below.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.rest-backend-auth-type |
How IRC1 authenticates to IRC2. user-token forwards the calling user's access token. service-account connects with the credential below. |
user-token |
No |
gravitino.iceberg-rest.rest-backend-token |
Static bearer token the service account presents to IRC2. | (none) | One of token or credential with service-account |
gravitino.iceberg-rest.rest-backend-credential |
OAuth2 client credential (client_id:client_secret) the service account exchanges for a token. |
(none) | One of token or credential with service-account |
gravitino.iceberg-rest.rest-backend-oauth2-server-uri |
OAuth2 token endpoint for the client credential. Defaults to IRC2's own token endpoint. | (none) | No |
gravitino.iceberg-rest.rest-backend-scope |
OAuth2 scope requested with the client credential. | (none) | No |
Gravitino-issued storage credentials
By default IRC1 passes through the storage credentials IRC2 vends. Some catalogs vend broad, long-lived credentials, for example the catalog token's own storage keys scoped to the whole bucket. Set rest-backend-storage-credential-source to local and IRC1 stops asking IRC2 for credentials. It issues them through its own credential-providers instead, scoped to the table location, read-only unless the caller holds write privileges on the table, exactly as for a local catalog. Credentials IRC2 returns unasked are dropped. Here local means credentials issued by IRC1; remote means credentials issued by IRC2. This setting controls storage credentials, independently of the credentials IRC1 uses to authenticate to IRC2.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.rest-backend-storage-credential-source |
Who issues storage credentials for tables of the federated catalog. remote passes through IRC2's credentials. local uses IRC1's credential-providers. A service-account catalog always uses local, regardless of this setting. |
remote |
No |
IRC1 configuration example federating a catalog that accepts only a static API token, with Gravitino issuing the storage credentials:
gravitino.iceberg-rest.catalog-backend = rest
gravitino.iceberg-rest.uri = https://catalog.example.com/v1
gravitino.iceberg-rest.warehouse = example_warehouse
gravitino.iceberg-rest.rest-backend-auth-type = service-account
gravitino.iceberg-rest.rest-backend-token = xx
gravitino.iceberg-rest.rest-backend-storage-credential-source = local
gravitino.iceberg-rest.credential-providers = s3-token
gravitino.iceberg-rest.s3-access-key-id = xx
gravitino.iceberg-rest.s3-secret-access-key = xx
gravitino.iceberg-rest.s3-region = xx
gravitino.iceberg-rest.s3-role-arn = xx
data-access is returned in /v1/config defaults for REST clients:
vended-credentials: clients should request credential vending (X-Iceberg-Access-Delegation: vended-credentials).remote-signing: Gravitino doesn't support this mode yet.
Custom Backend Configuration
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.catalog-backend |
The Catalog backend of the Gravitino Iceberg REST catalog service. Use the value custom for the custom catalog backend. |
memory |
Yes |
gravitino.iceberg-rest.catalog-backend-impl |
The fully-qualified class name of a custom catalog implementation, only worked if catalog-backend is custom. |
(none) | No |
If you want to use a custom Iceberg Catalog as catalog-backend, you can add a corresponding jar file to the classpath and load a custom Iceberg Catalog implementation by specifying the catalog-backend-impl property.
Multi-Catalog Configuration
The Gravitino Iceberg REST server supports multiple catalog backend, and you could use catalog-config-provider to control the behavior about how to manage catalog backend configurations.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.catalog-config-provider |
The className of catalog configuration provider, Gravitino provides build-in static-config-provider and dynamic-config-provider, you could also develop a custom class that implements apache.gravitino.iceberg.service.provider.IcebergConfigProvider and add the corresponding jar file to the Iceberg REST service classpath directory. |
static-config-provider |
No |
Use static-config-provider to manage catalog configuration in the file, the catalog configuration is loaded when the server start up and couldn't be changed.
While dynamic-config-provider is used to manage catalog config through Gravitino server, you could add&delete&change the catalog configurations dynamically.
Static Catalog Configuration Provider
The static catalog configuration provider retrieves the catalog configuration from the configuration file of the Gravitino Iceberg REST server. You could configure the default catalog with gravitino.iceberg-rest.<param name>=<value>. For others, use gravitino.iceberg-rest.catalog.<catalog name>.<param name>=<value> to config the catalog with catalog name.
For instance, you could configure three different catalogs, the default catalog and hive_backend and jdbc_backend catalogs separately.
gravitino.iceberg-rest.catalog-backend = jdbc
gravitino.iceberg-rest.uri = jdbc:postgresql://127.0.0.1:5432
gravitino.iceberg-rest.warehouse = hdfs://127.0.0.1:9000/user/hive/warehouse-postgresql
...
gravitino.iceberg-rest.catalog.hive_backend.catalog-backend = hive
gravitino.iceberg-rest.catalog.hive_backend.uri = thrift://127.0.0.1:9084
gravitino.iceberg-rest.catalog.hive_backend.warehouse = /user/hive/warehouse-hive/
...
gravitino.iceberg-rest.catalog.jdbc_backend.catalog-backend = jdbc
gravitino.iceberg-rest.catalog.jdbc_backend.uri = jdbc:mysql://127.0.0.1:3306/
gravitino.iceberg-rest.catalog.jdbc_backend.warehouse = hdfs://127.0.0.1:9000/user/hive/warehouse-mysql
...
Dynamic Catalog Configuration Provider
The dynamic catalog configuration provider retrieves the catalog configuration from the Gravitino server, and the catalog configuration could be updated dynamically.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.gravitino-uri |
The uri of Gravitino server address, only worked if catalog-config-provider is dynamic-config-provider. Not required when running as an auxiliary service embedded in Gravitino server. |
(none) | Yes, when using dynamic-config-provider in standalone mode |
gravitino.iceberg-rest.gravitino-metalake |
The metalake name that dynamic-config-provider used to request to Gravitino, only worked if catalog-config-provider is dynamic-config-provider. |
(none) | Yes, when using dynamic-config-provider |
gravitino.iceberg-rest.default-catalog-name |
The default catalog name used by Iceberg REST server if the Iceberg REST client doesn't specify the catalog name explicitly. Only worked if catalog-config-provider is dynamic-config-provider. |
(none) | No |
gravitino.iceberg-rest.catalog-cache-eviction-interval-ms |
Catalog cache eviction interval. | 3600000 | No |
:::tip
When using dynamic-config-provider, the behavior differs based on deployment mode:
- Auxiliary mode (embedded in Gravitino server): The service uses internal interfaces to access Gravitino directly. The
gravitino-uriconfiguration is not required and will be ignored if provided. - Standalone mode: The service uses HTTP/REST APIs to communicate with Gravitino server. The
gravitino-uriconfiguration is required and must point to your Gravitino server.
Authorization features are only available when running in auxiliary mode. :::
gravitino.iceberg-rest.catalog-cache-eviction-interval-ms = 300000
gravitino.iceberg-rest.catalog-config-provider = dynamic-config-provider
# gravitino-uri is only required when running as a standalone server
# When running as an auxiliary service (embedded in Gravitino server), this is not needed
gravitino.iceberg-rest.gravitino-uri = http://127.0.0.1:8090
gravitino.iceberg-rest.gravitino-metalake = test
Suppose there are two Iceberg catalogs hive_catalog and jdbc_catalog in Gravitino server, dynamic-config-provider will poll the catalog properties internally and register hive_catalog and jdbc_catalog in Iceberg REST server side. Dynamic config provider will get all catalog properties, for the properties that start with gravitino.bypass. prefix, it will remove the prefix and use the rest part as the catalog property key.
Client Catalog Selection
Access different catalogs by setting the warehouse to the specific catalog name in the Iceberg REST client configuration. The default catalog will be used if you do not specify a warehouse. For instance, suppose there are three catalog backends: default catalog, hive_catalog and jdbc_catalog, consider the case of SparkSQL:
./bin/spark-sql -v \
...
--conf spark.sql.catalog.default_rest_catalog.type=rest \
--conf spark.sql.catalog.default_rest_catalog.uri=http://127.0.0.1:9001/iceberg/ \
...
--conf spark.sql.catalog.hive_backend_rest_catalog.type=rest \
--conf spark.sql.catalog.hive_backend_rest_catalog.uri=http://127.0.0.1:9001/iceberg/ \
--conf spark.sql.catalog.hive_backend_rest_catalog.warehouse=hive_backend \
...
--conf spark.sql.catalog.jdbc_backend_rest_catalog.type=rest \
--conf spark.sql.catalog.jdbc_backend_rest_catalog.uri=http://127.0.0.1:9001/iceberg/ \
--conf spark.sql.catalog.jdbc_backend_rest_catalog.warehouse=jdbc_backend \
...
In the Spark SQL side, you could use default_rest_catalog to access the default catalog backend, and use hive_backend_rest_catalog and jdbc_backend_rest_catalog to access the hive_backend and jdbc_backend catalog backend respectively.
Security and Access Control
OAuth2
Refer to OAuth2 Configuration for how to enable OAuth2.
When enabling OAuth2 and leveraging a dynamic configuration provider to retrieve catalog information from the Gravitino server, use the following configuration parameters to establish OAuth2 authentication for secure communication with the Gravitino server:
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.gravitino-auth-type |
The auth type for communicating with the Gravitino server. Supported values: simple, oauth2. |
simple |
No |
gravitino.iceberg-rest.gravitino-simple.user-name |
The username when using simple auth type. |
iceberg-rest-server |
No |
gravitino.iceberg-rest.gravitino-oauth2.server-uri |
The OAuth2 server uri address. | (none) | Yes, for oauth2 |
gravitino.iceberg-rest.gravitino-oauth2.credential |
The credential to request the OAuth2 token. | (none) | Yes, for oauth2 |
gravitino.iceberg-rest.gravitino-oauth2.token-path |
The path for token of the default OAuth server. | (none) | Yes, for oauth2 |
gravitino.iceberg-rest.gravitino-oauth2.scope |
The scope to request the OAuth2 token. | (none) | Yes, for oauth2 |
Here is an example of how to enable OAuth2 for Gravitino Iceberg REST server:
gravitino.authenticators = oauth
gravitino.authenticator.oauth.serviceAudience = test
gravitino.authenticator.oauth.defaultSignKey = xx
gravitino.authenticator.oauth.tokenPath = oauth2/token
gravitino.authenticator.oauth.serverUri = http://localhost:8177
Add extra configurations if using dynamic-config-provider in standalone mode:
gravitino.iceberg-rest.catalog-config-provider = dynamic-config-provider
gravitino.iceberg-rest.gravitino-metalake = test
# gravitino-uri is required when running in standalone mode
gravitino.iceberg-rest.gravitino-uri = http://127.0.0.1:8090
gravitino.iceberg-rest.gravitino-auth-type = oauth2
gravitino.iceberg-rest.gravitino-oauth2.server-uri = http://localhost:8177
gravitino.iceberg-rest.gravitino-oauth2.credential = test:test
gravitino.iceberg-rest.gravitino-oauth2.token-path = oauth2/token
gravitino.iceberg-rest.gravitino-oauth2.scope = test
Please refer the following configuration If you are using Spark to access Iceberg REST catalog with OAuth2 enabled:
./bin/spark-sql -v \
--conf spark.jars=/Users/fanng/deploy/demo/jars/iceberg-spark-runtime-3.5_2.12-1.11.0.jar \
--conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
--conf spark.sql.catalog.rest=org.apache.iceberg.spark.SparkCatalog \
--conf spark.sql.catalog.rest.rest.auth.type=oauth2 \
--conf spark.sql.catalog.rest.type=rest \
--conf spark.sql.catalog.rest.uri=http://127.0.0.1:9001/iceberg/ \
--conf spark.sql.catalog.rest.prefix=${catalog_name} \
--conf spark.sql.catalog.rest.credential=test:test \
--conf spark.sql.catalog.rest.scope=test \
--conf spark.sql.catalog.rest.oauth2-server-uri=http://localhost:8177/oauth2/token
OAuth 2.0 Token Refresh for Iceberg REST Clients
OAuth 2.0 token refresh challenges may arise in certain query engines when accessing the Gravitino Iceberg REST Catalog (IRC). These are often linked to identity providers without full token exchange support, or to authentication models in which child sessions inherit the expiration policies of their parent sessions.
The following Apache Iceberg change is relevant to this behavior:
| Version | Change |
|---|---|
| Iceberg 1.11.0+ | Supports disabling token exchange, renewing tokens with client credentials, and ensuring that child AuthSession instances use their own expiration instead of inheriting the parent session expiration. |
Apache Iceberg OAuth 2.0 configuration
Spark
Set the following catalog property to disable token exchange:
spark.sql.catalog.${catalog_name}.token-exchange-enabled=false
Flink
Set the following catalog property to disable token exchange:
'token-exchange-enable' = 'false'
Trino
Use Trino 479 or later, and set the following properties in the catalog configuration:
iceberg.rest-catalog.session=NONE
iceberg.rest-catalog.oauth2.token-exchange-enabled=false
Omit iceberg.rest-catalog.session=NONE because NONE is the default value.
HTTPS
Refer to HTTPS Configuration for how to enable HTTPS for Gravitino Iceberg REST server.
Backend Authentication
For the JDBC catalog backend, use gravitino.iceberg-rest.jdbc-user and gravitino.iceberg-rest.jdbc-password to authenticate the JDBC metadata store connection. Use gravitino.iceberg-rest.authentication.type to specify how the catalog backend accesses the warehouse storage. When the warehouse is on HDFS, set it to kerberos or simple, and configure gravitino.iceberg-rest.authentication.kerberos.principal and gravitino.iceberg-rest.authentication.kerberos.keytab-uri for Kerberos authentication.
For the Hive catalog backend, gravitino.iceberg-rest.authentication.type controls both Hive Metastore and HDFS access. When using Kerberos, also configure gravitino.iceberg-rest.hive.metastore.sasl.enabled and related Hive Metastore Kerberos properties.
The detailed configuration items are as follows:
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.authentication.type |
The authentication type for HDFS warehouse access. Supports kerberos and simple for Hive and JDBC catalog backends. |
simple |
No |
gravitino.iceberg-rest.authentication.impersonation-enable |
Whether to enable impersonation for the Iceberg catalog. | false |
No |
gravitino.iceberg-rest.hive.metastore.sasl.enabled |
Whether to enable SASL when connecting to a Kerberos Hive Metastore. | false |
No. Set to true in most cases when gravitino.iceberg-rest.authentication.type is kerberos (some deployments use SSL instead, but that is rare). |
gravitino.iceberg-rest.authentication.kerberos.principal |
The principal for Kerberos authentication. | (none) | Yes, if gravitino.iceberg-rest.authentication.type is kerberos. |
gravitino.iceberg-rest.authentication.kerberos.keytab-uri |
The URI of the keytab for Kerberos authentication. | (none) | Yes, if gravitino.iceberg-rest.authentication.type is kerberos. |
gravitino.iceberg-rest.authentication.kerberos.check-interval-sec |
The check interval of Kerberos credential for the Iceberg catalog. | 60 | No |
gravitino.iceberg-rest.authentication.kerberos.keytab-fetch-timeout-sec |
The fetch timeout for retrieving Kerberos keytab from authentication.kerberos.keytab-uri. |
60 | No |
Kerberos applies to HDFS warehouse access.
Hive backend with Kerberos — authenticates to both Hive Metastore and HDFS:
gravitino.iceberg-rest.catalog-backend = hive
gravitino.iceberg-rest.uri = thrift://127.0.0.1:9083
gravitino.iceberg-rest.warehouse = hdfs://127.0.0.1:9000/user/hive/warehouse-hive
gravitino.iceberg-rest.authentication.type = kerberos
gravitino.iceberg-rest.authentication.kerberos.principal = [email protected]
gravitino.iceberg-rest.authentication.kerberos.keytab-uri = file:///etc/security/keytabs/iceberg.keytab
gravitino.iceberg-rest.hive.metastore.sasl.enabled = true
gravitino.iceberg-rest.hive.metastore.kerberos.principal = hive/[email protected]
gravitino.iceberg-rest.hadoop.security.authentication = kerberos
gravitino.iceberg-rest.dfs.namenode.kerberos.principal = hdfs/[email protected]
JDBC backend with Kerberos-secured HDFS warehouse — JDBC credentials authenticate the metadata store; Kerberos authenticates HDFS access only:
gravitino.iceberg-rest.catalog-backend = jdbc
gravitino.iceberg-rest.jdbc-driver = org.postgresql.Driver
gravitino.iceberg-rest.uri = jdbc:postgresql://127.0.0.1:5432/iceberg
gravitino.iceberg-rest.jdbc-user = iceberg
gravitino.iceberg-rest.jdbc-password = secret
gravitino.iceberg-rest.jdbc-initialize = true
gravitino.iceberg-rest.warehouse = hdfs://127.0.0.1:9000/user/hive/warehouse-jdbc
gravitino.iceberg-rest.authentication.type = kerberos
gravitino.iceberg-rest.authentication.kerberos.principal = [email protected]
gravitino.iceberg-rest.authentication.kerberos.keytab-uri = file:///etc/security/keytabs/iceberg.keytab
gravitino.iceberg-rest.hadoop.security.authentication = kerberos
gravitino.iceberg-rest.dfs.namenode.kerberos.principal = hdfs/[email protected]
Replace host.example.com and EXAMPLE.COM with your Hive/HDFS host name and Kerberos realm. Hive Metastore SASL properties are not required for the JDBC backend.
Credential Vending
Refer to Credential vending for more details.
Access Control
Prerequisites
To use access control with the Iceberg REST service:
- The Iceberg REST service must be running as an auxiliary service within the Gravitino server (standalone mode is not supported for access control)
- Enable authorization in the Gravitino server by setting
gravitino.authorization.enable = true - Use the dynamic configuration provider to retrieve catalog configurations from Gravitino
:::note Access control for the Iceberg REST Catalog (IRC) is only supported when running as an auxiliary service embedded in the Gravitino server. Standalone Iceberg REST server deployments do not support access control features.
When running as an auxiliary service, the gravitino.iceberg-rest.gravitino-uri configuration is not required. The service will use internal interfaces to access Gravitino directly, providing better performance and avoiding the need for HTTP-based communication.
:::
Refer to Access Control for details on how to configure authorization, create roles, and grant privileges in Gravitino.
Access Control Flow
When access control is enabled:
- Clients authenticate with the Iceberg REST service (Now we support Basic auth and OAuth2)
- The Iceberg REST service sends the authenticated user identity, target metadata object, and requested operation to the Gravitino server for authorization verification
- Gravitino verifies the user has the necessary privileges to perform the operation on the specified metadata object
- Upon successful authorization, the Iceberg REST service executes the operation; otherwise, it returns an authorization error
Refer to Access Control for the complete list of privileges and how to grant them.
Storage
If gravitino.iceberg-rest.io-impl is not configured, the Iceberg REST service uses
org.apache.iceberg.io.ResolvingFileIO, which selects a FileIO implementation based
on the URI scheme:
- S3:
s3,s3a, ors3n - OSS:
oss - GCS:
gsorgcs - ADLS:
abfs,abfss,wasb, orwasbs - To override the default, explicitly configure
gravitino.iceberg-rest.io-impl. - Ensure that the corresponding storage bundle is available in the Iceberg REST server classpath.
S3
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.io-impl |
The IO implementation for FileIO in Iceberg. Set it to org.apache.iceberg.aws.s3.S3FileIO to explicitly use S3FileIO. |
org.apache.iceberg.io.ResolvingFileIO |
No |
gravitino.iceberg-rest.s3-endpoint |
An alternative endpoint of the S3 service, This could be used for S3FileIO with any s3-compatible object storage service that has a different endpoint, or access a private S3 endpoint in a virtual private cloud. | (none) | No |
gravitino.iceberg-rest.s3-region |
The region of the S3 service, like us-west-2. |
(none) | No |
gravitino.iceberg-rest.s3-path-style-access |
Whether to use path style access for S3. | false | No |
For other Iceberg s3 properties not managed by Gravitino like s3.sse.type, you could config it directly by gravitino.iceberg-rest.s3.sse.type.
Refer to S3 credentials for credential related configurations.
:::info
- For the JDBC catalog backend, set the
gravitino.iceberg-rest.warehouseparameter tos3://{bucket_name}/${prefix_name}. - For the Hive catalog backend, set
gravitino.iceberg-rest.warehousetos3a://{bucket_name}/${prefix_name}. - Additionally, download the Gravitino Iceberg AWS bundle and place it in the classpath of Iceberg REST server. :::
OSS
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.io-impl |
The IO implementation for FileIO in Iceberg. Set it to org.apache.iceberg.aliyun.oss.OSSFileIO to explicitly use OSSFileIO. |
org.apache.iceberg.io.ResolvingFileIO |
No |
gravitino.iceberg-rest.oss-endpoint |
The endpoint of Aliyun OSS service. | (none) | No |
gravitino.iceberg-rest.oss-region |
The region of the OSS service, like oss-cn-hangzhou, only used when credential-providers is oss-token. |
(none) | No |
For other Iceberg OSS properties not managed by Gravitino like client.security-token, you could config it directly by gravitino.iceberg-rest.client.security-token.
Refer to OSS credentials for credential related configurations.
Download the Gravitino Iceberg Aliyun bundle jar and place it in the classpath of the Iceberg REST server. For classpath details, see Package Layout.
:::info
Please set the gravitino.iceberg-rest.warehouse parameter to oss://{bucket_name}/${prefix_name}.
:::
GCS
Supports using static GCS credential file or generating GCS token to access GCS data.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.io-impl |
The IO implementation for FileIO in Iceberg. Set it to org.apache.iceberg.gcp.gcs.GCSFileIO to explicitly use GCSFileIO. |
org.apache.iceberg.io.ResolvingFileIO |
No |
gravitino.iceberg-rest.gcs-service-account-file |
Path of the GCS service account JSON file. Used for server-side FileIO and for gcs-token credential vending. |
GCS Application default credential. | No |
For other Iceberg GCS properties not managed by Gravitino like gcs.project-id, you could config it directly by gravitino.iceberg-rest.gcs.project-id.
Refer to GCS credentials for credential related configurations.
:::note
When gcs-service-account-file is set, Gravitino loads it at catalog initialization and injects Iceberg gcs.oauth2.token for FileIO. The IRC catalog cache evicts that catalog before the token expires so the next request recreates the catalog and mints a fresh token. If unset, use Application Default Credentials (for example GCE metadata or GOOGLE_APPLICATION_CREDENTIALS).
:::
:::info
Please set gravitino.iceberg-rest.warehouse to gs://{bucket_name}/${prefix_name}, and download Gravitino Iceberg gcp bundle and place it to the classpath of Gravitino Iceberg REST server, iceberg-rest-server/libs for the auxiliary server, libs for the standalone server.
:::
ADLS
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.io-impl |
The IO implementation for FileIO in Iceberg. Set it to org.apache.iceberg.azure.adlsv2.ADLSFileIO to explicitly use ADLSFileIO. |
org.apache.iceberg.io.ResolvingFileIO |
No |
For other Iceberg ADLS properties not managed by Gravitino like adls.read.block-size-bytes, you could config it directly by gravitino.iceberg-rest.adls.read.block-size-bytes.
Refer to ADLS credentials for credential related configurations.
:::info
Please set gravitino.iceberg-rest.warehouse to abfs[s]://{container-name}@{storage-account-name}.dfs.core.windows.net/{path}, and download the Gravitino Iceberg Azure bundle and place it in the classpath of Iceberg REST server.
:::
HDFS
Place HDFS configuration file to the classpath of the Iceberg REST server, iceberg-rest-server/conf for Gravitino server package, conf for standalone Gravitino Iceberg REST server package. When writing to HDFS, the Gravitino Iceberg REST catalog service can only operate as the specified HDFS user and doesn't support proxying to other HDFS users. See Access Apache Hadoop for more details.
:::info Builds with Hadoop 2.10.x. There may be compatibility issues when accessing Hadoop 3.x clusters. :::
Other Storage
For storages not managed by Gravitino directly, configure them through custom catalog properties.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.io-impl |
The IO implementation for FileIO in Iceberg. Use the fully qualified class name to override the default implementation. |
org.apache.iceberg.io.ResolvingFileIO |
No |
To pass custom properties such as security-token to your custom FileIO, configure them via gravitino.iceberg-rest.security-token. The security-token is included in the properties when the FileIO initialize method is invoked.
:::info
Please set the gravitino.iceberg-rest.warehouse parameter to {storage_prefix}://{bucket_name}/${prefix_name}. Additionally, download corresponding jars in the classpath of Iceberg REST server, iceberg-rest-server/libs for the auxiliary server, libs for the standalone server.
:::
Feature Configuration
Views
View operations are supported when using the JDBC catalog backend with schema version V1. The default schema version is now V1, so view support is enabled out of the box. Iceberg will automatically migrate the database schema on the first restart and detect the migration on all subsequent restarts.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.jdbc-schema-version |
The schema version of the JDBC catalog backend. Defaults to V1 to enable view operations. Set to V0 to opt out. |
V1 |
No |
Additional Iceberg Catalog Properties
Add other properties defined in Iceberg catalog properties.
The clients property for example:
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.clients |
The client pool size of the catalog. | 2 |
No |
:::info
catalog-impl has no effect.
:::
Unknown Iceberg catalog keys are passed through after the gravitino.iceberg-rest. prefix is stripped. For a PostgreSQL JDBC backend, a repeatedly executed prepared statement can switch to a generic plan after a few runs and make namespace/table existence checks much slower. Scope plan_cache_mode=force_custom_plan to Gravitino's connections with:
gravitino.iceberg-rest.jdbc.options = -c plan_cache_mode=force_custom_plan
That maps to Iceberg's jdbc.options JDBC connection property, so you do not need database-owner privileges.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.jdbc.options |
Extra JDBC connection options passed through to the Iceberg JDBC catalog. For PostgreSQL, -c plan_cache_mode=force_custom_plan keeps existence checks on custom plans. |
(none) | No |
Event Listeners
Gravitino generates pre-event and post-event for table operations and provide a pluggable event listener to allow you to inject custom logic. For more details, refer to Event listener configuration.
Audit Logging
Gravitino provides a pluggable audit log mechanism, refer to Audit log configuration.
Metrics Store
Gravitino provides a pluggable metrics store interface to store and delete Iceberg metrics. Develop a class that implements org.apache.gravitino.iceberg.service.metrics.IcebergMetricsStore and add the corresponding jar file to the Iceberg REST service classpath directory.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.metricsStore |
The Iceberg metrics storage class name. | (none) | No |
gravitino.iceberg-rest.metricsStoreRetainDays |
The days to retain Iceberg metrics in store, the value not greater than 0 means retain forever. | -1 | No |
gravitino.iceberg-rest.metricsQueueCapacity |
The size of queue to store metrics temporally before storing to the persistent storage. Metrics will be dropped when queue is full. | 1000 | No |
If you want to use jdbc as metrics store, you can set the gravitino.iceberg-rest.metricsStore to jdbc, and set the following configurations to connect to the database.
Initialize the database using the sql scripts in the directory scripts.
Download the corresponding JDBC driver to the iceberg-rest-server/libs directory.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.jdbc-metrics.url |
The JDBC connection address, such as jdbc:postgresql://127.0.0.1:5432/database for Postgres, or jdbc:mysql://127.0.0.1:3306/database for mysql. |
(none) | Yes |
gravitino.iceberg-rest.jdbc-metrics.jdbc-user |
The username of the JDBC connection. | (none) | No |
gravitino.iceberg-rest.jdbc-metrics.jdbc-password |
The password of the JDBC connection. | (none) | No |
gravitino.iceberg-rest.jdbc-metrics.jdbc-driver |
com.mysql.jdbc.Driver or com.mysql.cj.jdbc.Driver for MySQL, org.postgresql.Driver for PostgreSQL. |
(none) | Yes |
Table Metadata Cache
Gravitino features a pluggable cache system for updating or retrieving table metadata in the cache. It validates the location of table metadata against the catalog backend to ensure the correctness of cached data.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.table-metadata-cache-impl |
The implementation of the table metadata cache. Set to empty string("") if catalog-backend is rest catalog, or custom catalog without the SupportsMetadataLocation interface. |
org.apache.gravitino.iceberg.common.cache.LocalTableMetadataCache |
No |
gravitino.iceberg-rest.table-metadata-cache-capacity |
The capacity of the table metadata cache. | 1000 | No |
gravitino.iceberg-rest.table-metadata-cache-expire-minutes |
The expiration time (in minutes) of the table metadata cache. | 60 | No |
Gravitino provides the build-in org.apache.gravitino.iceberg.common.cache.LocalTableMetadataCache to store the cached data in the memory. You could also implement your custom table metadata cache by implementing the org.apache.gravitino.iceberg.common.cache.TableMetadataCache interface.
Scan Plan Cache
Gravitino caches scan plan results to speed up repeated queries with identical parameters. The cache uses snapshot ID as part of the cache key, so queries against different snapshots will not use stale cached data.
Plan scan responses follow the Iceberg 1.11 REST API: completed plans return structured file-scan-tasks only. Legacy plan-tasks JSON strings (used by some Iceberg 1.9.x–1.10.x clients) are not emitted.
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.scan-plan-cache-impl |
The implementation of the scan plan cache. | (none) | No |
gravitino.iceberg-rest.scan-plan-cache-capacity |
The capacity of the scan plan cache. | 200 | No |
gravitino.iceberg-rest.scan-plan-cache-expire-minutes |
The expiration time (in minutes) of the scan plan cache. | 60 | No |
The scan plan cache uses snapshot ID as part of the cache key, ensuring automatic invalidation when table data changes. This can provide significant speedup for repeated queries like dashboard refreshes or BI tool queries.
Gravitino provides the built-in org.apache.gravitino.iceberg.service.cache.LocalScanPlanCache to store the cached data in memory. Also implement your custom scan plan cache by implementing the org.apache.gravitino.iceberg.service.cache.ScanPlanCache interface.
Extension Packages
| Configuration item | Description | Default value | Required |
|---|---|---|---|
gravitino.iceberg-rest.extension-packages |
Comma-separated list of Iceberg REST API packages to expand. | (none) | No |
Operations
Health Check Endpoints
The Iceberg REST server exposes three health check endpoints following the same MicroProfile Health semantics as the main Gravitino server. All endpoints are exempt from authentication. The readiness probe checks whether the IcebergCatalogWrapperManager has been initialized. It performs no I/O and has no configurable timeout.
| Endpoint | Description | HTTP status |
|---|---|---|
GET /iceberg/health/live |
Liveness probe. Returns 200 when the HTTP thread can respond and no OOM has been observed; 503 after an observed OOM. | 200 / 503 |
GET /iceberg/health/ready |
Readiness probe. Returns 200 when the catalog wrapper manager is initialized and no OOM has been observed; 503 otherwise. | 200 / 503 |
GET /iceberg/health |
Aggregate check. Returns 200 when both liveness and readiness pass; 503 when any check fails. | 200 / 503 |
Root-level aliases are also available for global traffic managers that require probes at well-known root paths:
| Alias | Forwards to |
|---|---|
GET /health |
GET /iceberg/health |
GET /health/live |
GET /iceberg/health/live |
GET /health/ready |
GET /iceberg/health/ready |
GET /health.html |
GET /iceberg/health |
Response format:
After an observed OutOfMemoryError, all health endpoints and root aliases return 503 with a jvm failure until restart. See out-of-memory failures for detection scope.
All endpoints return a JSON body with the same shape as the main Gravitino server. The code field is always 0. Both the top-level status and each checks[].status use uppercase UP or DOWN, unlike the lowercase up/down returned by Gravitino and Lance REST. Liveness reports httpServer and readiness reports catalogWrapperManager.
Healthy response (HTTP 200):
{
"code": 0,
"status": "UP",
"checks": [
{ "name": "httpServer", "status": "UP", "details": {} },
{ "name": "catalogWrapperManager", "status": "UP", "details": {} }
]
}
Unhealthy response (HTTP 503):
{
"code": 0,
"status": "DOWN",
"checks": [
{ "name": "httpServer", "status": "UP", "details": {} },
{ "name": "catalogWrapperManager", "status": "DOWN", "details": { "reason": "catalog wrapper manager not initialized" } }
]
}
Memory Settings
The Iceberg REST server uses GRAVITINO_MEM for JVM heap/metaspace flags. Default: -Xms1024m -Xmx1024m -XX:MaxMetaspaceSize=512m. Launch scripts append GRAVITINO_MEM to JAVA_OPTS; set it to adjust heap/metaspace sizes.
Example tuning:
- Development:
GRAVITINO_MEM="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=512m" - Medium workloads:
GRAVITINO_MEM="-Xms4g -Xmx4g -XX:MaxMetaspaceSize=1g" - Higher concurrency or catalog counts: increase heap and metaspace accordingly.
Service Startup and Verification
Auxiliary Service
Start the Iceberg REST service as an auxiliary service in the Gravitino server:
./bin/gravitino.sh start
Standalone Server
Start the standalone Iceberg REST server:
./bin/gravitino-iceberg-rest-server.sh start
Service Verification
Verify that the service is running:
curl http://127.0.0.1:9001/iceberg/v1/config
Example response: {"defaults":{},"overrides":{}, "endpoints":["GET /v1/{prefix}/namespaces", ...]}%.
Docker
Container Startup
Run the Iceberg REST server in a Docker container:
docker run -d -p 9001:9001 apache/gravitino-iceberg-rest:latest
Environment Variables
The Docker image supports local storage by default. For cloud or remote storage, configure the corresponding storage settings through these environment variables:
| Environment Variable | Configuration items |
|---|---|
GRAVITINO_ICEBERG_REST_HOST |
gravitino.iceberg-rest.host |
GRAVITINO_ICEBERG_REST_HTTP_PORT |
gravitino.iceberg-rest.httpPort |
GRAVITINO_ICEBERG_REST_URI |
gravitino.iceberg-rest.uri |
GRAVITINO_ICEBERG_REST_IO_IMPL |
gravitino.iceberg-rest.io-impl |
GRAVITINO_ICEBERG_REST_CATALOG_BACKEND |
gravitino.iceberg-rest.catalog-backend |
GRAVITINO_ICEBERG_REST_JDBC_DRIVER |
gravitino.iceberg-rest.jdbc-driver |
GRAVITINO_ICEBERG_REST_JDBC_USER |
gravitino.iceberg-rest.jdbc-user |
GRAVITINO_ICEBERG_REST_JDBC_PASSWORD |
gravitino.iceberg-rest.jdbc-password |
GRAVITINO_ICEBERG_REST_WAREHOUSE |
gravitino.iceberg-rest.warehouse |
GRAVITINO_ICEBERG_REST_REST_CLIENT_CONNECTION_TIMEOUT_MS |
gravitino.iceberg-rest.rest-client-connection-timeout-ms |
GRAVITINO_ICEBERG_REST_REST_CLIENT_SOCKET_TIMEOUT_MS |
gravitino.iceberg-rest.rest-client-socket-timeout-ms |
GRAVITINO_ICEBERG_REST_CREDENTIAL_PROVIDERS |
gravitino.iceberg-rest.credential-providers |
GRAVITINO_ICEBERG_REST_GCS_SERVICE_ACCOUNT_FILE |
gravitino.iceberg-rest.gcs-service-account-file |
GRAVITINO_ICEBERG_REST_S3_ACCESS_KEY |
gravitino.iceberg-rest.s3-access-key-id |
GRAVITINO_ICEBERG_REST_S3_SECRET_KEY |
gravitino.iceberg-rest.s3-secret-access-key |
GRAVITINO_ICEBERG_REST_S3_ENDPOINT |
gravitino.iceberg-rest.s3-endpoint |
GRAVITINO_ICEBERG_REST_S3_REGION |
gravitino.iceberg-rest.s3-region |
GRAVITINO_ICEBERG_REST_S3_PATH_STYLE_ACCESS |
gravitino.iceberg-rest.s3-path-style-access |
GRAVITINO_ICEBERG_REST_S3_ROLE_ARN |
gravitino.iceberg-rest.s3-role-arn |
GRAVITINO_ICEBERG_REST_S3_EXTERNAL_ID |
gravitino.iceberg-rest.s3-external-id |
GRAVITINO_ICEBERG_REST_S3_TOKEN_SERVICE_ENDPOINT |
gravitino.iceberg-rest.s3-token-service-endpoint |
GRAVITINO_ICEBERG_REST_AZURE_STORAGE_ACCOUNT_NAME |
gravitino.iceberg-rest.azure-storage-account-name |
GRAVITINO_ICEBERG_REST_AZURE_STORAGE_ACCOUNT_KEY |
gravitino.iceberg-rest.azure-storage-account-key |
GRAVITINO_ICEBERG_REST_AZURE_TENANT_ID |
gravitino.iceberg-rest.azure-tenant-id |
GRAVITINO_ICEBERG_REST_AZURE_CLIENT_ID |
gravitino.iceberg-rest.azure-client-id |
GRAVITINO_ICEBERG_REST_AZURE_CLIENT_SECRET |
gravitino.iceberg-rest.azure-client-secret |
GRAVITINO_ICEBERG_REST_OSS_ACCESS_KEY |
gravitino.iceberg-rest.oss-access-key-id |
GRAVITINO_ICEBERG_REST_OSS_SECRET_KEY |
gravitino.iceberg-rest.oss-secret-access-key |
GRAVITINO_ICEBERG_REST_OSS_ENDPOINT |
gravitino.iceberg-rest.oss-endpoint |
GRAVITINO_ICEBERG_REST_OSS_REGION |
gravitino.iceberg-rest.oss-region |
GRAVITINO_ICEBERG_REST_OSS_ROLE_ARN |
gravitino.iceberg-rest.oss-role-arn |
GRAVITINO_ICEBERG_REST_OSS_EXTERNAL_ID |
gravitino.iceberg-rest.oss-external-id |
Deprecated Environment Variables
Use the replacement environment variables instead of these deprecated names.
| Deprecated Environment variables | New environment variables | Deprecated version |
|---|---|---|
GRAVITINO_CREDENTIAL_PROVIDER_TYPE |
GRAVITINO_ICEBERG_REST_CREDENTIAL_PROVIDERS |
0.8.0-incubating |
GRAVITINO_GCS_CREDENTIAL_FILE_PATH |
GRAVITINO_ICEBERG_REST_GCS_SERVICE_ACCOUNT_FILE |
0.8.0-incubating |
Custom Image Build
Build a custom image to add configuration or logic:
sh ./dev/docker/build-docker.sh --platform linux/arm64 --type iceberg-rest-server --image apache/gravitino-iceberg-rest --tag $tag
Playground
Try Spark with the Gravitino Iceberg REST catalog service in the playground.
Access Control Tutorial
Enable access control for the Iceberg REST server with Gravitino's dynamic configuration provider.
:::note Access control requires the Iceberg REST server to run as an auxiliary service in the Gravitino server. Standalone deployments do not support Iceberg REST catalog authorization. :::
Complete these steps:
Step 1: Enable Authorization and the Dynamic Configuration Provider
Add the following to your Gravitino server configuration file (gravitino.conf).
Note that access control is only supported when running the Iceberg REST server as an auxiliary service within the Gravitino server:
gravitino.authorization.enable = true
gravitino.authorization.serviceAdmins = adminUser
gravitino.iceberg-rest.catalog-config-provider = dynamic-config-provider
gravitino.iceberg-rest.gravitino-metalake = test
# Note: gravitino-uri is not required when running as an auxiliary service
# The service will use internal interfaces to access Gravitino
Restart the Iceberg REST server after updating the configuration.
Step 2: Create a Metalake
curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
"name": "test"
}' http://localhost:8090/api/metalakes
Step 3: Create a Catalog
curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
"name": "catalog1",
"type": "ICEBERG",
"comment": "Iceberg catalog",
"properties": {}
}' http://localhost:8090/api/metalakes/test/catalogs
Step 4: Create a Role and Grant Privileges
curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
"name": "role1",
"properties": {},
"securableObjects": [
{
"fullName": "catalog1",
"type": "CATALOG",
"privileges": [
{
"name": "USE_CATALOG",
"condition": "ALLOW"
},
{
"name": "USE_SCHEMA",
"condition": "ALLOW"
},
{
"name": "SELECT_TABLE",
"condition": "ALLOW"
}
]
}
]
}' http://localhost:8090/api/metalakes/test/roles
Step 5: Verify Denied Access
Before granting any privileges, verify that the user cannot access the catalog. Try to list tables as user1 (replace with your actual authentication method):
curl -u user1:password -H "Accept: application/vnd.gravitino.v1+json" \
http://localhost:9001/iceberg/v1/catalog1/namespaces/default/tables
This should return an error indicating insufficient privileges (such as HTTP 403 Forbidden).
Step 6: Grant the Role to a User
Now grant the role with privileges to the user:
curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
"roleNames": ["role1"]
}' http://localhost:8090/api/metalakes/test/permissions/users/user1/grant
Step 7: Verify Granted Access
After granting the role with privileges, repeat the request as user1:
curl -u user1:password -H "Accept: application/vnd.gravitino.v1+json" \
http://localhost:9001/iceberg/v1/catalog1/namespaces/default/tables
This time, the request should succeed and return the list of tables.
Summary
- Enable authorization and set the configuration provider to
dynamic-config-provider. - Create a metalake.
- Create a catalog.
- Create a role and grant privileges.
- Assign the role to a user.
For more details, see the Access Control documentation.