Skip to content

Customize configuration parameters for a NebulaGraph cluster

Meta, Storage, and Graph services in a NebulaGraph Cluster have their own configuration settings, which are defined in the YAML file of the NebulaGraph cluster instance as config. These settings are mapped and loaded into the corresponding service's ConfigMap in Kubernetes. At the time of startup, the configuration present in the ConfigMap is mounted onto the directory /usr/local/nebula/etc/ for every service.

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.

  1. Run the following command to access the edit page of the nebula cluster.

    kubectl edit nebulaclusters.apps.nebula-graph.io nebula
    
  2. Add enable_authorize and auth_type under spec.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.5.0
        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, add spec.metad.config and spec.storaged.config respectively.

  3. Run kubectl apply -f nebula_cluster.yaml to push your configuration changes to the cluster.

    After customizing the parameters enable_authorize and auth_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.


Last update: April 19, 2023