Configurations¶
NebulaGraph builds the configurations based on the gflags repository. Most configurations are flags. When the NebulaGraph service starts, it will get the configuration information from Configuration files by default. Configurations that are not in the file apply the default values.
Note
- Because there are many configurations and they may change as NebulaGraph develops, this topic will not introduce all configurations. To get detailed descriptions of configurations, follow the instructions below.
- It is not recommended to modify the configurations that are not introduced in this topic, unless you are familiar with the source code and fully understand the function of configurations.
Legacy version compatibility
In the topic of 1.x, we provide a method of using the CONFIGS
command to modify the configurations in the cache. However, using this method in a production environment can easily cause inconsistencies of configurations between clusters and the local. Therefore, this method will no longer be introduced starting with version 2.x.
Get the configuration list and descriptions¶
Use the following command to get all the configuration information of the service corresponding to the binary file:
<binary> --help
For example:
# Get the help information from Meta
$ /usr/local/nebula/bin/nebula-metad --help
# Get the help information from Graph
$ /usr/local/nebula/bin/nebula-graphd --help
# Get the help information from Storage
$ /usr/local/nebula/bin/nebula-storaged --help
The above examples use the default storage path /usr/local/nebula/bin/
. If you modify the installation path of NebulaGraph, use the actual path to query the configurations.
Get configurations¶
Use the curl
command to get the value of the running configurations.
For example:
# Get the running configurations from Meta
curl 127.0.0.1:19559/flags
# Get the running configurations from Graph
curl 127.0.0.1:19669/flags
# Get the running configurations from Storage
curl 127.0.0.1:19779/flags
Utilizing the -s
or `-silent option allows for the concealment of the progress bar and error messages. For example:
curl -s 127.0.0.1:19559/flags
Note
In an actual environment, use the real IP (or hostname) instead of 127.0.0.1
in the above example.
Configuration files¶
Configuration files for clusters installed from source, with an RPM/DEB package, or a TAR package¶
NebulaGraph provides two initial configuration files for each service, <service_name>.conf.default
and <service_name>.conf.production
. You can use them in different scenarios conveniently. For clusters installed from source and with a RPM/DEB package, the default path is /usr/local/nebula/etc/
. For clusters installed with a TAR package, the path is <install_path>/<tar_package_directory>/etc
.
The configuration values in the initial configuration file are for reference only and can be adjusted according to actual needs. To use the initial configuration file, choose one of the above two files and delete the suffix .default
or .production
to make it valid.
Note
To ensure the availability of services, it is recommended that configurations for the same service be consistent, except for local_ip
. For example, three Storage servers are deployed in one NebulaGraph cluster. The configurations of the three Storage servers are recommended to be consistent, except for local_ip
.
The initial configuration files corresponding to each service are as follows.
NebulaGraph service | Initial configuration file | Description |
---|---|---|
Meta | nebula-metad.conf.default and nebula-metad.conf.production |
Meta service configuration |
Graph | nebula-graphd.conf.default and nebula-graphd.conf.production |
Graph service configuration |
Storage | nebula-storaged.conf.default and nebula-storaged.conf.production |
Storage service configuration |
Each initial configuration file of all services contains local_config
. The default value is true
, which means that the NebulaGraph service will get configurations from its configuration files and start it.
Caution
It is not recommended to modify the value of local_config
to false
. If modified, the NebulaGraph service will first read the cached configurations, which may cause configuration inconsistencies between clusters and cause unknown risks.
Configuration files for clusters installed with Docker Compose¶
For clusters installed with Docker Compose, the configuration file's default installation path of the cluster is <install_path>/nebula-docker-compose/docker-compose.yaml
. The parameters in the command
field of the file are the launch parameters for each service.
Configuration files for clusters installed with NebulaGraph Operator¶
For clusters installed with Kubectl through NebulaGraph Operator, the configuration file's path is the path of the cluster YAML file. You can modify the configuration of each service through the spec.{graphd|storaged|metad}.config
parameter.
Note
The services cannot be configured for clusters installed with Helm.
Modify configurations¶
You can modify the configurations of NebulaGraph in the configuration file or use commands to dynamically modify configurations.
Caution
Using both methods to modify the configuration can cause the configuration information to be managed inconsistently, which may result in confusion. It is recommended to only use the configuration file to manage the configuration, or to make the same modifications to the configuration file after dynamically updating the configuration through commands to ensure consistency.
Modifying configurations in the configuration file¶
By default, each NebulaGraph service gets configured from its configuration files. You can modify configurations and make them valid according to the following steps:
-
For clusters installed from source, with a RPM/DEB, or a TAR package
-
Use a text editor to modify the configuration files of the target service and save the modification.
-
Choose an appropriate time to restart all NebulaGraph services to make the modifications valid.
-
-
For clusters installed with Docker Compose
- In the
<install_path>/nebula-docker-compose/docker-compose.yaml
file, modify the configurations of the target service. - In the
nebula-docker-compose
directory, run the commanddocker-compose up -d
to restart the service involving configuration modifications.
- In the
-
For clusters installed with Kubectl
For details, see Customize configuration parameters for a NebulaGraph cluster.
Dynamically modifying configurations using command¶
You can dynamically modify the configuration of NebulaGraph by using the curl command. For example, to modify the wal_ttl
parameter of the Storage service to 600
, use the following command:
curl -X PUT -H "Content-Type: application/json" -d'{"wal_ttl":"600"}' -s "http://192.168.15.6:19779/flags"
In this command, {"wal_ttl":"600"}
specifies the configuration parameter and its value to be modified, and 192.168.15.6:19779
specifies the IP address and HTTP port number of the Storage service.
Caution
- The functionality of dynamically modifying configurations is only applicable to prototype verification and testing environments. It is not recommended to use this feature in production environments. This is because when the
local_config
value is set totrue
, the dynamically modified configuration is not persisted, and the configuration will be restored to the initial configuration after the service is restarted.
- Only part of the configuration parameters can be dynamically modified. For the specific list of parameters that can be modified, see the description of Whether supports runtime dynamic modifications in the respective service configuration.