dgraph --help
. You can view
the full set of configuration options for a given subcommand with
dgraph <subcommand> --help
(for example, dgraph zero --help
).
You can configure options in multiple ways, which are listed below from highest
precedence to lowest precedence:
--help
output applies.
You can use multiple configuration methods at the same time, so a core set of
options could be set in a config file, and instance specific options could be
set using environment vars or flags.
v21.03
, and flags for
several commands (alpha
, backup
, bulk
,debug
, live
, and zero
) now
have superflags. Superflags are compound flags that contain one or more options
that let you define multiple settings in a semicolon-delimited list. The general
syntax for superflags is as follows:
--<flagname> option-a=value-a; option-b=value-b
.
The following example shows how to use superflags when running the
dgraph alpha
command.
--help
output. These environment variable names are formed the
concatenation of DGRAPH
, the subcommand invoked (ALPHA
, ZERO
, LIVE
, or
BULK
), and then the name of the flag (in uppercase). For example, instead
running a command like dgraph alpha --block_rate 10
, you could set the
following environment variable: DGRAPH_ALPHA_BLOCK_RATE=10 dgraph alpha
.
So, the environment variable syntax for a superflag
(--<superflag-name> option-a=value; option-b=value
) is
<SUPERFLAG-NAME>="option-a=value;option-b=value"
.
The following is an example of environment variables for dgraph alpha
:
--config
flag (for example, dgraph alpha --config my_config.json
), or using an
environment variable, (for example,
DGRAPH_ALPHA_CONFIG=my_config.json dgraph alpha
).
Dgraph supports configuration file formats that it detects based on file
extensions (.json
,
.yml
or .yaml
). In these files,
the name of the superflag is used as a key that points to a hash. The hash
consists of key: value
pairs that correspond to the superflag’s list of
option=value
pairs.
.toml
,
.hcl
, and
.properties
are not supported
in release v21.03.0
.--<superflag-name> option-a=value;option-b=value
) as follows:
config.json
) using kebab-case:
config.json
) using snake_case:
--<superflag-name> option-a=value;option-b=value
) as follows:
config.yml
) uses kebab-case:
config.yml
) uses snake_case: