Pre-1.0 hoardDB is pre-1.0. Expect breaking changes.

Default settings

Every setting hoardDB reads, with the value it has when you set nothing. The server needs none of them to start: hoarddb-server with no arguments and no configuration file runs on these values.

A setting is changed by an environment variable, or by a key in the YAML configuration file, and the environment wins. Configuration says how, what each setting does and what happens when its value is wrong. Where a default is not a fixed number (it depends on the machine, or on another setting) the cell says what it depends on.

Listening and connections

Where the server listens, and how many connections it accepts. The server listens on this machine only until you change it.

Environment variableDefaultWhat it sets
HOARDDB_TCP_LISTEN127.0.0.1:7433The address clients connect to (TCP with TLS). Set 0.0.0.0:7433 to accept clients from other machines. (tcp.listen)
HOARDDB_TCP_ADVERTISE(empty): the listen addressThe host:port a cluster member tells clients to connect to, when that is not the listen address. (tcp.advertise)
HOARDDB_LISTEN127.0.0.1:4433The node’s own address in a cluster, which other nodes are told to dial. Node-to-node traffic uses the next port up. (server.listen)
HOARDDB_TCP_INTERNODE_LISTEN(empty): HOARDDB_LISTEN with the port plus oneOverrides the node-to-node listen address. (tcp.internode_listen)
HOARDDB_MAX_CONNS1000Client connections the server accepts at once. (server.max_conns)
HOARDDB_MAX_PEER_CONNS64Connections kept for other nodes, separate from the client budget so clients cannot starve them. (server.max_peer_conns)
HOARDDB_TCP_MAX_CONNS_PER_IP64Connections from one source address. 0 turns the limit off. (tcp.max_conns_per_ip)
HOARDDB_TCP_AUTH_MAX_FAILS20Failed logins in a row before an address is slowed down and then refused. 0 turns it off. (tcp.auth_max_fails)
HOARDDB_TCP_IDLE_TIMEOUT300Seconds of silence before a connection is closed. (tcp.idle_timeout_seconds)
HOARDDB_TCP_FRAME_TIMEOUT30Seconds allowed to read one request once it has started. (tcp.frame_timeout_seconds)
HOARDDB_TCP_PIPELINE_FRAMES4Requests read ahead on one connection. 1 is strict one-at-a-time. (tcp.pipeline_frames)
HOARDDB_TCP_PIPELINE_BYTES1048576Bytes of requests read ahead on one connection (1 MiB). (tcp.pipeline_bytes)

Node and root user

Who the node is, and the user it creates on its first start.

Environment variableDefaultWhat it sets
HOARDDB_NODE_ID(empty): the host nameThe node’s name, unique in a cluster. (server.node_id)
HOARDDB_ROOT_USERadminThe name of the root user created on the first start.
HOARDDB_ROOT_PASSWORD(none)The root password for the first start. Without it a terminal asks for one, and a start with no terminal refuses. Only its hash is kept.
HOARDDB_ROOT_PASSWORD_FILE(none)A file holding the root password, read instead of the environment variable.
HOARDDB_REQUIRE_ROOT_PASSWORDfalseWhen true, a first start with no password supplied refuses instead of asking. (auth.require_root_password)
HOARDDB_AUTH_BOOTSTRAP_ROOTtrueWhether the root user variables may create the root user in an empty user store. (auth.auth_bootstrap_root)

TLS

The server creates a self-signed certificate on its first start.

Environment variableDefaultWhat it sets
HOARDDB_TLS_MODEautoauto is the only mode in this version: the node serves a certificate it generated itself. Any other value stops the server at start-up. (tls.mode)
HOARDDB_TLS_CERT(none)Not available in this version: setting it stops the server at start-up. (tls.cert)
HOARDDB_TLS_KEY(none)Not available in this version: setting it stops the server at start-up. (tls.key)
HOARDDB_TLS_CA(none)Not available in this version: setting it stops the server at start-up. (tls.ca)

Authentication

Password and token settings.

