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

update docker #1766

Merged
merged 1 commit into from
May 7, 2022
Merged
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 @@ -67,40 +67,41 @@

4. 连接 Nebula Graph。

1. 使用 Nebula Console 镜像启动一个容器,并连接到 Nebula Graph 服务所在的网络(nebula-docker-compose_nebula-net)中。
!!! compatibility

从 3.1 版本开始,Docker-compose 会自动启动 Nebula Console 镜像的容器,并将 Storage 主机增加至集群中(即`ADD HOSTS`命令)。

1. 使用`docker-compose ps`命令查看 Nebula Console 容器名称。

```bash
$ docker run --rm -ti --network nebula-docker-compose_nebula-net --entrypoint=/bin/sh vesoft/nebula-console:{{console.tag}}
$ docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------------
nebuladockercompose_console_1 sh -c sleep 3 && Up
nebula-co ...
......
```

!!! Note

本地网络可能和示例中的`nebula-docker-compose_nebula-net`不同,请使用如下命令查看。
2. 进入 Nebula Console 容器中。

```bash
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
a74c312b1d16 bridge bridge local
dbfa82505f0e host host local
ed55ccf356ae nebula-docker-compose_nebula-net bridge local
93ba48b4b288 none null local
$ docker exec -it nebuladockercompose_console_1 /bin/sh
/ #
```

2. 通过 Nebula Console 连接 Nebula Graph。
3. 通过 Nebula Console 连接 Nebula Graph。

```bash
docker> nebula-console -u <user_name> -p <password> --address=graphd --port=9669
/ # ./usr/local/bin/nebula-console -u <user_name> -p <password> --address=graphd --port=9669
```

!!! Note

默认情况下,身份认证功能是关闭的,只能使用已存在的用户名(默认为`root`)和任意密码登录。如果想使用身份认证,请参见[身份认证](../../7.data-security/1.authentication/1.authentication.md)。

3. 执行如下命令将 `nebula-storaged` 进程增加为可用状态
4. 查看集群状态

```bash
nebula> ADD HOSTS "storaged0":9779,"storaged1":9779,"storaged2":9779;

nebula> SHOW HOSTS;
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
| Host | Port | HTTP port | Status | Leader count | Leader distribution | Partition distribution | Version |
Expand All @@ -110,8 +111,6 @@
| "storaged2" | 9779 | 19669 | "ONLINE" | 0 | "No valid partition" | "No valid partition" | "3.1.0" |
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
```
!!! Note
从 3.0 开始,上报到 metad 的 `nebula-storaged` 服务需要人为 `ADD HOSTS` 之后才可以被使用。

5. 执行两次`exit`可以退出容器。

Expand All @@ -121,26 +120,17 @@

