Configuration #
The NoSQL engine has no configuration file. Every setting is a command-line flag, parsed once at
startup in flags.go. (A .env file in the working directory is loaded as well — see
Environment variables.)
./bin/IceFireDB -h # prints the usage block below
Basic options #
| Flag | Meaning | Default |
|---|---|---|
-a addr | Bind address (host:port) | 127.0.0.1:11001 |
-n id | Node ID — also the Raft server ID and the data subdirectory name | 1 |
-d dir | Data directory | data |
-j addr | Leader address of a cluster to join | (empty — bootstrap) |
-l level | Log level: debug, verb, info, warn, silent | info |
-h | Print usage and exit | — |
-n is an identifier, not a port. Ports come from -a. Two nodes may share -d because each one
writes to <dir>/IceFireDB/<node-id>/, but two nodes must not share a node ID.
Security options #
| Flag | Meaning | Default |
|---|---|---|
--auth token | Cluster authorization token, shared by all nodes and all clients | (empty — auth disabled) |
--tls-cert path | TLS certificate (PEM) | (empty) |
--tls-key path | TLS private key (PEM) | (empty) |
--tls-cert and --tls-key must be supplied together; supplying one without the other is a startup
error. --auth is also accepted from ICEFIREDB_AUTH, and the command-line flag wins when both are
set. Full behaviour, including what the token does and does not protect, is in
Security.
Cluster and networking options #
| Flag | Meaning | Default |
|---|---|---|
--advertise addr | Address other nodes should use to reach this one | (network bound address) |
--openreads | Let followers serve read commands (possibly stale) | false |
--nosync | Skip the per-write disk sync (faster, loses recent writes on power loss) | false |
--localtime | Take the Raft clock from the local machine instead of the network time source | false |
--try-errors | Answer -TRY instead of -MOVED for non-leader reads, and disable the CLUSTER command | false |
--restore path | Bootstrap a brand-new single-node cluster from a snapshot file | (empty) |
--init-run-quit | Initialize the bootstrap state and exit | false |
--raft-backend name | Raft log store: leveldb or bolt | leveldb |
--advertise must include a port; a value without one (or with a non-numeric port) is rejected at
startup. --restore cannot be combined with -j, and is ignored when the data directory already
exists. See
Clustering and
Operations.
Storage options #
| Flag | Meaning | Default |
|---|---|---|
--storage-backend name | KV driver behind the ledis data model | goleveldb |
--ipfs-endpoint url | IPFS API endpoint (HTTP API, not a gateway) | http://localhost:5001 |
--ipfs-synckv-key key | Encryption key for the ipfs-synckv driver (AES-256: 32 bytes) | (empty — no encryption) |
--ipfs-log-dbname name | Database name/identifier shared by ipfs-log nodes | ifdb-event-kv-ipfs-log |
--oss-endpoint url | S3-compatible endpoint | http://localhost:9000 |
--oss-ak key | Access key | placeholder value in the driver default |
--oss-sk secret | Secret key | placeholder value in the driver default |
Supported --storage-backend values: goleveldb, badger, hybriddb, oss, ipfs,
ipfs-synckv, crdt, ipfs-log. leveldb (the cgo driver) and orbitdb are not compiled into
the binary. See
Storage backends for what each driver guarantees.
P2P options (decentralized drivers) #
These configure the libp2p layer used by the crdt and ipfs-log drivers. They have no effect on the
local and object-store drivers.
| Flag | Meaning | Default |
|---|---|---|
--servicename name | Service-discovery identifier | icefiredb |
--nettopic topic | Node-discovery pubsub channel | icefiredb-net |
--datatopic topic | Data-synchronisation pubsub channel | icefiredb-data |
Nodes only exchange data when all three match. Changing them on a live cluster splits it.
Observability options #
| Flag | Meaning | Default |
|---|---|---|
--metrics | Enable the HTTP endpoints /healthz, /readyz, /metrics | false |
--metrics-addr addr | Bind address for those endpoints | 127.0.0.1:11002 |
--pprof | Enable the pprof profiling server | false |
--pprof-addr addr | pprof bind address | 127.0.0.1:26063 |
Both servers are off by default and bound to loopback on purpose. See Observability.
Diagnostic options #
| Flag | Meaning | Default |
|---|---|---|
-t 1..9 | Test helper: derive address and node ID from a single digit (node 1 bootstraps, the rest join it) | (unset) |
--debug | Registered but currently unused | false |
-t is a local-cluster convenience; it is not part of the documented interface and rewrites -a,
-n and -j.
Environment variables #
| Variable | Read by | Effect |
|---|---|---|
ICEFIREDB_AUTH | flags.go | Cluster auth token when --auth is not on the command line |
IPFS_LOG_DBNAME | driver/ipfs-log | Overrides the ipfs-log database name at open time |
The binary also calls godotenv.Load() at startup, so a .env file in the working directory can set
the variables above. Keep secrets in ICEFIREDB_AUTH or .env rather than on the command line — the
process list is world-readable on most systems.
Flags that are printed but not wired #
-h prints a Store options line for --hot-cache-size. That flag is not registered and has no
effect: the hot-cache capacity of the oss, ipfs and ipfs-synckv drivers is the driver default of
1024 MB, set in driver/*/db.go. The same is true of --pubsub-id, which is in the usage text but
commented out with the disabled OrbitDB driver.
Passing an unregistered flag makes Go’s flag package terminate with flag provided but not defined, so this is visible immediately rather than silently ignored.
--debug is the opposite case: it is registered, but nothing reads the variable it sets, so it
changes nothing either.
Recipes #
Local development, one node
./bin/IceFireDB -a 127.0.0.1:11001 -n 1 -d ./data -l debug --nosync
Three-node cluster with auth and metrics on loopback
export ICEFIREDB_AUTH=change-me
./bin/IceFireDB -n 1 -a 0.0.0.0:11001 --advertise 10.0.0.1:11001 -d /var/lib/icefiredb --metrics
./bin/IceFireDB -n 2 -a 0.0.0.0:11001 --advertise 10.0.0.2:11001 -d /var/lib/icefiredb --metrics -j 10.0.0.1:11001
./bin/IceFireDB -n 3 -a 0.0.0.0:11001 --advertise 10.0.0.3:11001 -d /var/lib/icefiredb --metrics -j 10.0.0.1:11001
Badger, TLS, and follower reads
./bin/IceFireDB --storage-backend badger --tls-cert ./cert.pem --tls-key ./key.pem \
--openreads -a 0.0.0.0:11001 -d /var/lib/icefiredb
Decentralized CRDT driver
./bin/IceFireDB --storage-backend crdt \
--servicename my-service --nettopic my-net --datatopic my-data \
-d /var/lib/icefiredb