Skip to content

Commit

Permalink
update config desc of docker-compose (#2543)
Browse files Browse the repository at this point in the history
* update config desc of docker-compose

* 1

* Update 3.deploy-nebula-graph-with-docker-compose.md
  • Loading branch information
abby-cyber authored Apr 26, 2024
1 parent 4408392 commit cffe816
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,19 @@ There are two ways to connect to NebulaGraph:
```bash
$ docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------------------
nebula-docker-compose_console_1 sh -c sleep 3 && Up
nebula-co ...
Name Command State Ports
-----------------------------------------------------------------------------------------------------------------------------------------------------------
nebula-docker-compose_console_1 sh -c for i in `seq 1 60`; ... Up
nebula-docker-compose_graphd1_1 /usr/local/nebula/bin/nebu ... Up (healthy) 0.0.0.0:32847->15669/tcp,:::32847->15669/tcp, 19669/tcp,
0.0.0.0:32846->19670/tcp,:::32846->19670/tcp,
0.0.0.0:32849->5669/tcp,:::32849->5669/tcp, 9669/tcp
......
```
!!! note
`nebula-docker-compose_console_1` and `nebula-docker-compose_graphd1_1` are the container names of NebulaGraph Console and Graph Service respectively.
2. Run the following command to enter the NebulaGraph Console docker container.
```bash
Expand Down Expand Up @@ -144,29 +150,10 @@ nebula-docker-compose_storaged1_1 /usr/local/nebula/bin/nebu ... Up 0.0
nebula-docker-compose_storaged2_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49167->19779/tcp,:::49167->19779/tcp, 0.0.0.0:49164->19780/tcp,:::49164->19780/tcp, 9777/tcp, 9778/tcp, 0.0.0.0:49170->9779/tcp,:::49170->9779/tcp, 9780/tcp
```
If the service is abnormal, you can first confirm the abnormal container name (such as `nebula-docker-compose_graphd2_1`).
Then you can execute `docker ps` to view the corresponding `CONTAINER ID` (such as `2a6c56c405f5`).
If the service is abnormal, you can first confirm the abnormal container name (such as `nebula-docker-compose_graphd2_1`) and then log in to the container and troubleshoot.
```bash
[nebula-docker-compose]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2a6c56c405f5 vesoft/nebula-graphd:nightly "/usr/local/nebula/b…" 36 minutes ago Up 36 minutes (healthy) 0.0.0.0:49230->9669/tcp, 0.0.0.0:49229->19669/tcp, 0.0.0.0:49228->19670/tcp nebula-docker-compose_graphd2_1
7042e0a8e83d vesoft/nebula-storaged:nightly "./bin/nebula-storag…" 36 minutes ago Up 36 minutes (healthy) 9777-9778/tcp, 9780/tcp, 0.0.0.0:49227->9779/tcp, 0.0.0.0:49226->19779/tcp, 0.0.0.0:49225->19780/tcp nebula-docker-compose_storaged2_1
18e3ea63ad65 vesoft/nebula-storaged:nightly "./bin/nebula-storag…" 36 minutes ago Up 36 minutes (healthy) 9777-9778/tcp, 9780/tcp, 0.0.0.0:49219->9779/tcp, 0.0.0.0:49218->19779/tcp, 0.0.0.0:49217->19780/tcp nebula-docker-compose_storaged0_1
4dcabfe8677a vesoft/nebula-graphd:nightly "/usr/local/nebula/b…" 36 minutes ago Up 36 minutes (healthy) 0.0.0.0:49224->9669/tcp, 0.0.0.0:49223->19669/tcp, 0.0.0.0:49222->19670/tcp nebula-docker-compose_graphd1_1
a74054c6ae25 vesoft/nebula-graphd:nightly "/usr/local/nebula/b…" 36 minutes ago Up 36 minutes (healthy) 0.0.0.0:9669->9669/tcp, 0.0.0.0:49221->19669/tcp, 0.0.0.0:49220->19670/tcp nebula-docker-compose_graphd_1
880025a3858c vesoft/nebula-storaged:nightly "./bin/nebula-storag…" 36 minutes ago Up 36 minutes (healthy) 9777-9778/tcp, 9780/tcp, 0.0.0.0:49216->9779/tcp, 0.0.0.0:49215->19779/tcp, 0.0.0.0:49214->19780/tcp nebula-docker-compose_storaged1_1
45736a32a23a vesoft/nebula-metad:nightly "./bin/nebula-metad …" 36 minutes ago Up 36 minutes (healthy) 9560/tcp, 0.0.0.0:49213->9559/tcp, 0.0.0.0:49212->19559/tcp, 0.0.0.0:49211->19560/tcp nebula-docker-compose_metad0_1
3b2c90eb073e vesoft/nebula-metad:nightly "./bin/nebula-metad …" 36 minutes ago Up 36 minutes (healthy) 9560/tcp, 0.0.0.0:49207->9559/tcp, 0.0.0.0:49206->19559/tcp, 0.0.0.0:49205->19560/tcp nebula-docker-compose_metad2_1
7bb31b7a5b3f vesoft/nebula-metad:nightly "./bin/nebula-metad …" 36 minutes ago Up 36 minutes (healthy) 9560/tcp, 0.0.0.0:49210->9559/tcp, 0.0.0.0:49209->19559/tcp, 0.0.0.0:49208->19560/tcp nebula-docker-compose_metad1_1
```
Use the `CONTAINER ID` to log in the container and troubleshoot.
```bash
nebula-docker-compose]$ docker exec -it 2a6c56c405f5 bash
[root@2a6c56c405f5 nebula]#
$ docker exec -it nebula-docker-compose_graphd2_1 bash
```
## Check the service data and logs
Expand Down Expand Up @@ -197,9 +184,49 @@ nebula-docker-compose/
└── storage2
```
## Stop the NebulaGraph services
## Modify configurations
The configuration file of Docker Compose is `nebula-docker-compose/docker-compose.yaml`. To make the new configuration take effect, modify the configuration in this file and restart the service.
The configurations in the `docker-compose.yaml` file overwrite the configurations in the configuration file (`/usr/local/nebula/etc`) of the containered NebulaGraph service. Therefore, you can modify the configurations in the `docker-compose.yaml` file to customize the configurations of the NebulaGraph service.
For more instructions, see [Configurations](../../5.configurations-and-logs/1.configurations/1.configurations.md).
## Restart NebulaGraph services
To restart all the NebulaGraph services, run the following command:
```bash
$ docker-compose restart
Restarting nebula-docker-compose_console_1 ... done
Restarting nebula-docker-compose_graphd_1 ... done
Restarting nebula-docker-compose_graphd1_1 ... done
Restarting nebula-docker-compose_graphd2_1 ... done
Restarting nebula-docker-compose_storaged1_1 ... done
Restarting nebula-docker-compose-storaged0_1 ... done
Restarting nebula-docker-compose_storaged2_1 ... done
Restarting nebula-docker-compose_metad1_1 ... done
Restarting nebula-docker-compose_metad2_1 ... done
Restarting nebula-docker-compose_metad0_1 ... done
```
To restart multiple services, such as graphd and storaged0, run the following command:
```bash
$ docker-compose restart graphd storaged0
Restarting nebula-docker-compose_graphd_1 ... done
Restarting nebula-docker-compose_storaged0_1 ... done
```
You can run the following command to stop the NebulaGraph services:
## Stop and remove NebulaGraph services
You can stop and remove all the NebulaGraph services by running the following command:
!!! danger
This command stops and removes all the containers of the NebulaGraph services and the related network. If you define volumes in the `docker-compose.yaml`, the related data are retained.
The command `docker-compose down -v` removes all the local data. Try this command if you are using the nightly release and having some compatibility issues.
```bash
$ docker-compose down
Expand Down Expand Up @@ -231,15 +258,6 @@ Removing nebula-docker-compose_metad1_1 ... done
Removing network nebula-docker-compose_nebula-net
```
!!! danger
The parameter `-v` in the command `docker-compose down -v` will **delete** all your local NebulaGraph storage data. Try this command if you are using the nightly release and having some compatibility issues.
## Modify configurations
The configuration file of NebulaGraph deployed by Docker Compose is `nebula-docker-compose/docker-compose.yaml`. To make the new configuration take effect, modify the configuration in this file and restart the service.
For more instructions, see [Configurations](../../5.configurations-and-logs/1.configurations/1.configurations.md).
## FAQ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,19 @@

```bash
$ docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------------
nebula-docker-compose_console_1 sh -c sleep 3 && Up
nebula-co ...
Name Command State Ports
-----------------------------------------------------------------------------------------------------------------------------------------------------------
nebula-docker-compose_console_1 sh -c for i in `seq 1 60`; ... Up
nebula-docker-compose_graphd1_1 /usr/local/nebula/bin/nebu ... Up (healthy) 0.0.0.0:32847->15669/tcp,:::32847->15669/tcp, 19669/tcp,
0.0.0.0:32846->19670/tcp,:::32846->19670/tcp,
0.0.0.0:32849->5669/tcp,:::32849->5669/tcp, 9669/tcp
......
```
!!! note
`nebula-docker-compose_console_1``nebula-docker-compose_graphd1_1`为容器的名称。
2. 进入 NebulaGraph Console 容器中。
```bash
Expand Down Expand Up @@ -141,29 +147,10 @@ nebula-docker-compose_storaged1_1 /usr/local/nebula/bin/nebu ... Up 0.0
nebula-docker-compose_storaged2_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49167->19779/tcp,:::49167->19779/tcp, 0.0.0.0:49164->19780/tcp,:::49164->19780/tcp, 9777/tcp, 9778/tcp, 0.0.0.0:49170->9779/tcp,:::49170->9779/tcp, 9780/tcp
```
如果服务有异常,用户可以先确认异常的容器名称(例如`nebula-docker-compose_graphd2_1`),

然后执行`docker ps`查看对应的`CONTAINER ID`(示例为`2a6c56c405f5`)。

```bash
[nebula-docker-compose]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2a6c56c405f5 vesoft/nebula-graphd:nightly "/usr/local/nebula/b…" 36 minutes ago Up 36 minutes (healthy) 0.0.0.0:49230->9669/tcp, 0.0.0.0:49229->19669/tcp, 0.0.0.0:49228->19670/tcp nebula-docker-compose_graphd2_1
7042e0a8e83d vesoft/nebula-storaged:nightly "./bin/nebula-storag…" 36 minutes ago Up 36 minutes (healthy) 9777-9778/tcp, 9780/tcp, 0.0.0.0:49227->9779/tcp, 0.0.0.0:49226->19779/tcp, 0.0.0.0:49225->19780/tcp nebula-docker-compose_storaged2_1
18e3ea63ad65 vesoft/nebula-storaged:nightly "./bin/nebula-storag…" 36 minutes ago Up 36 minutes (healthy) 9777-9778/tcp, 9780/tcp, 0.0.0.0:49219->9779/tcp, 0.0.0.0:49218->19779/tcp, 0.0.0.0:49217->19780/tcp nebula-docker-compose_storaged0_1
4dcabfe8677a vesoft/nebula-graphd:nightly "/usr/local/nebula/b…" 36 minutes ago Up 36 minutes (healthy) 0.0.0.0:49224->9669/tcp, 0.0.0.0:49223->19669/tcp, 0.0.0.0:49222->19670/tcp nebula-docker-compose_graphd1_1
a74054c6ae25 vesoft/nebula-graphd:nightly "/usr/local/nebula/b…" 36 minutes ago Up 36 minutes (healthy) 0.0.0.0:9669->9669/tcp, 0.0.0.0:49221->19669/tcp, 0.0.0.0:49220->19670/tcp nebula-docker-compose_graphd_1
880025a3858c vesoft/nebula-storaged:nightly "./bin/nebula-storag…" 36 minutes ago Up 36 minutes (healthy) 9777-9778/tcp, 9780/tcp, 0.0.0.0:49216->9779/tcp, 0.0.0.0:49215->19779/tcp, 0.0.0.0:49214->19780/tcp nebula-docker-compose_storaged1_1
45736a32a23a vesoft/nebula-metad:nightly "./bin/nebula-metad …" 36 minutes ago Up 36 minutes (healthy) 9560/tcp, 0.0.0.0:49213->9559/tcp, 0.0.0.0:49212->19559/tcp, 0.0.0.0:49211->19560/tcp nebula-docker-compose_metad0_1
3b2c90eb073e vesoft/nebula-metad:nightly "./bin/nebula-metad …" 36 minutes ago Up 36 minutes (healthy) 9560/tcp, 0.0.0.0:49207->9559/tcp, 0.0.0.0:49206->19559/tcp, 0.0.0.0:49205->19560/tcp nebula-docker-compose_metad2_1
7bb31b7a5b3f vesoft/nebula-metad:nightly "./bin/nebula-metad …" 36 minutes ago Up 36 minutes (healthy) 9560/tcp, 0.0.0.0:49210->9559/tcp, 0.0.0.0:49209->19559/tcp, 0.0.0.0:49208->19560/tcp nebula-docker-compose_metad1_1
```

最后登录容器排查问题
如果服务有异常,用户可以先确认异常的容器名称(例如`nebula-docker-compose_graphd2_1`),然后登录容器排查问题:
```bash
[nebula-docker-compose]$ docker exec -it 2a6c56c405f5 bash
[root@2a6c56c405f5 nebula]#
$ docker exec -it nebula-docker-compose_graphd2_1 bash
```
## 查看 {{nebula.name}} 服务的数据和日志
Expand Down Expand Up @@ -194,9 +181,51 @@ nebula-docker-compose/
└── storage2
```
## 停止 {{nebula.name}} 服务
## 修改配置
Docker Compose 配置文件位置为`nebula-docker-compose/docker-compose.yaml`,修改该文件内的配置并重启服务即可使新配置生效。
`docker-compose.yaml`文件中的配置会覆盖服务容器内的配置文件(`/usr/local/nebula/etc`)的配置,因此也可以通过修改`docker-compose.yaml`文件设置服务的配置。
具体的配置说明请参见[配置管理](../../5.configurations-and-logs/1.configurations/1.configurations.md)。
## 重启 {{nebula.name}} 服务
重启所有 {{nebula.name}} 服务:
```bash
$ docker-compose restart
Restarting nebula-docker-compose_console_1 ... done
Restarting nebula-docker-compose_graphd_1 ... done
Restarting nebula-docker-compose_graphd1_1 ... done
Restarting nebula-docker-compose_graphd2_1 ... done
Restarting nebula-docker-compose_storaged1_1 ... done
Restarting nebula-docker-compose-storaged0_1 ... done
Restarting nebula-docker-compose_storaged2_1 ... done
Restarting nebula-docker-compose_metad1_1 ... done
Restarting nebula-docker-compose_metad2_1 ... done
Restarting nebula-docker-compose_metad0_1 ... done
```

用户可以执行如下命令停止 {{nebula.name}} 服务:
重启多个服务,例如重启 graphd 和 stoarged0 服务:

```bash
$ docker-compose restart graphd storaged0
Restarting nebula-docker-compose_graphd_1 ... done
Restarting nebula-docker-compose_storaged0_1 ... done
```

## 停止并删除 {{nebula.name}} 服务

用户可以执行如下命令停止并删除 Docker Compose启动的所有 {{nebula.name}} 服务:


!!! danger

该命令会停止并删除所有 {{nebula.name}} 服务的容器,以及相关网络。如果用户在`docker-compose.yaml`中定义了卷(`volumes`),则会保留相关数据。

命令`docker-compose down -v`的参数`-v`将会**删除**所有本地的数据。如果使用的是 nightly 版本,并且有一些兼容性问题,请尝试这个命令。

```bash
$ docker-compose down
Expand Down Expand Up @@ -228,15 +257,6 @@ Removing nebula-docker-compose_metad1_1 ... done
Removing network nebula-docker-compose_nebula-net
```

!!! danger

命令`docker-compose down -v`的参数`-v`将会**删除**所有本地的数据。如果使用的是 nightly 版本,并且有一些兼容性问题,请尝试这个命令。

## 修改配置

Docker Compose 部署的 {{nebula.name}},配置文件位置为`nebula-docker-compose/docker-compose.yaml`,修改该文件内的配置并重启服务即可使新配置生效。

具体的配置说明请参见[配置管理](../../5.configurations-and-logs/1.configurations/1.configurations.md)。

## 常见问题

Expand Down

0 comments on commit cffe816

Please sign in to comment.