Skip to main content
Loading

Environment Variables Supported in Dockerized Environments

If you are using Docker to host your Trino cluster and the Trino connector, you can configure the Trino connector by including these environment variables in the docker run command. Use the flag -e for every environment variable that you include.

The environment variables, with the exception of TRINO_DISCOVERY_URI and TRINO_NODE_TYPE, represent a subset of the configuration properties for the Trino connector. If you want to configure the Trino connector in greater detail, then use the configuration properties instead of the environment variables.

Restrictions

In general, you cannot both set environment variables and set configuration properties via mounting the aerospike.properties file. The only exception is when you use TRINO_DISCOVERY_URI and TRINO_NODE_TYPE. You can set those environment variables using the -e option and also mount the aerospike.properties file using the --volume or -v option in the same docker run command.

Example of using environment variables

This example docker run command starts a container and runs a single Trino node within that. The command also sets three environment variables:

docker run --rm -p 8080:8080 -e AS_HOSTLIST=docker.for.mac.host.internal:3000 -e TRINO_NODE_TYPE=coordinator -e STRICT_SCHEMAS=true --name trino-aerospike-container trino-aerospike-image
  • --rm specifies to remove the container automatically when the command exits.
  • -p 8080:8080 binds port 8080 of the container to port 8080 of the host system.
  • trino-aerospike-container is the name that the --name option sets for the container
  • trino-aerospike-image is the name given to reference the container within a Docker network.

List of environment variables

AS_HOSTLIST

Description: A comma-separated list of seed nodes in the Aerospike cluster. If you are configuring the Trino connector with environment variables, you must set a value for this variable.

Default value: null

Default value: __default

Equivalent property in aerospike.properties: aerospike.hostlist


CACHE_TTL_MS

Description: Number of milliseconds to keep the inferred schema cached. If you specify the schema, this property has no effect.

Default value: 1800000

Default value: __default

Equivalent property in aerospike.properties: aerospike.cache-ttl-ms


DEFAULT_SET_NAME

Description: Table name for the default set. Use this environment variable when your namespace has a null set or no sets. If you have multiple namespaces with no sets in your cluster, you can query them, like this:

select * from <namespace_1>.<value>
select * from <namespace_2>.<value>

Where <value> is the value assigned to DEFAULT_SET_NAME.

Default value: __default

Equivalent property in aerospike.properties: aerospike.default-set-name


INSERT_REQUIRE_KEY

Description: Require the primary key (PK) on INSERT queries. Although we recommend that you provide a primary key, you can choose not to by setting this property to false, in which case a UUID is generated for the PK. You can view PKs by setting aerospike.record-key-hidden to false for future queries.

Default value: true

Equivalent property in aerospike.properties: aerospike.insert-require-key


RECORD_KEY_HIDDEN

Description: If set to false, the primary key column is made available in the result set.

Default value: true

Equivalent property in aerospike.properties: aerospike.record-key-hidden


RECORD_KEY_NAME

Description: Column name for the record's primary key.

Default value: __key

Equivalent property in aerospike.properties: aerospike.record-key-name


SPLIT_NUMBER

Description: Number of Trino splits. Update this property to align with the available resources (CPU threads) in your cluster. Aerospike connector supports up to Integer.MAX_VALUE splits (i.e. 2^31-1 Trino splits) for parallel partition scans by Trino workers.

Splits is the unit of parallelism in Trino. Hence, we can support up to ~2B Trino worker threads (configurable by setting task.max-worker-threads in Trino).

Setting this value too high may cause a drop in performance due to context switching. Aerospike recommends that you set the value of aerospike.split-number to the result of multiplying the number of cores by the number of threads per core.

Default value: 4

Equivalent property in aerospike.properties: aerospike.split-number

info

This default value differs from the default value for the equivalent configuration parameter.


STRICT_SCHEMAS

Description: Use a strict schema. See "Strict schemas".

Default value: false

Equivalent property in aerospike.properties: aerospike.strict-schemas


TABLE_DESC_DIR

Description: Path of the directory containing table description files.

Default value: /etc/trino/aerospike

Equivalent property in aerospike.properties: aerospike.table-desc-dir

info

This default value differs from the default value for the equivalent configuration parameter.


TRINO_DISCOVERY_URI

Description: The URI of the Trino coordinator. Replace the default value to match the host and port of the Trino coordinator. This URI must not end in a slash.

You must include this environment variable when you run the docker run command to start a container for a worker node of a multi-node Trino cluster.

Default value: http://localhost:8080

Equivalent property in aerospike.properties: There is none. You can specify the URI only through this environment variable.


TRINO_NODE_TYPE

Description: The type of node that you are starting with the docker run command. Here are the possible values:

  • coordinator: The node is the coordinator of your Trino cluster.
  • worker: The node is a worker in your Trino cluster.

Default: If you do not specify this environment variable, then the docker run command starts up a container that includes a single Trino node. The single node acts as coordinator and worker.

Equivalent property in aerospike.properties: There is none. You can specify the node type only through this environment variable.