Skip to main content
Version: v24.1

Superflags

Dgraph uses superflags for complex commands: alpha, backup, bulk, debug, live and zero. Superflags are compound flags that contain one or more options, allowing you to define multiple related settings in a single, semicolon-delimited list.

Syntax​

The general syntax for superflags is:

--<super-flag-name> option-a=value; option-b=value

Semicolons are required between superflag options, but a semicolon after the last option is optional.

note

You should encapsulate the options for a superflag in double-quotes (") if any of those option values include spaces. You can also use quotes to improve readability: --<super-flag-name> "option-a=value; option-b=value"

Available Superflags​

  • --acl
  • --badger
  • --cache
  • --encryption
  • --graphql
  • --limit
  • --raft
  • --security
  • --telemetry
  • --tls
  • --trace
  • --vault

ACL Superflag​

The --acl superflag configures Access Control List settings:

OptionTypeApplies toDescription
secret-filestringalphaFile that stores the HMAC secret used for signing the JWT
access-ttldurationalphaTTL for the access JWT
refresh-ttldurationalphaTTL for the refresh JWT

Badger Superflag​

The --badger superflag configures Badger database options:

OptionTypeApplies toDescription
compressionstringalpha, bulk, backupSpecifies the compression level and algorithm
numgoroutinesintalpha, bulk, backupNumber of Go routines used by Dgraph
note

The --badger superflag allows you to set many advanced Badger options, including: dir, valuedir, syncwrites, numversionstokeep, readonly, inmemory, metricsenabled, memtablesize, basetablesize, baselevelsize, levelsizemultiplier, tablesizemultiplier, maxlevels, vlogpercentile, valuethreshold, nummemtables, blocksize, bloomfalsepositive, blockcachesize, indexcachesize, numlevelzerotables, numlevelzerotablesstall, valuelogfilesize, valuelogmaxentries, numcompactors, compactl0onclose, lmaxcompaction, zstdcompressionlevel, verifyvaluechecksum, encryptionkeyrotationduration, bypasslockguard, checksumverificationmode, detectconflicts, namespaceoffset.

Cache Superflag​

The --cache superflag configures cache settings:

OptionTypeApplies toDescription
size-mbstringalphaTotal size of cache (in MB) per shard in the reducer
percentagestringalphaCache percentages for block cache and index cache

Encryption Superflag​

The --encryption superflag configures encryption settings:

OptionTypeApplies toDescription
key-filestringalpha, bulk, live, restore, debug, decrypt, export_backupThe file that stores the symmetric key

GraphQL Superflag​

The --graphql superflag configures GraphQL settings:

OptionTypeApplies toDescription
introspectionboolalphaEnables GraphQL schema introspection
debugboolalphaEnables debug mode in GraphQL
extensionsboolalphaEnables extensions in GraphQL response body
poll-intervaldurationalphaThe polling interval for GraphQL subscriptions
lambda-urlstringalphaThe URL of a lambda server that implements custom GraphQL JavaScript resolvers

Limit Superflag​

The --limit superflag configures limit settings for Dgraph Alpha:

OptionTypeApplies toDescription
txn-abort-afterstringalphaAbort any pending transactions older than this duration
disable-admin-httpstringzeroTurn on/off the administrative endpoints
max-retriesintalphaMaximum number of retries
mutationsstringalphaMutation mode: allow, disallow, or strict
query-edgeuint64alphaMaximum number of edges that can be returned in a query
normalize-nodeintalphaMaximum number of nodes that can be returned in a query that uses the normalize directive
mutations-nquadintalphaMaximum number of nquads that can be inserted in a mutation request
max-pending-queriesintalphaMaximum number of concurrently processing requests allowed before requests are rejected with 429 Too Many Requests

Raft Superflag​

The --raft superflag configures Raft consensus settings:

OptionTypeApplies toDescription
pending-proposalsintalphaMaximum number of pending mutation proposals; useful for rate limiting
idxintalpha, zeroProvides an optional Raft ID that an Alpha node can use to join Raft groups
groupintalphaProvides an optional Raft group ID that an Alpha node can use to request group membership from a Zero node
learnerboolalpha, zeroMake this Alpha a learner node (used for read-only replicas)
snapshot-after-durationdurationalphaFrequency at which Raft snapshots are created
snapshot-after-entriesintalphaCreate a new Raft snapshot after the specified number of Raft entries

Security Superflag​

The --security superflag configures security settings:

OptionTypeApplies toDescription
tokenstringalphaAuthentication token
whiteliststringalphaA comma separated list of IP addresses, IP ranges, CIDR blocks, or hostnames for administration

Telemetry Superflag​

The --telemetry superflag configures telemetry settings:

OptionTypeApplies toDescription
reportsboolalpha, zeroSends anonymous telemetry data to Dgraph
sentryboolalpha, zeroEnable sending crash events to Sentry

TLS Superflag​

The --tls superflag configures TLS settings:

OptionTypeApplies toDescription
ca-certstringalpha, zero, bulk, backup, liveThe CA cert file used to verify server certificates
use-system-caboolalpha, zero, bulk, backup, liveInclude System CA with Dgraph Root CA
server-namestringalpha, zero, bulk, backup, liveServer name, used for validating the server's TLS host name
client-auth-typestringalpha, zeroTLS client authentication used to validate client connections from external ports
server-certstringalpha, zeroPath and filename of the node certificate (for example, node.crt)
server-keystringalpha, zeroPath and filename of the node certificate private key (for example, node.key)
internal-portboolalpha, zero, bulk, backup, liveMakes internal ports (by default, 5080 and 7080) use the REQUIREANDVERIFY setting
client-certstringalpha, zero, bulk, backup, liveUser cert file provided by the client to the Alpha node
client-keystringalpha, zero, bulk, backup, liveUser private key file provided by the client to the Alpha node

Trace Superflag​

The --trace superflag configures tracing settings:

OptionTypeApplies toDescription
ratiofloat64alpha, zeroThe ratio of queries to trace
jaegerstringalpha, zeroURL of Jaeger to send OpenCensus traces
datadogstringalpha, zeroURL of Datadog to send OpenCensus traces

Vault Superflag​

The --vault superflag configures Vault integration settings:

OptionTypeApplies toDescription
addrstringalpha, bulk, backup, live, debugVault server address, formatted as http://ip-address:port
role-id-filestringalpha, bulk, backup, live, debugFile containing Vault role-id used for AppRole authentication
secret-id-filestringalpha, bulk, backup, live, debugFile containing Vault secret-id used for AppRole authentication
pathstringalpha, bulk, backup, live, debugVault key=value store path (example: secret/data/dgraph for kv-v2, kv/dgraph for kv-v1)
fieldstringalpha, bulk, backup, live, debugVault key=value store field whose value is the base64 encoded encryption key
formatstringalpha, bulk, backup, live, debugVault field format (raw or base64)

Using Superflags​

To learn more about each superflag and its options, see the --help output of the specific Dgraph CLI commands, or refer to the individual command documentation pages.