Environment variableDefaultWhat it sets
HOARDDB_PASSWORD_MIN_LENGTH12The shortest password accepted, in characters. (auth.password_min_length)
HOARDDB_TOKEN_TTL900Seconds a login token lasts; using it refreshes it. (auth.token_ttl_seconds)
HOARDDB_TOKEN_MAX_LIFETIME12Hours after which a token stops refreshing and the user must log in again. (auth.token_max_lifetime_hours)
HOARDDB_AUTH_SKEW60Seconds of clock difference tolerated when checking a token. (auth.auth_skew_seconds)
HOARDDB_AUTH_MAX_DERIVATIONS(empty): the number of CPUsPassword hashes computed at once. (auth.auth_max_derivations)
HOARDDB_AUTH_KEYRING_WINDOW1800Seconds a previous signing key still validates after a rotation. When unset it is twice the token lifetime, and at least 15 minutes. (auth.auth_keyring_window_seconds)
HOARDDB_AUTH_DEPLOYMENT_ID(empty)A suffix that separates this deployment’s token keys from another’s. (auth.auth_deployment_id)
HOARDDB_AUTH_CONFIG_MAX_STALENESS300Seconds a node may fall behind on users before it refuses new logins. (auth.auth_config_max_staleness_seconds)
HOARDDB_AUTH_MASTER_RETRY5Seconds between retries when copying users to a node that is behind. (auth.auth_master_retry_seconds)

Storage

Where data lives, and the limits on what one write may hold.

Environment variableDefaultWhat it sets
HOARDDB_DATA_DIR./dataThe directory for the node’s data, keys and users. (storage.data_dir)
HOARDDB_BLOB_DIR(empty): <data dir>/blobsWhere large blob payloads are kept. (storage.blob_dir)
HOARDDB_MAX_BLOB_BYTES16777216 (16 MiB)The largest blob accepted. (storage.max_blob_bytes)
HOARDDB_MAX_DOCUMENT_BYTES25165824 (24 MiB)The largest document accepted. (storage.max_document_bytes)
HOARDDB_MEMTABLE_MB(empty): chosen at the first start from the node’s memoryThe store’s write buffer, in MiB. The choice is saved and kept on every restart. (storage.memtable_mb)
HOARDDB_BADGER_BLOCK_CACHE_MB128Block cache of the store, in MiB (the default applies when the setting is 0). (storage.badger_block_cache_mb)
HOARDDB_BADGER_INDEX_CACHE_MB64Index cache of the store, in MiB (the default applies when the setting is 0). (storage.badger_index_cache_mb)
HOARDDB_BADGER_NUM_COMPACTORS4Background compaction workers of the store (the default applies when the setting is 0). (storage.badger_num_compactors)
HOARDDB_BADGER_TABLE_SYNCmsyncHow the store makes new table files durable: msync or stepwise. (storage.badger_table_sync)
HOARDDB_WAL_PREALLOCATEautoWhether write-ahead log segments are filled with zeros before use: auto (on for ext2, ext3 and ext4), on or off. (storage.wal_preallocate)
HOARDDB_UNSAFE_ACK_BEFORE_SYNCfalseWhen true, a write is answered before it is synced to disk. For benchmarks only: it can lose a write the server has acknowledged. (storage.unsafe_ack_before_sync)
HOARDDB_RECLAIM_KEYS_PER_SECOND(empty): 10000How fast the background cleaner deletes the data of dropped buckets, in keys per second for the whole node. (storage.reclaim_keys_per_second)
HOARDDB_DISK_HIGH_WATER85Percent of disk used at which the node stops taking in new data it does not already hold. 0 turns it off. (server.disk_high_water_pct)
HOARDDB_DUMP_PIN_CEILING_SECONDS300Seconds a dump may hold a queue before it gives up. (server.dump_pin_ceiling_seconds)
HOARDDB_RESTORE_DISK_HEADROOM_MULTIPLIER2Free disk a restore needs, as a multiple of the dump’s size. (server.restore_disk_headroom_multiplier)
HOARDDB_TTL_SWEEP_SECONDS60Seconds between passes that delete expired documents. 0 turns it off. (server.ttl_sweep_seconds)
HOARDDB_TTL_SWEEP_BUDGET_SECONDS5Seconds one expiry pass may run. (server.ttl_sweep_budget_seconds)

Queries

Limits on one query.

Environment variableDefaultWhat it sets
HOARDDB_QUERY_MAX_RESULT_BYTES16777216 (16 MiB)The most data one query may hold before it is refused. Allowed from 1 MiB to 24 MiB. (query.max_result_bytes)
HOARDDB_QUERY_CONCURRENCY(empty): twice the number of CPUs, at least 4 and at most 256Queries running at once. More wait their turn and are not refused. (query.concurrency)
HOARDDB_QUERY_PAGE_LIMIT_DEFAULT100Documents in a page when a request names no size. (query.page_limit_default)
HOARDDB_QUERY_PAGE_LIMIT_MAX10000The largest page a request may ask for. (query.page_limit_max)

Logging, metrics and audit

The log goes to standard output as JSON. Metrics, the audit log and profiling are off.

Environment variableDefaultWhat it sets
HOARDDB_LOG_LEVELinfodebug, info, warn or error. (logging.level)
HOARDDB_LOG_FORMATjsonjson or text. (logging.format)
HOARDDB_LOG_OUTPUTstdoutWhere the log is written. (logging.output)
HOARDDB_METRICS_ENABLEDfalseServe Prometheus metrics. (metrics.enabled)
HOARDDB_METRICS_LISTEN127.0.0.1:9090The address of the metrics endpoint, when enabled. (metrics.listen)
HOARDDB_AUDIT_ENABLEDfalseWrite the audit log. (audit.enabled)
HOARDDB_AUDIT_OUTPUT/var/log/hoarddb/audit.jsonlThe audit log file, when enabled. (audit.output)
HOARDDB_PPROF_ENABLEDfalseServe the Go profiling endpoint on port 6060. (debug.pprof_enabled)

Encryption at rest

Off. A node with encryption on does not serve ring mode.

Environment variableDefaultWhat it sets
HOARDDB_ENCRYPTION_KEYSTOREoffWhere the key comes from: off, keyfile, command or systemd-creds. (encryption.keystore)
HOARDDB_ENCRYPTION_KEY_FILE(none)The key file, for the keyfile keystore. (encryption.key_file)
HOARDDB_ENCRYPTION_MODEoffoff, on or require. (encryption.mode)

Cluster

A node is a one-node cluster until you set HOARDDB_CLUSTER_ENABLED. Configuration has the steps to add a node.

Environment variableDefaultWhat it sets
HOARDDB_CLUSTER_ENABLEDfalseStart the node as a member of a ring cluster, with a peer listener. (cluster.enabled)
HOARDDB_CLUSTER_LISTEN(empty): HOARDDB_LISTENThe peer listener address. (cluster.listen)
HOARDDB_CLUSTER_ADVERTISE(empty): the peer listener addressThe address other nodes are told to dial. A wildcard listen address needs it set. (cluster.advertise)
HOARDDB_CLUSTER_WITNESSfalseJoin as a witness: the node votes and holds no data. (cluster.witness)
HOARDDB_CLUSTER_ALLOW_MEMBERSHIP(empty): true in cluster modeLock for join, promote, leave, remove-node and replace-node. (cluster.allow_membership)
HOARDDB_CLUSTER_VOTERS3Voting members, witnesses included: 3 or 5. (cluster.voters)
HOARDDB_SEED_NODES(none)The nodes this node knows about, as node-id@host:port. A node with none starts a new cluster. (hash_ring.seed_nodes)
HOARDDB_SEED_FINGERPRINTS(none)The keys to trust for those nodes, as node-id=SHA256:<hex>. Required whenever there are seed nodes. (hash_ring.seed_fingerprints)
HOARDDB_CLUSTER_STALE_READSfalseLet a node answer reads it might not have the latest of. (cluster.stale_reads)

Cluster timing and limits

