Skip to main content

Configuring with Environment Variables

Databend provides the option to configure your Meta and Query nodes using environment variables in addition to configuration files. This method proves useful for making adjustments without directly modifying configuration files, and it's particularly effective for enabling dynamic changes, containerized deployments, and secure handling of sensitive data.

It's important to note that there is a mapping relationship between the parameters set in environment variables and those specified in configuration files. In cases where a configuration parameter is defined both via an environment variable and in a configuration file, Databend will prioritize the value provided by the environment variable.

Meta Environment Variables

Below is a list of available environment variables, each correspondingly mapped to parameters found in the configuration file databend-meta.toml. For detailed explanations of each parameter, see Meta Configurations.

Environment VariableMapped to
METASRV_LOG_DIRlog_dir
ADMIN_API_ADDRESSadmin_api_address
METASRV_GRPC_API_ADDRESSgrpc_api_address
METASRV_GRPC_API_ADVERTISE_HOSTgrpc_api_advertise_host
KVSRV_IDid
KVSRV_RAFT_DIRraft_dir
KVSRV_API_PORTraft_api_port
KVSRV_LISTEN_HOSTraft_listen_host
KVSRV_ADVERTISE_HOSTraft_advertise_host
KVSRV_SINGLEsingle

Query Environment Variables

The parameters under the [query] and [storage] sections in the configuration file databend-query.toml can be configured using environment variables.

The names of the environment variables are formed by combining the word QUERY or STORAGE with the corresponding parameter names using underscores. For example, the environment variable for the parameter admin_api_address under the [query] section is QUERY_ADMIN_API_ADDRESS, and the environment variable for the parameter bucket under the [storage.s3] section is STORAGE_S3_BUCKET.

Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today