You can perform a number of Dgraph administrative operations by running the bdd-admin script with the dgraph-admin command.
./bdd-admin.sh dgraph-admin <operation [args]> <hostname>
The operations, arguments, and hostnames the dgraph-admin command supports are described below.
The operation argument specifies the action the script will perform. This argument is required.
| Operation | Description |
|---|---|
| flush | Flushes the Dgraph cache. |
| merge | Merges update generations in the index using the specified merge factor. |
| stickymerge | Changes the merge policy and forces an index merge. |
| stats | Returns the Dgraph statistics. This command is only intended for use by Oracle Support. |
| statsreset | Resets the Dgraph statistics. |
| logroll | Forces a query logroll. This reinitializes the MDEX query log and archives the old log file. |
| log-enable | Enables one or more extended logging features. |
| log-disable | Disables one or more extended logging features. |
| log-status | Returns the current settings for extended logging features. |
| --help | Returns the usage information for the dgraph-admin command and its operations. |
Some operations allow you to specify additional arguments, such as a list of logging features to enable. The arguments each operation supports are discussed in the following sections.
The hostname argument specifies the node(s) the script will run on. This argument is required.
| Hostname | Description |
|---|---|
| --all | Runs the script on all Dgraph nodes in the cluster. |
| <hostname> | Runs the script on the specified node. The hostname must match one listed in the DGRAPH_SERVERS property in the bdd.conf file. |
./bdd-admin.sh dgraph-admin --help
./bdd-admin.sh dgraph-admin <operation> --help