Skip to main content
Version: 1.12.x

⚙ Server Configuration and Provisioning

Settings

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

NameDefaultDescription
RS_LOG_LEVELINFOLogging level, can be: TRACE, DEBUG, INFO, WARNING, ERROR
RS_HOST0.0.0.0Listening IP address
RS_PORT8383Listening port
RS_API_BASE_PATH/Prefix for all URLs of requests
RS_DATA_PATH/dataPath to a folder where the storage stores the data
RS_API_TOKENIf set, the storage uses token authorsization
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_LICENSE_PATHPath to the license file. Required for commercial usage. 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.

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 reductstoret 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.

Provisioning

ReductStore provides an HTTP API to create and configure resources such as buckets, access tokens or replication tasks. However, if you are following an Infrastructure as Code (IaC) approach, you may want to provision resources at the deployment stage and ensure that they can't be modified or deleted using the HTTP API.

Example

Here is an example of provisioning two buckets and a token to access them:

RS_BUCKET_A_NAME=bucket-1
RS_BUCKET_A_QUOTA_TYPE=FIFO
RS_BUCKET_A_QUOTA_SIZE=1Tb

RS_BUCKET_B_NAME=bucket-2

RS_TOKEN_A_NAME=token
RS_TOKEN_A_VALUE=somesecret
RS_TOKEN_A_READ=bucket-1,bucket-2

As you can see, each resource has a type and an ID. The type is BUCKET for buckets and TOKEN for tokens. The ID is a unique identifier for the resource. You can use any string value for the ID. It is only used to group resources of the same type.

Below you will find the available settings for each resource type.

Bucket Settings

You can provision buckets by setting environment variables. The following table lists the available settings:

NameDefaultDescription
RS_BUCKET_<ID>_NAMEProvisioned bucket name (required)
RS_BUCKET_<ID>_QUOTA_TYPENONEIt can be NONE, FIFO or HARD.
RS_BUCKET_<ID>_QUOTA_SIZE0Size of quota to start removing old data e.g. 1 KB, 10.4 MB etc.
RS_BUCKET_<ID>_MAX_BLOCK_SIZE64MbMaximal block size for batched records
RS_BUCKET_<ID>_MAX_BLOCK_RECORDS1024Maximal number of batched records in a block

For more information about the bucket settings, see the Buckets Guide.

Token Settings

You can provision tokens by setting environment variables. The following table lists the available settings:

NameDefaultDescription
RS_TOKEN_<ID>_NAMEProvisioned token name (required)
RS_TOKEN_<ID>_VALUEProvisioned value of token (required)
RS_TOKEN_<ID>_FULL_ACCESSfalseFull access permission
RS_TOKEN_<ID>_READList of buckets for reading separate by a comma.
RS_TOKEN_<ID>_WRITEList of buckets for writing separate by a comma.

For more information about the token settings, see the Access Control Guide.

Replication Settings

You can provision replication tasks by setting environment variables. The following table lists the available settings:

NameDefaultDescription
RS_REPLICATION_<ID>_NAMEProvisioned replication task name (required)
RS_REPLICATION_<ID>_SRC_BUCKETSource bucket name (required)
RS_REPLICATION_<ID>_DST_BUCKETRemote bucket name (required). It must be created before replication
RS_REPLICATION_<ID>_DST_HOSTURL of destination instance (required). For example, https://play.reduct.store or http://localhost:8383
RS_REPLICATION_<ID>_DST_TOKENToken for destination instance
RS_REPLICATION_<ID>_ENTRIESList of entries to replicate. Separate entries with a comma. If the list is empty, all entries will be replicated.
RS_REPLICATION_<ID>_INCLUDE_<KEY>Replicate only records with KEY equal to the value of the environment variable. Can be used multiple times.
RS_REPLICATION_<ID>_EXCLUDE_<KEY>Do not replicate records with KEY equal to the value of the environment variable. Can be used multiple times.
RS_REPLICATION_<ID>_EACH_SReplicate a record every S seconds. Can have a floating-point value.
RS_REPLICATION_<ID>_EACH_NReplicate every N-th record.

For more information about the replication settings, see the Data Replication Guide.