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 #1328

Merged
merged 3 commits into from
May 12, 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 @@ Using Docker Compose can quickly deploy Nebula Graph services based on the prepa

4. Connect to Nebula Graph.

1. Run the following command to start a new docker container with the Nebula Console image, and connect the container to the network where Nebula Graph is deployed (nebula-docker-compose_nebula-net).
!!! Note

Starting from Nebula Graph version 3.1.0, nebula-docker-compose automatically starts a Nebula Console docker container and adds the storage host to the cluster (i.e. `ADD HOSTS` command).

1. Run the following command to view the name of Nebula Console docker container.

```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

The local network may be different from the `nebula-docker-compose_nebula-net` in the above example. Use the following command.
2. Run the following command to enter the Nebula Console docker container.

```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. Connect to Nebula Graph with Nebula Console.
3. Connect to Nebula Graph with Nebula Console.

```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

By default, the authentication is off, you can only log in with an existing username (the default is `root`) and any password. To turn it on, see [Enable authentication](../../7.data-security/1.authentication/1.authentication.md).

3. Run the following commands to make the `nebula-storaged` processes to the available state.
4. Run the following commands to view the cluster state.

```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 @@ -111,38 +112,25 @@ Using Docker Compose can quickly deploy Nebula Graph services based on the prepa
+-------------+------+-----------+----------+--------------+----------------------+------------------------+---------+
```

!!! Note

Starting from Nebula Graph version 3.0.0, the `nebula-storaged` service reported to metad needs to execute 'ADD HOSTS' manually before it can be used.

5. Run `exit` twice to switch back to your terminal (shell). You can run Step 4 to log in to Nebula Graph again.
5. Run `exit` twice to switch back to your terminal (shell).

## Check the Nebula Graph service status and ports

Run `docker-compose ps` to list all the services of Nebula Graph and their status and ports.

```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 provides services to the clients through port `9669` by default. To use other ports, modify the `docker-compose.yaml` file in the `nebula-docker-compose` directory and restart the Nebula Graph services.
Expand Down Expand Up @@ -186,25 +174,27 @@ $ docker-compose down
The following information indicates you have successfully stopped the Nebula Graph services:

```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 @@ -239,7 +229,7 @@ graphd:

1. In the `nebula-docker-compose/docker-compose.yaml` file, change all the `image` values to the required image version.

2. In the `nebula-docker-compose` directory, run `docker-compose pull` to update the images of the Graph Service, Storage Service, and Meta Service.
2. In the `nebula-docker-compose` directory, run `docker-compose pull` to update the images of the Graph Service, Storage Service, Meta Service, and Nebula Console.

3. Run `docker-compose up -d` to start the Nebula Graph services again.

Expand All @@ -255,11 +245,7 @@ You have met the rate limit of Docker Hub. Learn more on [Understanding Docker H

### How to update the Nebula Console client

To update the Nebula Console client, run the following command.

```bash
docker pull vesoft/nebula-console:{{console.tag}}
```
The command `docker-compose pull` updates both the Nebula Graph services and the Nebula Console.

## Related documents

Expand Down