```bash
$ docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
nebula-docker-compose_graphd1_1 ./bin/nebula-graphd --flag ... Up (health: starting) 13000/tcp, 13002/tcp, 0.0.0.0:33295->19669/tcp, 0.0.0.0:33291->19670/tcp,
3699/tcp, 0.0.0.0:33298->9669/tcp
nebula-docker-compose_graphd2_1 ./bin/nebula-graphd --flag ... Up (health: starting) 13000/tcp, 13002/tcp, 0.0.0.0:33285->19669/tcp, 0.0.0.0:33284->19670/tcp,
3699/tcp, 0.0.0.0:33286->9669/tcp
nebula-docker-compose_graphd_1 ./bin/nebula-graphd --flag ... Up (health: starting) 13000/tcp, 13002/tcp, 0.0.0.0:33288->19669/tcp, 0.0.0.0:33287->19670/tcp,
3699/tcp, 0.0.0.0:9669->9669/tcp
nebula-docker-compose_metad0_1 ./bin/nebula-metad --flagf ... Up (health: starting) 11000/tcp, 11002/tcp, 0.0.0.0:33276->19559/tcp, 0.0.0.0:33275->19560/tcp,
45500/tcp, 45501/tcp, 0.0.0.0:33278->9559/tcp
nebula-docker-compose_metad1_1 ./bin/nebula-metad --flagf ... Up (health: starting) 11000/tcp, 11002/tcp, 0.0.0.0:33279->19559/tcp, 0.0.0.0:33277->19560/tcp,
45500/tcp, 45501/tcp, 0.0.0.0:33281->9559/tcp
nebula-docker-compose_metad2_1 ./bin/nebula-metad --flagf ... Up (health: starting) 11000/tcp, 11002/tcp, 0.0.0.0:33282->19559/tcp, 0.0.0.0:33280->19560/tcp,
45500/tcp, 45501/tcp, 0.0.0.0:33283->9559/tcp
nebula-docker-compose_storaged0_1 ./bin/nebula-storaged --fl ... Up (health: starting) 12000/tcp, 12002/tcp, 0.0.0.0:33290->19779/tcp, 0.0.0.0:33289->19780/tcp,
44500/tcp, 44501/tcp, 0.0.0.0:33294->9779/tcp
nebula-docker-compose_storaged1_1 ./bin/nebula-storaged --fl ... Up (health: starting) 12000/tcp, 12002/tcp, 0.0.0.0:33296->19779/tcp, 0.0.0.0:33292->19780/tcp,
44500/tcp, 44501/tcp, 0.0.0.0:33299->9779/tcp
nebula-docker-compose_storaged2_1 ./bin/nebula-storaged --fl ... Up (health: starting) 12000/tcp, 12002/tcp, 0.0.0.0:33297->19779/tcp, 0.0.0.0:33293->19780/tcp,
44500/tcp, 44501/tcp, 0.0.0.0:33300->9779/tcp
nebuladockercompose_console_1 sh -c sleep 3 && Up
nebula-co ...
nebuladockercompose_graphd1_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49174->19669/tcp,:::49174->19669/tcp, 0.0.0.0:49171->19670/tcp,:::49171->19670/tcp, 0.0.0.0:49177->9669/tcp,:::49177->9669/tcp
nebuladockercompose_graphd2_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49175->19669/tcp,:::49175->19669/tcp, 0.0.0.0:49172->19670/tcp,:::49172->19670/tcp, 0.0.0.0:49178->9669/tcp,:::49178->9669/tcp
nebuladockercompose_graphd_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49180->19669/tcp,:::49180->19669/tcp, 0.0.0.0:49179->19670/tcp,:::49179->19670/tcp, 0.0.0.0:9669->9669/tcp,:::9669->9669/tcp
nebuladockercompose_metad0_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49157->19559/tcp,:::49157->19559/tcp, 0.0.0.0:49154->19560/tcp,:::49154->19560/tcp, 0.0.0.0:49160->9559/tcp,:::49160->9559/tcp, 9560/tcp
nebuladockercompose_metad1_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49156->19559/tcp,:::49156->19559/tcp, 0.0.0.0:49153->19560/tcp,:::49153->19560/tcp, 0.0.0.0:49159->9559/tcp,:::49159->9559/tcp, 9560/tcp
nebuladockercompose_metad2_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49158->19559/tcp,:::49158->19559/tcp, 0.0.0.0:49155->19560/tcp,:::49155->19560/tcp, 0.0.0.0:49161->9559/tcp,:::49161->9559/tcp, 9560/tcp
nebuladockercompose_storaged0_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49166->19779/tcp,:::49166->19779/tcp, 0.0.0.0:49163->19780/tcp,:::49163->19780/tcp, 9777/tcp, 9778/tcp, 0.0.0.0:49169->9779/tcp,:::49169->9779/tcp, 9780/tcp
nebuladockercompose_storaged1_1 /usr/local/nebula/bin/nebu ... Up 0.0.0.0:49165->19779/tcp,:::49165->19779/tcp, 0.0.0.0:49162->19780/tcp,:::49162->19780/tcp, 9777/tcp, 9778/tcp, 0.0.0.0:49168->9779/tcp,:::49168->9779/tcp, 9780/tcp
nebuladockercompose_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 Graph 默认使用`9669`端口为客户端提供服务,如果需要修改端口,请修改目录`nebula-docker-compose`内的文件`docker-compose.yaml`,然后重启 Nebula Graph 服务。
cooper-lzy marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -184,25 +174,27 @@ $ docker-compose down
如果返回如下信息,表示已经成功停止服务。

```bash
Stopping nebula-docker-compose_graphd2_1 ... done
Stopping nebula-docker-compose_graphd1_1 ... done
Stopping nebula-docker-compose_graphd_1 ... done
Stopping nebula-docker-compose_storaged1_1 ... done
Stopping nebula-docker-compose_storaged2_1 ... done
Stopping nebula-docker-compose_storaged0_1 ... done
Stopping nebula-docker-compose_metad0_1 ... done
Stopping nebula-docker-compose_metad1_1 ... done
Stopping nebula-docker-compose_metad2_1 ... done
Removing nebula-docker-compose_graphd2_1 ... done
Removing nebula-docker-compose_graphd1_1 ... done
Removing nebula-docker-compose_graphd_1 ... done
Removing nebula-docker-compose_storaged1_1 ... done
Removing nebula-docker-compose_storaged2_1 ... done
Removing nebula-docker-compose_storaged0_1 ... done
Removing nebula-docker-compose_metad0_1 ... done
Removing nebula-docker-compose_metad1_1 ... done
Removing nebula-docker-compose_metad2_1 ... done
Removing network nebula-docker-compose_nebula-net
Stopping nebuladockercompose_console_1 ... done
Stopping nebuladockercompose_graphd1_1 ... done
Stopping nebuladockercompose_graphd_1 ... done
Stopping nebuladockercompose_graphd2_1 ... done
Stopping nebuladockercompose_storaged1_1 ... done
Stopping nebuladockercompose_storaged0_1 ... done
Stopping nebuladockercompose_storaged2_1 ... done
Stopping nebuladockercompose_metad2_1 ... done
Stopping nebuladockercompose_metad0_1 ... done
Stopping nebuladockercompose_metad1_1 ... done
Removing nebuladockercompose_console_1 ... done
Removing nebuladockercompose_graphd1_1 ... done
Removing nebuladockercompose_graphd_1 ... done
Removing nebuladockercompose_graphd2_1 ... done
Removing nebuladockercompose_storaged1_1 ... done
Removing nebuladockercompose_storaged0_1 ... done
Removing nebuladockercompose_storaged2_1 ... done
Removing nebuladockercompose_metad2_1 ... done
Removing nebuladockercompose_metad0_1 ... done
Removing nebuladockercompose_metad1_1 ... done
Removing network nebuladockercompose_nebula-net
```

!!! danger
Expand Down Expand Up @@ -237,7 +229,7 @@ graphd:

1. 在文件`nebula-docker-compose/docker-compose.yaml`中,找到所有服务的`image`并修改其值为相应的镜像版本。

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

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

Expand All @@ -253,11 +245,7 @@ graphd:

### 如何更新 Nebula Console?

执行如下命令可以更新 Nebula Console 客户端镜像。

```bash
docker pull vesoft/nebula-console:{{console.tag}}
```
`docker-compose pull`会同时更新 Nebula Graph 服务和 Nebula Console。

<!--
## 相关视频
Expand Down