Skip to main content
Version: 1.21.x

⚙ Server Configuration

This section describes how to configure ReductStore using environment variables and snap settings.

General Settings

ReductStore uses environment variables for configuration. Here is a list of the general settings:

NameDefaultDescription
RS_LOG_LEVELINFOLogging level: TRACE, DEBUG, INFO, WARNING, ERROR. A user can filter logs by path e.g. INFO,reductstore/api=DEBUG
RS_DATA_PATH/dataPath to a folder where the storage stores the data
RS_HOST0.0.0.0Listening IP address
RS_PORT8383Listening port
RS_INSTANCE_ROLESTANDALONERole of the instance. It can be STANDALONE, PRIMARY, SECONDARY or REPLICA. See Instance Roles for more details.
RS_API_BASE_PATH/Prefix for all URLs of requests
RS_PUBLIC_URLhttp(s)://[RS_HOST]:[RS_PORT][RS_API_BASE_PATH]Public URL of the instance. Used for query links.
RS_PRIMARY_URLPublic URL of the primary ReductStore instance used when forwarding system information (for example, audit events).
RS_SECONDARY_URLOptional fallback URL for the primary instance.
RS_API_TOKENEnables authentication and provisions the init-token with this value. The token cannot be rotated or removed through the API.
RS_INIT_API_TOKENEnables authentication and initializes a manageable init-token with this value. The token can later be rotated or removed through the API.
RS_DISABLE_AUTHfalseSet to true to explicitly run without authentication.
RS_CERT_PATHPath to an SSL certificate. If unset, the storage uses HTTP instead of HTTPS
RS_CERT_KEY_PATHPath to the private key of the desired SSL certificate. Should be set with RS_CERT_PATH
RS_LICENSEInline license document content. Required for commercial usage unless RS_LICENSE_PATH is set. See Pricing for more details.
RS_LICENSE_PATHPath to the license file. Required for commercial usage unless RS_LICENSE is set. See Pricing for more details.
RS_CORS_ALLOW_ORIGINSets the Access-Control-Allow-Origin header. Use * to allow all origins or list specific origins separated by commas.
RS_EXT_PATHIf set, it activates the experimental extension API. The path should be a folder with extension binaries.
RS_INSTANCE_NAMEOptional instance name used in audit record labels (instance). If unset, ReductStore uses OS hostname (or unknown if unavailable).

Standalone, primary, and secondary instances must explicitly choose an authentication mode: set exactly one of RS_API_TOKEN or RS_INIT_API_TOKEN, or set RS_DISABLE_AUTH=true. Do not set both token variables. If RS_DISABLE_AUTH=true, the token variables are ignored.

You can tune other settings such as performance, storage engine, and more. See the advanced settings.

License Configuration

Commercial deployments need a valid enterprise license. You can provide it in one of two ways:

  • Set RS_LICENSE to the complete license document content. This is useful when your deployment platform stores secrets as environment variables.
  • Set RS_LICENSE_PATH to the path of a mounted license file.

Configure only one license source. If both RS_LICENSE and RS_LICENSE_PATH are set, ReductStore rejects the ambiguous configuration and starts without a valid license.

Instance Roles

Depending on the deployment scenario, ReductStore can operate in different modes. You can set the instance role using the RS_INSTANCE_ROLE environment variable. The available roles are:

RoleDescription
STANDALONEThe instance operates independently, handling both read and write operations and doesn't protect data with a lock file.
PRIMARYThe instance acts as the primary node in an active-passive setup, acquiring a lock file to prevent other instances from accessing the same data. It handles both read and write operations.
SECONDARYThe instance acts as the secondary node in an active-passive setup, acquiring a lock file asymmetrically to the primary instance. It handles both read and write operations but operates only when the primary is down.
REPLICAThe instance operates in read-only mode, allowing only read operations. It doesn't acquire a lock file and only serves data.

For Snap Users

If you use snap, you can configure the database by using the snap set command:

snap set reductstore log-level=DEBUG

This command changes the log level to DEBUG and restarts the database. You can check the current configuration with the snap get reductstore command:

snap get reductstore
Key Value
api-base /
api-token
cert-key-path
cert-path
data-path /var/snap/reductstore/common
host 0.0.0.0
log-level DEBUG
port 8383

By default, the database uses the /var/snap/reductstore/common folder to store data. Due to snap restrictions, you can't use root filesystem folders. We recommend that you connect the snap to the removable-media interface and store the data in a folder outside the snap in /mnt/* or /media/* folders:

snap connect reductstore:removable-media
mkdir /mnt/data
snap set reductstore data-path=/mnt/data
danger

Removing the snap will remove all data stored in the default data path. If you want to keep the data, you need to move it to another location before removing the snap. Or use the snap connect reductstore:removable-media command to connect the snap to the removable-media interface and store the data in a folder outside the snap.