diff --git a/docs-2.0-en/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md b/docs-2.0-en/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md index 67dea9fd6e..23171791a9 100644 --- a/docs-2.0-en/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md +++ b/docs-2.0-en/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/docs-2.0-zh/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md b/docs-2.0-zh/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md index 8ca6c73a3a..47eca6886b 100644 --- a/docs-2.0-zh/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md +++ b/docs-2.0-zh/4.deployment-and-installation/2.compile-and-install-nebula-graph/3.deploy-nebula-graph-with-docker-compose.md @@ -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 @@ -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}} 服务的数据和日志 @@ -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 @@ -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)。 ## 常见问题