跳转至

自定义 NebulaGraph 集群的配置参数

NebulaGraph 集群中 Meta、Storage、Graph 服务都有各自的配置,其在用户创建的 CR 实例(NebulaGraph 集群)的 YAML 文件中被定义为configconfig中的设置会被映射并加载到对应服务的 ConfigMap 中。

Note

暂不支持通过 Helm 自定义 NebulaGraph 集群的配置参数。

config结构如下:

Config map[string]string `json:"config,omitempty"`

前提条件

已使用 K8s 创建一个集群。具体步骤,参见使用 Kubectl 创建 NebulaGraph 集群

操作步骤

以下示例使用名为nebula的集群、名为nebula_cluster.yaml的 YAML 配置文件,说明如何为集群的 Graph 服务配置config

  1. 执行以下命令进入nebula集群的编辑页面。

    kubectl edit nebulaclusters.apps.nebula-graph.io nebula
    
  2. 在 YAML 文件的spec.graphd.config配置项中,添加enable_authorizeauth_type

    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.3.0
        storageClaim:
          resources:
            requests:
              storage: 2Gi
          storageClassName: fast-disks
        config: //为 Graph 服务自定义参数。
          "enable_authorize": "true"
          "auth_type": "password"
    ...
    
  3. 执行kubectl apply -f nebula_cluster.yaml使上述更新生效。

    在自定义参数enable_authorizeauth_type后,Graph 服务对应的 ConfigMap(nebula-graphd)中的配置将被覆盖。

更多信息

有关 Meta、Storage、Graph 服务的配置参数的详细介绍,参见服务配置文件


最后更新: March 28, 2023