Configuration

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 #

FlagMeaningDefault
-a addrBind address (host:port)127.0.0.1:11001
-n idNode ID — also the Raft server ID and the data subdirectory name1
-d dirData directorydata
-j addrLeader address of a cluster to join(empty — bootstrap)
-l levelLog level: debug, verb, info, warn, silentinfo
-hPrint 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 #

FlagMeaningDefault
--auth tokenCluster authorization token, shared by all nodes and all clients(empty — auth disabled)
--tls-cert pathTLS certificate (PEM)(empty)
--tls-key pathTLS 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 #

FlagMeaningDefault
--advertise addrAddress other nodes should use to reach this one(network bound address)
--openreadsLet followers serve read commands (possibly stale)false
--nosyncSkip the per-write disk sync (faster, loses recent writes on power loss)false
--localtimeTake the Raft clock from the local machine instead of the network time sourcefalse
--try-errorsAnswer -TRY instead of -MOVED for non-leader reads, and disable the CLUSTER commandfalse
--restore pathBootstrap a brand-new single-node cluster from a snapshot file(empty)
--init-run-quitInitialize the bootstrap state and exitfalse
--raft-backend nameRaft log store: leveldb or boltleveldb

--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 #

FlagMeaningDefault
--storage-backend nameKV driver behind the ledis data modelgoleveldb
--ipfs-endpoint urlIPFS API endpoint (HTTP API, not a gateway)http://localhost:5001
--ipfs-synckv-key keyEncryption key for the ipfs-synckv driver (AES-256: 32 bytes)(empty — no encryption)
--ipfs-log-dbname nameDatabase name/identifier shared by ipfs-log nodesifdb-event-kv-ipfs-log
--oss-endpoint urlS3-compatible endpointhttp://localhost:9000
--oss-ak keyAccess keyplaceholder value in the driver default
--oss-sk secretSecret keyplaceholder 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.

FlagMeaningDefault
--servicename nameService-discovery identifiericefiredb
--nettopic topicNode-discovery pubsub channelicefiredb-net
--datatopic topicData-synchronisation pubsub channelicefiredb-data

Nodes only exchange data when all three match. Changing them on a live cluster splits it.

Observability options #

FlagMeaningDefault
--metricsEnable the HTTP endpoints /healthz, /readyz, /metricsfalse
--metrics-addr addrBind address for those endpoints127.0.0.1:11002
--pprofEnable the pprof profiling serverfalse
--pprof-addr addrpprof bind address127.0.0.1:26063

Both servers are off by default and bound to loopback on purpose. See Observability.

Diagnostic options #

FlagMeaningDefault
-t 1..9Test helper: derive address and node ID from a single digit (node 1 bootstraps, the rest join it)(unset)
--debugRegistered but currently unusedfalse

-t is a local-cluster convenience; it is not part of the documented interface and rewrites -a, -n and -j.

Environment variables #

VariableRead byEffect
ICEFIREDB_AUTHflags.goCluster auth token when --auth is not on the command line
IPFS_LOG_DBNAMEdriver/ipfs-logOverrides 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