English | 中文
A distributed, scalable, lightning-fast graph database
Using Docker Compose is a convenient way to deploy and manage Nebula Graph.
- Prerequisites
- How to deploy
- Check the Nebula Graph service status and ports
- Check the service data and logs
- Stop the Nebula Graph Services
- Other Ways to Install Nebula Graph
- FAQ
- What to Do Next
-
You have installed Docker, Docker Compose, and Git on your host.
NOTE:
- To use Docker as a non-root user, follow the steps in Manage Docker as a non-root user.
- We recommend that you install the latest version of these applications to make sure they work properly.
-
You have started the Docker service on your host.
-
If you have already deployed another version of Nebula Graph with Docker Compose on your host, to avoid compatibility issues,back up the service data if you need, and delete the
nebula-docker-compose/data
directory.
-
Clone the
nebula-docker-compose
repository to your host with Git.- To install Nebula Graph 1.0, clone the
v1.0
branch.
$ git clone --branch v1.0 https://github.com/vesoft-inc/nebula-docker-compose.git
- To install Nebula Graph 2.0, clone the
master
branch.
$ git clone https://github.com/vesoft-inc/nebula-docker-compose.git
- To install Nebula Graph 1.0, clone the
-
Go to the
nebula-docker-compose
directory.$ cd nebula-docker-compose/
-
Run the following command to start all the Nebula Graph services.
$ docker-compose up -d
The following information indicates the services have started:
Creating nebula-docker-compose_metad2_1 ... done Creating nebula-docker-compose_metad1_1 ... done Creating nebula-docker-compose_metad0_1 ... done Creating nebula-docker-compose_storaged2_1 ... done Creating nebula-docker-compose_graphd_1 ... done Creating nebula-docker-compose_storaged0_1 ... done Creating nebula-docker-compose_storaged1_1 ... done
NOTE: For more information of the preceding services, see Design and Architecture of Nebula Graph.
-
Use nebula-console to connect to Nebula Graph.
Nebula-console is the native CLI client of Nebula Graph. In this step, Docker pulls the nebula-console images automatically from Docker Hub according to the path we set in the following commands and uses it to connect to the graphd service of Nebula Graph. You can use other clients to connect to Nebula Graph instead of Nebula-console, such as Nebula Graph Studio and clients for different programming languages.
- For Nebula Graph 1.0:
$ docker run --rm -ti --network=host vesoft/nebula-console:nightly -u <user> -p <password> --addr=127.0.0.1 --port=3699
- For Nebula Graph 2.0:
$ docker run --rm -ti --network nebula-docker-compose_nebula-net --entrypoint=/bin/sh vesoft/nebula-console:v2-nightly docker> nebula-console -u <user> -p <password> --address=graphd --port=9669
NOTE: By default, the authentication is disabled, and the
-u
and-p
options are unnecessary. To enbale authentication, see Authentication Configurations.The following information indicates that you have connected to the Nebula Graph services:
Welcome to Nebula Graph (Version 5d10861) ([email protected]) [(none)]>
Running the following command to list the service information of Nebula Graph, such as state and ports.
$ docker-compose ps
The following information is displayed:
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
nebula-docker-compose_graphd_1 ./bin/nebula-graphd --flag ... Up (health: starting) 0.0.0.0:32867->13000/tcp, 0.0.0.0:32866->13002/tcp, 3369/tcp, 0.0.0.0:3699->3699/tcp
nebula-docker-compose_metad0_1 ./bin/nebula-metad --flagf ... Up (health: starting) 0.0.0.0:32865->11000/tcp, 0.0.0.0:32864->11002/tcp, 45500/tcp, 45501/tcp
nebula-docker-compose_metad1_1 ./bin/nebula-metad --flagf ... Up (health: starting) 0.0.0.0:32863->11000/tcp, 0.0.0.0:32862->11002/tcp, 45500/tcp, 45501/tcp
nebula-docker-compose_metad2_1 ./bin/nebula-metad --flagf ... Up (health: starting) 0.0.0.0:32861->11000/tcp, 0.0.0.0:32860->11002/tcp, 45500/tcp, 45501/tcp
nebula-docker-compose_storaged0_1 ./bin/nebula-storaged --fl ... Up (health: starting) 0.0.0.0:32879->12000/tcp, 0.0.0.0:32877->12002/tcp, 44500/tcp, 44501/tcp
nebula-docker-compose_storaged1_1 ./bin/nebula-storaged --fl ... Up (health: starting) 0.0.0.0:32876->12000/tcp, 0.0.0.0:32872->12002/tcp, 44500/tcp, 44501/tcp
nebula-docker-compose_storaged2_1 ./bin/nebula-storaged --fl ... Up (health: starting) 0.0.0.0:32873->12000/tcp, 0.0.0.0:32870->12002/tcp, 44500/tcp, 44501/tcp
NOTE: Nebula Graph
graphd
services listen on the port3699
for v1.x and9669
for v2.x by default. You can change the default port according to network configurations.
All data and logs of Nebula Graph are stored persistently in the nebula-docker-compose/data
and nebula-docker-compose/logs
directories.
The structure of the directories is as follows:
nebula-docker-compose/
|-- docker-compose.yaml
|-- data
| |- meta0
| |- meta1
| |- meta2
| |- storage0
| |- storage1
| `- storage2
`-- logs
|- meta0
|- meta1
|- meta2
|- storage0
|- storage1
|- storage2
`- graph
You can run the following command to stop the Nebula Graph services:
$ docker-compose down -v
The following information indicates you have successfully stopped the Nebula Graph services:
Stopping nebula-docker-compose_storaged1_1 ... done
Stopping nebula-docker-compose_storaged0_1 ... done
Stopping nebula-docker-compose_graphd_1 ... done
Stopping nebula-docker-compose_storaged2_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_storaged1_1 ... done
Removing nebula-docker-compose_storaged0_1 ... done
Removing nebula-docker-compose_graphd_1 ... done
Removing nebula-docker-compose_storaged2_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
Q: How to update the nebula-console client?
A: To update the nebula-console client, use the docker pull
command in the nebula-docker-compose
directory on your host. For example, if you want to update nebula-console for the Nebula Graph 1.0 series, run the follow command.
docker pull vesoft/nebula-console:nightly
If you want to update nebula-console for the Nebula Graph v2.0, run the following command instead.
docker pull vesoft/nebula-console:v2-nightly
You can start using Nebula Graph by creating spaces and inserting data. For more information, see Quick Start.