Environment Variables
RIOT-X supports configuration via environment variables for some command-line options. This allows for convenient automation and containerized deployments without exposing sensitive information in command lines.
Configuration Precedence
Configuration values are applied in the following order (later values override earlier ones):
-
Built-in defaults - Default values defined in the application
-
Environment variables - Values set via
RIOT_*environment variables -
Command-line arguments - Explicit values passed as CLI options
For example, if you set RIOT_REDIS_HOST=prod-redis but also pass --host dev-redis on the command line, the command-line value dev-redis will be used.
Naming Conventions
Environment variables follow these naming patterns:
-
Single Redis connection: Use
RIOT_REDIS_*(e.g.,RIOT_REDIS_HOST,RIOT_REDIS_PORT) -
Source/Target in replication: Use
RIOT_SOURCE_*andRIOT_TARGET_*(e.g.,RIOT_SOURCE_HOST,RIOT_TARGET_HOST) -
URI vs individual parameters: You can use either
RIOT_REDIS_URIfor a complete connection string, or individual parameters likeRIOT_REDIS_HOSTandRIOT_REDIS_PORT. The URI takes precedence if both are specified.
Job
| Variable | CLI Option | Default | Description |
|---|---|---|---|
|
|
|
Number of concurrent threads to use for batch processing. |
|
|
|
Number of items in each batch. |
|
|
none |
Limit number of items written per second (e.g., 100 or 5k). |
|
|
|
Enable dummy writes. |
|
|
none |
Number of failed items before failing the job. |
|
|
|
Number of times to retry failed items: 0 → never, -1 → always. |
|
|
|
Max duration between batch flushes. |
|
|
none |
Min duration to consider reader complete (e.g., 3s 5m). |
Redis Connection
| Variable | CLI Option | Default | Description |
|---|---|---|---|
|
|
none |
Redis server URI. |
|
|
|
Redis server hostname. |
|
|
|
Redis server port. |
|
|
none |
Redis server socket (overrides hostname and port). |
|
|
none |
ACL style 'AUTH username pass'. Needs password. |
|
|
none |
Password to use when connecting to the Redis server. |
|
|
|
Redis command timeout (e.g., 30s or 5m). |
|
|
|
Redis database number. |
|
|
|
Establish a secure TLS connection. |
|
|
|
Allow insecure TLS connection by skipping cert validation. |
|
|
|
TLS verify mode: FULL, CA, NONE. |
|
|
none |
Path to keystore. |
|
|
none |
Keystore password. |
|
|
none |
Path to truststore. |
|
|
none |
Truststore password. |
|
|
none |
Client certificate to authenticate with (X.509 PEM). |
|
|
none |
Private key file to authenticate with (PKCS#8 PEM). |
|
|
none |
Private key password. |
|
|
none |
CA Certificate file to verify with (X.509). |
|
|
none |
Client name used to connect to Redis. |
|
|
|
Enable Redis cluster mode. |
|
|
Newest supported |
Redis protocol version: RESP2, RESP3. |
|
|
|
Max number of Redis connections. |
|
|
|
Which Redis cluster nodes to read from. |
Redis Reader
| Variable | CLI Option | Default | Description |
|---|---|---|---|
|
|
none |
Pattern of keys to read (default: all keys). |
|
|
none |
Type of keys to read (default: all types). |
|
|
|
How many keys to read at once on each scan iteration. |
|
|
|
Number of values each reader thread should read in a pipelined call. |
|
|
|
Number of threads reading key values concurrently. |
|
|
|
Capacity of the key scan queue for async key prefetching. |
|
|
|
Capacity of the keyspace notification queue. |
|
|
|
Max memory usage for a key to be read (e.g., 12KB, 5MB). |
Database
| Variable | CLI Option | Default | Description |
|---|---|---|---|
|
TABLE parameter |
none |
Fully qualified Snowflake Table or Materialized View (e.g., DB.SCHEMA.TABLE). |
|
|
none |
Max number of rows to import from database. |
|
|
none |
Number of rows to return with each fetch from database. |
|
|
none |
Max number of rows the ResultSet can contain. |
|
|
none |
Database query timeout duration. |
|
|
none |
Snowflake database for the specified table(s). |
|
|
none |
Snowflake schema for the specified table(s). |
|
|
none |
Snowflake role to use. |
|
|
none |
Snowflake warehouse to use. |
|
|
none |
Snowflake CDC database to use for stream and temp table. |
|
|
none |
Snowflake CDC schema to use for stream and temp table. |
|
|
default |
Snowflake stream polling interval. |
|
|
|
Snapshot mode: INITIAL, NEVER, etc. |
|
|
none |
Table column name(s) to use as the key for the CDC event. |
|
|
none |
Columns to simulate CDC activity for instead of connecting to database. |
|
|
|
Max length of RDI stream. Use 0 for no limit. |
|
|
|
Key prefix for stream containing change events. |
|
|
|
Key prefix for offset stored in Redis. |
|
|
|
Key name for Debezium offset. |
|
|
none |
Fully qualified name of the JDBC driver. |
|
|
none |
JDBC URL to connect to the database. |
|
|
none |
Login username of the database. |
|
|
none |
Login password of the database. |
|
|
none |
Maximum number of connections in the pool. |
|
|
none |
Maximum time to wait for a connection from the pool. |
Replication
| Variable | CLI Option | Default | Description |
|---|---|---|---|
|
|
|
Replication mode: SCAN, LIVE, or LIVEONLY. |
|
|
|
Enable data structure-specific replication. |
|
|
|
Log keys being read and written. |
|
|
|
Compare mode: QUICK, FULL, or NONE. |
|
|
|
Delete keys from source after successful replication. |
|
|
|
Do not propagate key expiration times. |
|
|
|
Propagate stream message IDs. |
|
|
|
Drop empty streams. |
|
|
|
Merge collection data structures instead of overwriting them. |
Source Redis
| Variable | CLI Option | Default | Description |
|---|---|---|---|
|
Source URI parameter |
none |
Source server URI. |
|
|
none |
Source ACL style 'AUTH username pass'. Needs password. |
|
|
none |
Password to use when connecting to the source server. |
|
|
|
Source Redis command timeout (e.g., 30s or 5m). |
|
|
|
Establish a secure TLS connection to source. |
|
|
|
Allow insecure TLS connection to source by skipping cert validation. |
|
|
|
Source TLS verify mode: FULL, CA, NONE. |
|
|
none |
Client name used to connect to source Redis. |
|
|
|
Enable source cluster mode. |
|
|
Newest supported |
Redis protocol version used to connect to source. |
|
|
|
Max number of source Redis connections. |
|
|
|
Which source Redis cluster nodes to read from. |
Target Redis
| Variable | CLI Option | Default | Description |
|---|---|---|---|
|
Target URI parameter |
none |
Target server URI. |
|
|
none |
Target ACL style 'AUTH username pass'. Needs password. |
|
|
none |
Password to use when connecting to the target server. |
|
|
|
Target Redis command timeout (e.g., 30s or 5m). |
|
|
|
Establish a secure TLS connection to target. |
|
|
|
Allow insecure TLS connection to target by skipping cert validation. |
|
|
|
Target TLS verify mode: FULL, CA, NONE. |
|
|
none |
Client name used to connect to target Redis. |
|
|
|
Enable target cluster mode. |
|
|
Newest supported |
Redis protocol version used to connect to target. |
|
|
|
Max number of target Redis connections. |
|
|
|
Which target Redis cluster nodes to read from. |
Observability
| Variable | CLI Option | Default | Description |
|---|---|---|---|
|
|
|
Set log level: ERROR, WARN, INFO, DEBUG, or TRACE. |
|
|
|
Progress style: ASCII, BAR, BLOCK, or NONE. |
|
none |
|
Disable colored output in the console. |
|
|
|
Enable metrics. |
|
|
|
Enable/disable JVM metrics. |
|
|
|
Enable command latency metrics. |
|
|
|
Port that Prometheus HTTP server should listen on. |
Usage Examples
Basic Redis Connection
export RIOT_REDIS_HOST=my-redis-server
export RIOT_REDIS_PORT=6380
export RIOT_REDIS_USER=myuser
export RIOT_REDIS_PASS=mypassword
export RIOT_REDIS_DB=1
export RIOT_REDIS_TLS=true
riotx ping
Basic Replication
export RIOT_SOURCE_USER=myuser
export RIOT_SOURCE_PASS=mypassword
export RIOT_TARGET_USER=targetuser
export RIOT_TARGET_PASS=targetpassword
export RIOT_THREADS=4
export RIOT_BATCH=100
riotx replicate redis://source:6379 redis://target:6379
High-Throughput Replication
export RIOT_SOURCE_USER=myuser
export RIOT_SOURCE_PASS=mypassword
export RIOT_TARGET_USER=targetuser
export RIOT_TARGET_PASS=targetpassword
export RIOT_SCAN_COUNT=2000
export RIOT_READ_BATCH=200
export RIOT_READ_THREADS=8
export RIOT_READ_QUEUE=50000
export RIOT_SOURCE_POOL=16
export RIOT_THREADS=8
export RIOT_BATCH=500
riotx replicate redis://source:6379 redis://target:6379
Import
export RIOT_THREADS=8
export RIOT_BATCH=500
export RIOT_FLUSH=10ms
export RIOT_RATE=10000
export RIOT_METRICS=true
export RIOT_PROGRESS=BAR
riotx file-import mydata.csv redis://localhost:6379
Snowflake Import
export RIOT_REDIS_HOST=redis
export RIOT_REDIS_PORT=12000
export RIOT_STREAM_LIMIT=100
export RIOT_ROLE=riotx_cdc
export RIOT_WAREHOUSE=compute_wh
export RIOT_CDC_SCHEMA=cdc_schema
export RIOT_JDBC_URL="jdbc:snowflake://company.snowflakecomputing.com?private_key_file=/path/to/key.p8"
export RIOT_JDBC_USER=username
export RIOT_JDBC_PASS=password
export RIOT_TABLE=db.schema.table
riotx snowflake-import
Notes
-
Environment variables take precedence over command-line defaults but are overridden by explicit command-line arguments.
-
Boolean values can be set to
trueorfalse. -
Duration values support suffixes like
s(seconds),m(minutes),h(hours). -
Numeric values with suffixes like
k(thousand) andm(million) are supported where applicable. -
Sensitive values like passwords should be set via environment variables rather than command-line arguments for security.