Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New for configs #1297

Merged
merged 2 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ graphd:

2. 在目录`nebula-docker-compose`内执行命令`docker-compose pull`,更新 Graph 服务、Storage 服务和 Meta 服务的镜像。

!!! note
执行`docker-compose pull`命令更新服务镜像前,确保已停止 Nebula Graph。

3. 执行命令`docker-compose up -d`启动 Nebula Graph 服务。

4. 通过 Nebula Console 连接 Nebula Graph 后,分别执行命令`SHOW HOSTS GRAPH`、`SHOW HOSTS STORAGE`、`SHOW HOSTS META`查看各服务版本。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 配置管理

Nebula Graph 基于 [gflags](https://gflags.github.io/gflags/) 库打造了系统配置,多数配置项都是其中的 flags。Nebula Graph 服务启动时,默认会从[配置文件](#_4) 中获取配置信息,文件中没有的配置项应用默认值
Nebula Graph 基于 [gflags](https://gflags.github.io/gflags/) 库打造了系统配置,多数配置项都是其中的 flags。Nebula Graph 服务启动时,默认会从[配置文件](#_4)中获取配置信息。对于文件中没有的配置项,系统使用默认值

!!! enterpriseonly

Expand Down Expand Up @@ -63,7 +63,9 @@ curl 127.0.0.1:19779/flags

## 配置文件简介

Nebula Graph 为每个服务都提供了两份初始配置文件`<service_name>.conf.default`和`<service_name>.conf.production`,方便用户在不同场景中使用。文件的默认路径为`/usr/local/nebula/etc/`。
### 源码、RPM/DEB、TAR 包集群的配置文件

Nebula Graph 为每个服务都提供了两份初始配置文件`<service_name>.conf.default`和`<service_name>.conf.production`,方便用户在不同场景中使用。使用源码和 RPM/DEB 安装集群的配置文件的默认路径为`/usr/local/nebula/etc/`;使用 TAR 包安装集群的配置文件路径为`<install_path>/<tar_package_directory>/etc`TAR 包的安装路径。

初始配置文件中的配置值仅供参考,使用时可根据实际需求调整。如需使用初始配置文件,从上述两个文件选择其一,删除后缀`.default`或`.production`使其生效。

Expand All @@ -83,10 +85,35 @@ Nebula Graph 为每个服务都提供了两份初始配置文件`<service_name>.
!!! caution
不建议修改`local_config`的值为`false`。修改后 Nebula Graph 服务启动后会先尝试从 Meta 服务获取缓存的配置信息,可能导致集群配置不一致,造成未知风险。

### Docker Compose 集群的配置文件

对于使用 Docker Compose 创建的集群,集群的配置文件的默认路径为`<install_path>/nebula-docker-compose/docker-compose.yaml`。配置文件中的`command`下面的参数为各服务的启动参数。

### Nebula Operator 集群的配置文件

对于通过 Nebula Operator 使用 Kubectl 方式创建的集群,集群的配置文件的路径为用户创建集群 YAML 文件的路径。用户可通过配置文件中的`spec.{graphd|storaged|metad}.config`参数修改集群各个服务的相关配置。

!!! note

通过 Helm 部署的集群,暂不支持修改集群服务的相关配置。

关于 Nebula Graph 的配置相关的更多信息,参见 [Nebula Config](https://siwei.io/sketches/nebula-config-explained/)。

## 修改配置

默认情况下,所有 Nebula Graph 服务从配置文件获取配置。用户可以按照以下步骤修改配置并使其生效:
默认情况下,所有 Nebula Graph 服务从配置文件获取配置。用户可以按照以下步骤修改配置并使其生效。

* 针对使用源码、RPM/DEB、TAR 包安装的集群:

1. 使用文本编辑器修改目标服务的配置文件并保存。

2. 选择合适的时间重启**所有** Nebula Graph 服务使修改生效。

1. 使用文本编辑器修改目标服务的配置文件并保存。
* 针对使用 Docker Compose 安装的集群:

1. 在文件`<install_path>/nebula-docker-compose/docker-compose.yaml`中,修改服务配置。
2. 在目录`nebula-docker-compose`内执行命令`docker-compose up -d`重启涉及配置变化的服务。

2. 选择合适的时间重启**所有** Nebula Graph 服务使修改生效。
* 针对使用 Kubectl 方式创建的集群:

具体操作,参见[自定义集群的配置参数](../../nebula-operator/8.custom-cluster-configurations/8.1.custom-conf-parameter.md)。
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Config map[string]string `json:"config,omitempty"`

## 操作步骤

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

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

Expand Down Expand Up @@ -57,6 +57,8 @@ Config map[string]string `json:"config,omitempty"`
...
```

3. 执行`kubectl apply -f nebula_cluster.yaml`使上述更新生效。

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

## 更多信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Nebula Operator 使用持久化卷 PV(Persistent Volume)和持久化卷声

## 操作步骤

以下示例使用名为`nebula`的集群说明如何设置`enablePVReclaim`:
以下示例使用名为`nebula`的集群、名为`nebula_cluster.yaml`的 YAML 配置文件,说明如何设置`enablePVReclaim`:

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

Expand Down Expand Up @@ -96,3 +96,5 @@ Nebula Operator 使用持久化卷 PV(Persistent Volume)和持久化卷声
version: {{nebula.branch}}
...
```

3. 执行`kubectl apply -f nebula_cluster.yaml`使上述更新生效。
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Nebula Graph 的 Storage 服务的扩容分为两个阶段,第一个阶段等

## 操作步骤

以下示例使用名为`nebula`的集群说明如何设置`enableAutoBalance`:
以下示例使用名为`nebula`的集群、名为`nebula_cluster.yaml`的 YAML 配置文件,说明如何设置`enableAutoBalance`:

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

Expand Down Expand Up @@ -101,4 +101,6 @@ Nebula Graph 的 Storage 服务的扩容分为两个阶段,第一个阶段等

- 当设置`enableAutoBalance`的值为`false`时,表示扩容后不会均衡 Storage 数据。

- 当不设置`enableAutoBalance`参数时,默认扩容 Storage 后系统不会自动均衡 Storage 数据。
- 当不设置`enableAutoBalance`参数时,默认扩容 Storage 后系统不会自动均衡 Storage 数据。

3. 执行`kubectl apply -f nebula_cluster.yaml`使上述更新生效。