Tuning. The defaults pass the start-up check that the timings agree with each other; change one only with the others in mind.

Environment variableDefaultWhat it sets
HOARDDB_CLUSTER_HEARTBEAT_MS100Milliseconds between lease grants. (cluster.heartbeat_ms)
HOARDDB_CLUSTER_STEP_DOWN_MS2000Milliseconds a data node may serve after its last grant. (cluster.step_down_ms)
HOARDDB_CLUSTER_FAILOVER_MS5000Milliseconds within which a second report of a failure may arrive. (cluster.failover_ms)
HOARDDB_CLUSTER_DEAD_MS600000Milliseconds a member stays down before it is declared dead. (cluster.dead_ms)
HOARDDB_CLUSTER_PROBE_INTERVAL_MS1000Milliseconds between probes of another node. (cluster.probe_interval_ms)
HOARDDB_CLUSTER_PROBE_TIMEOUT_MS500Milliseconds before a probe counts as failed. (cluster.probe_timeout_ms)
HOARDDB_CLUSTER_PROBE_FAILURES3Failed probes in a row before a node is suspected. (cluster.probe_failures)
HOARDDB_CLUSTER_RAFT_HEARTBEAT_MS1000Milliseconds between the leader’s heartbeats. (cluster.raft_heartbeat_ms)
HOARDDB_CLUSTER_RAFT_ELECTION_MS1000Milliseconds without a heartbeat before an election starts. (cluster.raft_election_ms)
HOARDDB_CLUSTER_RAFT_LEADER_LEASE_MS500Milliseconds a leader holds its lease without contact from a majority. (cluster.raft_leader_lease_ms)
HOARDDB_CLUSTER_RAFT_SNAPSHOT_THRESHOLD128Log entries between snapshots of the cluster state. (cluster.raft_snapshot_threshold)
HOARDDB_CLUSTER_RAFT_TRAILING_LOGS64Log entries kept after a snapshot. (cluster.raft_trailing_logs)
HOARDDB_CLUSTER_RAFT_MAX_CONNS64Inbound connections from other voters. (cluster.raft_max_conns)
HOARDDB_CLUSTER_RAFT_IDLE_SECONDS120Seconds of silence before such a connection is closed. (cluster.raft_idle_seconds)
HOARDDB_CLUSTER_DECL_CACHE_ENTRIES4096Bucket declarations kept in the cache. (cluster.decl_cache_entries)
HOARDDB_CLUSTER_DECL_CACHE_BYTES33554432 (32 MiB)The size limit of that cache. It takes precedence over the entry limit. (cluster.decl_cache_bytes)
HOARDDB_CLUSTER_PEER_MAX_PENDING128Node-to-node connections held before they are routed. (cluster.peer_max_pending)
HOARDDB_CLUSTER_PEER_MAX_CONNS256Connections held on each node-to-node channel. (cluster.peer_max_conns)
HOARDDB_CLUSTER_PEER_MAX_IN_FLIGHT256Requests handled at once on each node-to-node channel. (cluster.peer_max_in_flight)
HOARDDB_CLUSTER_PEER_IDLE_SECONDS120Seconds of silence before a node-to-node connection is closed. (cluster.peer_idle_seconds)
HOARDDB_CLUSTER_PEER_FRAME_TIMEOUT_MS10000Milliseconds allowed to finish reading one node-to-node frame. (cluster.peer_frame_timeout_ms)

Replication, retention and seeding

Copying data between nodes is not usable end to end yet (Limitations). These are its settings, and their defaults.

