Customize configuration parameters for a NebulaGraph cluster¶
Meta, Storage, and Graph services in a NebulaGraph Cluster have their configurations, which are defined as config
in the YAML file of the CR instance (NebulaGraph cluster) you created. The settings in config
are mapped and loaded into the ConfigMap of the corresponding service in Kubernetes.
Note
It is not available to customize configuration parameters for NebulaGraph Clusters deployed with Helm.
The structure of config
is as follows.
Config map[string]string `json:"config,omitempty"`
Prerequisites¶
You have created a NebulaGraph cluster. For how to create a cluster with Kubectl, see Create a cluster with Kubectl.
Steps¶
The following example uses a cluster named nebula
and the cluster's configuration file named nebula_cluster.yaml
to show how to set config
for the Graph service in a NebulaGraph cluster.
-
Run the following command to access the edit page of the
nebula
cluster.kubectl edit nebulaclusters.apps.nebula-graph.io nebula
-
Add
enable_authorize
andauth_type
underspec.graphd.config
.apiVersion: apps.nebula-graph.io/v1alpha1 kind: NebulaCluster metadata: name: nebula namespace: default spec: graphd: resources: requests: cpu: "500m" memory: "500Mi" limits: cpu: "1" memory: "1Gi" replicas: 1 image: vesoft/nebula-graphd version: v3.4.1 storageClaim: resources: requests: storage: 2Gi storageClassName: fast-disks config: // Custom configuration parameters for the Graph service in a cluster. "enable_authorize": "true" "auth_type": "password" ...
To add the
config
for the Meta and Storage services, addspec.metad.config
andspec.storaged.config
respectively. -
Run
kubectl apply -f nebula_cluster.yaml
to push your configuration changes to the cluster.After customizing the parameters
enable_authorize
andauth_type
, the configurations in the corresponding ConfigMap (nebula-graphd
) of the Graph service will be overwritten.
Modify cluster configurations online¶
Cluster configurations are modified online by calling the HTTP interface, without the need to restart the cluster Pod.
It should be noted that only when all configuration items in config
are the parameters that can be dynamically modified at runtime, can the operation of online modifications be triggered. If the configuration items in config
contain parameters that cannot be dynamically modified, then the cluster configuration will be updated by restarting the Pod.
For information about the parameters that can be dynamically modified for each service, see the parameter table column of Whether supports runtime dynamic modifications in Meta service configuration parameters, Storage service configuration parameters, and Graph service configuration parameters, respectively.
Learn more¶
For more information about the configuration parameters of Meta, Storage, and Graph services, see Meta service configuration parameters, Storage service configuration parameters, and Graph service configuration parameters.