Overview
ValKeyper is configured entirely through command-line flags. Unlike Redis, there is no configuration file support - all settings are passed as arguments when starting the server.Command-Line Flag Parsing
Flags are parsed at startup using a custom parser that looks for-- prefixed arguments:
store.go:640-649
Flags are stored in a map and can be retrieved using the CONFIG GET command.
Available Flags
—port
Specifies the TCP port on which ValKeyper listens for client connections.The port number for the ValKeyper server
store.go:650-653
0.0.0.0 on the specified port:
server.go:24-30
—replicaof
Configures the instance as a slave and specifies the master to replicate from.Master address in the format
"<ip> <port>" (space-separated)store.go:654-659
The value must be a single quoted string with space-separated IP and port:
"192.168.1.100 6379"server.go:19-22
—dir
Specifies the directory where RDB persistence files are stored.Directory path for RDB file storage
store.go:661-677
—dbfilename
Specifies the name of the RDB file to load on startup.Filename of the RDB snapshot (typically
dump.rdb)store.go:661-677
Default Values
When flags are not provided, ValKeyper uses these defaults:store.go:64-79
| Setting | Default Value |
|---|---|
| Port | 6379 |
| Role | master |
| Replication ID | 8371b4fb1155b71f4a04d3e1bc3e18c4a990aeeb |
| Replication Offset | 0 |
CONFIG GET Command
Retrieve configuration values at runtime using the CONFIG GET command:store.go:229-238
The response is a RESP array containing the key and value.
Configuration Examples
Basic Master Setup
Start a standalone master on the default port:Master with Persistence
Start a master with RDB persistence:Slave Configuration
Start a slave replicating from a remote master:Slave with Persistence
Combine replication and persistence:Internal Configuration Store
Configuration flags are stored in theInfo struct:
store.go:26-36
The flags map stores all parsed command-line arguments and is used by CONFIG GET.
Server Startup Sequence
Load RDB (if configured)
If
--dir and --dbfilename are set, load the RDB file.Source: store.go:661-677Initiate Replication (if slave)
If Source:
--replicaof is set, connect to the master:server.go:19-22Network Binding
ValKeyper binds to all network interfaces (0.0.0.0) on the specified port:
server.go:24-30
Error Handling
If port binding fails, ValKeyper exits with code 1:- Port already in use by another process
- Insufficient privileges (ports < 1024 on Unix)
- Invalid port number
Limitations
No Configuration File
No Configuration File
Unlike Redis, ValKeyper does not support
redis.conf files. All configuration must be done via command-line flags.No Runtime Reconfiguration
No Runtime Reconfiguration
Configuration changes require restarting the server. You cannot change settings while ValKeyper is running (except via commands like REPLCONF during replication).
No CONFIG SET
No CONFIG SET
The CONFIG SET command is not implemented. Configuration is read-only at runtime.
Limited Validation
Limited Validation
Invalid flag values may cause runtime errors. The parser does not validate port ranges or file paths.
Best Practices
Document Your Setup
Keep a record of command-line flags used in production. Consider using wrapper scripts or systemd unit files.
Use Absolute Paths
Always specify absolute paths for
--dir to avoid confusion with working directories.Quote Composite Values
Remember to quote the
--replicaof value: --replicaof "host port"Monitor Port Conflicts
Check that ports are available before starting, especially when running multiple instances.