Environment variableDefaultWhat it sets
HOARDDB_REPLICATION_FACTOR1Copies of each database, when a database names none. (server.replication_factor)
HOARDDB_WRITE_CONCERN(empty): majority when the factor is above 1, otherwise oneHow many copies a write waits for: one, majority or all. (server.write_concern)
HOARDDB_AUTO_REBALANCEtrueStart moving data as soon as the membership changes. (server.auto_rebalance)
HOARDDB_WAL_RETENTION_INTERVAL60Seconds between passes that prune the write-ahead log. 0 turns it off. (server.wal_retention_seconds)
HOARDDB_REPLICATION_RETAINED_LOG_SECONDS1800Seconds of write-ahead log kept for a node that falls behind. (replication.retained_log_seconds)
HOARDDB_REPLICATION_RETENTION_CHECK_SECONDS60Seconds between retention checks, from 1 to 3600. (replication.retention_check_seconds)
HOARDDB_REPLICATION_LOG_MAX_BYTES4294967296 (4 GiB)The most write-ahead log kept. (replication.log_max_bytes)
HOARDDB_REPLICATION_REPL_WINDOW64Records in flight to a copy at once, from 1 to 4096. (replication.repl_window)
HOARDDB_REPLICATION_DEDUPE_WINDOW8192Applied records remembered, so a repeated request is not applied twice. (replication.dedupe_window)
HOARDDB_REPLICATION_DEDUPE_BYTES536870912 (512 MiB)The size limit of those remembered records. (replication.dedupe_bytes)
HOARDDB_REPLICATION_HANDOFF_DRAIN_MS2000Milliseconds allowed for handing off writes in flight when ownership moves. (replication.handoff_drain_ms)
HOARDDB_REPLICATION_HANDOFF_RETRY_MS200Milliseconds between retries of a hand-off request. (replication.handoff_retry_ms)
HOARDDB_REPLICATION_WC_TIMEOUT_MS5000Milliseconds a write waits for its copies. (replication.wc_timeout_ms)
HOARDDB_REPLICATION_SEED_SLOTS_IN_FLIGHT2Slots copied to a new node at once. (replication.seed_slots_in_flight)
HOARDDB_REPLICATION_SEED_BYTES_PER_SECOND67108864 (64 MiB)The most bytes per second sent while seeding a node. (replication.seed_bytes_per_second)
HOARDDB_REPLICATION_SEED_WINDOW_BYTES8388608 (8 MiB)Seeding data in flight before an acknowledgement. (replication.seed_window_bytes)
HOARDDB_REPLICATION_SEED_CHUNK_BYTES1048576 (1 MiB)Bytes in one seeding chunk. (replication.seed_chunk_bytes)
HOARDDB_REPLICATION_SEED_CHUNK_ENTRIES1024Entries in one seeding chunk. (replication.seed_chunk_entries)
HOARDDB_REPLICATION_SEED_BUFFER_BYTES268435456 (256 MiB)Memory a node may use to buffer seeding data. (replication.seed_buffer_bytes)
HOARDDB_REPLICATION_SEED_SYNC_BYTES67108864 (64 MiB)Seeding bytes written between syncs to disk. (replication.seed_sync_bytes)
HOARDDB_REPLICATION_SEED_RESUME_HOLD_SECONDS300Seconds an interrupted seed is kept so it can resume. (replication.seed_resume_hold_seconds)
HOARDDB_REPLICATION_SEED_IDLE_SECONDS120Seconds of silence before a seeding connection is closed. (replication.seed_idle_seconds)
HOARDDB_REPLICATION_SEED_DISK_HIGH_WATER_PCT85Percent of disk used at which a node refuses to be seeded. (replication.seed_disk_high_water_pct)
HOARDDB_REPLICATION_INCOMING_SEEDS_MAX4Seeds a node accepts at once. (replication.incoming_seeds_max)

Settings with no environment variable

These are set only in the YAML file.

YAML keyDefaultWhat it sets
auth.argon2_memory65536 (KiB, so 64 MiB)Memory the password hash uses.
auth.argon2_iterations3Passes of the password hash.
auth.argon2_parallelism4Threads of the password hash.
auth.argon2_salt_length16 (bytes)Length of the random salt.
auth.argon2_hash_length32 (bytes)Length of the stored hash.
auth.token_expiry_hours0 (not set)Deprecated: use HOARDDB_TOKEN_MAX_LIFETIME.
encryption.key_command(none)The command that prints the key, for the command keystore. A list of arguments, not a shell string.

Source: docs/user/defaults.md in the repository.