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 deployment and installation #646

Merged
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
@@ -1,22 +1,6 @@
# Deploy Nebula Graph with Docker Compose

There are multiple ways to deploy Nebula Graph, but using Docker Compose is usually considered to be faster and easier.

## Reading guide

If you are reading this topic with the questions listed below, click them to jump to their answers.

* [What do I need to do before deploying Nebula Graph?](#prerequisites)

* [How to fast deploy Nebula Graph with Docker Compose?](#how_to_deploy)

* [How to check the status and ports of the Nebula Graph services?](#check_the_nebula_graph_service_status_and_port)

* [How to check the data and logs of the Nebula Graph services?](#check_the_service_data_and_logs)

* [How to stop the Nebula Graph services?](#stop_the_nebula_graph_services)

* [What are the other ways to install Nebula Graph?](#other_ways_to_install_nebula_graph)
Using Docker Compose can quickly deploy Nebula Graph services based on the prepared configuration file. It is only recommended to use this method when testing functions of Nebula Graph.

## Prerequisites

Expand All @@ -28,7 +12,7 @@ If you are reading this topic with the questions listed below, click them to jum
| Docker Compose | Latest | [Install Docker Compose](https://docs.docker.com/compose/install/) |
| Git | Latest | [Download Git](https://git-scm.com/download/) |

* If you are deploying Nebula Graph as a non-root user, grant the user with Docker-related privileges. For detailed instructions, see [Docker document: Manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).
* If you are deploying Nebula Graph as a non-root user, grant the user with Docker-related privileges. For detailed instructions, see [Manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).

* You have started the Docker service on your host.

Expand All @@ -40,10 +24,10 @@ If you are reading this topic with the questions listed below, click them to jum

!!! danger

The `master` branch contains the untested code for the latest Nebula Graph development release. **DON'T** use this release for production.
The `master` branch contains the untested code for the latest Nebula Graph development release. **DO NOT** use this release in a production environment.

```bash
$ git clone -b master https://github.com/vesoft-inc/nebula-docker-compose.git
$ git clone -b v{{dockercompose.release}} https://github.com/vesoft-inc/nebula-docker-compose.git
```

2. Go to the `nebula-docker-compose` directory.
Expand All @@ -59,7 +43,7 @@ If you are reading this topic with the questions listed below, click them to jum
Update the [Nebula Graph images](#how-to-upgrade-nebula-graph-services) and [Nebula Console images](#how-to-update-the-nebula-console-client) first if they are out of date.

```bash
nebula-docker-compose]$ docker-compose up -d
[nebula-docker-compose]$ docker-compose up -d
Creating nebula-docker-compose_metad0_1 ... done
Creating nebula-docker-compose_metad2_1 ... done
Creating nebula-docker-compose_metad1_1 ... done
Expand All @@ -80,26 +64,26 @@ If you are reading this topic with the questions listed below, click them to jum
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).

```bash
$ docker run --rm -ti --network nebula-docker-compose_nebula-net --entrypoint=/bin/sh vesoft/nebula-console:v2-nightly
$ docker run --rm -ti --network nebula-docker-compose_nebula-net --entrypoint=/bin/sh vesoft/nebula-console:v2.5.0
```

!!! Note

The local network may be different from the `nebula-docker-compose_nebula-net` in the above example. Use the following command.

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

2. Connect to Nebula Graph with Nebula Console.

```bash
docker> nebula-console -u user -p password --address=graphd --port=9669
docker> nebula-console -u <user_name> -p <password> --address=graphd --port=9669
```

!!! Note
Expand All @@ -123,7 +107,7 @@ If you are reading this topic with the questions listed below, click them to jum
+-------------+------+----------+--------------+----------------------+------------------------+
```

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

## Check the Nebula Graph service status and ports

Expand Down Expand Up @@ -215,9 +199,15 @@ Removing nebula-docker-compose_metad1_1 ... done
Removing network nebula-docker-compose_nebula-net
```

!!! Note
!!! danger

The parameter `-v` in the command `docker-compose down -v` will **delete** all your local Nebula Graph storage data. Try this command if you are using the nightly release and having some compatibility issues.

Command `docker-compose down -v` will **delete** all your local Nebula Graph storage data. Try this command if you are using a developing/nightly version and having some compatibility issues.
## Modify configurations

The configuration file of Nebula Graph 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 All @@ -227,7 +217,7 @@ To set the `ports` of corresponding services as fixed mapping, modify the `docke

```bash
graphd:
image: vesoft/nebula-graphd:v2-nightly
image: vesoft/nebula-graphd:v2.5.0
...
ports:
- 9669:9669
Expand All @@ -254,7 +244,7 @@ You have met the rate limit of Docker Hub. Learn more on [Understanding Docker H
To update the Nebula Console client, run the following command.

```bash
docker pull vesoft/nebula-console:v2-nightly
docker pull vesoft/nebula-console:v2.5.0
```

### How to upgrade Nebula Graph services
Expand All @@ -267,6 +257,9 @@ To upgrade Nebula Graph, update the Nebula Graph docker images and restart the s

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

### Why can’t I connect to Nebula Graph via port `3699` after updating the nebula-docker-compose repository (Nebula Graph 2.0.0-RC)?

In Nebula Graph 2.0.0-RC release, the default port is changed from `3699` to `9669`. Please use port `9669` to connect to Nebula Graph, or modify the port in `docker-compose.yaml`.

### Why can't I access the data after updating the nebula-docker-compose repository? (Jan 4, 2021)

Expand Down
Loading