HugeGraph Docker Cluster Guide

Overview

HugeGraph can quickly run a full distributed deployment (PD + Store + Server) with Docker Compose. This works on Linux and Mac.

Prerequisites

  • Docker Engine 20.10+ or Docker Desktop 4.x+
  • Docker Compose v2
  • For a 3-node cluster on Mac: allocate at least 12 GB memory (Settings → Resources → Memory). Adjust this on other platforms as needed.

Tested environments: Linux (native Docker) and macOS (Docker Desktop with ARM M4).

Compose Files

Three compose files are available in the docker/ directory of the HugeGraph main repository:

FileDescription
docker-compose.ymlQuickstart for a single-host deployment using pre-built images
docker-compose.dev.ymlDevelopment mode for a single-host deployment built from source
docker-compose-3pd-3store-3server.ymlDistributed cluster with 3 PD, 3 Store, and 3 Server processes

Note: The following steps assume you have already cloned or pulled the HugeGraph main repository locally, or at least have its docker/ directory available.

Single-Node Quickstart

cd hugegraph/docker
# Keep the version aligned with the latest release, for example 1.x.0
HUGEGRAPH_VERSION=1.7.0 docker compose up -d

Verify:

curl http://localhost:8080/versions

3-Node Cluster Quickstart

cd hugegraph/docker
HUGEGRAPH_VERSION=1.7.0 docker compose -f docker-compose-3pd-3store-3server.yml up -d

Built-in startup ordering:

  1. PD nodes start first and must pass the /v1/health check
  2. Store nodes start only after all PD nodes are healthy
  3. Server nodes start last, after all PD and Store nodes are healthy

Verify that the cluster is healthy:

curl http://localhost:8620/v1/health      # PD health
curl http://localhost:8520/v1/health      # Store health
curl http://localhost:8080/versions        # Server
curl http://localhost:8620/v1/stores       # Registered stores
curl http://localhost:8620/v1/partitions   # Partition assignment

Environment Variable Reference

PD Variables

VariableRequiredDefaultMaps To
HG_PD_GRPC_HOSTYesgrpc.host
HG_PD_RAFT_ADDRESSYesraft.address
HG_PD_RAFT_PEERS_LISTYesraft.peers-list
HG_PD_INITIAL_STORE_LISTYespd.initial-store-list
HG_PD_GRPC_PORTNo8686grpc.port
HG_PD_REST_PORTNo8620server.port
HG_PD_DATA_PATHNo/hugegraph-pd/pd_datapd.data-path
HG_PD_INITIAL_STORE_COUNTNo1pd.initial-store-count

Deprecated aliases: GRPC_HOSTHG_PD_GRPC_HOST, RAFT_ADDRESSHG_PD_RAFT_ADDRESS, RAFT_PEERSHG_PD_RAFT_PEERS_LIST

Store Variables

VariableRequiredDefaultMaps To
HG_STORE_PD_ADDRESSYespdserver.address
HG_STORE_GRPC_HOSTYesgrpc.host
HG_STORE_RAFT_ADDRESSYesraft.address
HG_STORE_GRPC_PORTNo8500grpc.port
HG_STORE_REST_PORTNo8520server.port
HG_STORE_DATA_PATHNo/hugegraph-store/storageapp.data-path

Deprecated aliases: PD_ADDRESSHG_STORE_PD_ADDRESS, GRPC_HOSTHG_STORE_GRPC_HOST, RAFT_ADDRESSHG_STORE_RAFT_ADDRESS

Server Variables

VariableRequiredDefaultMaps To
HG_SERVER_BACKENDYesbackend in hugegraph.properties
HG_SERVER_PD_PEERSYespd.peers
STORE_RESTNoused by wait-partition.sh
PASSWORDNoenables auth mode

Deprecated aliases: BACKENDHG_SERVER_BACKEND, PD_PEERSHG_SERVER_PD_PEERS

Port Reference

ServiceHost PortPurpose
pd08620REST API
pd08686gRPC
pd18621REST API
pd18687gRPC
pd28622REST API
pd28688gRPC
store08500gRPC
store08520REST API
store18501gRPC
store18521REST API
store28502gRPC
store28522REST API
server08080Graph API
server18081Graph API
server28082Graph API

Troubleshooting

  1. Containers exit due to OOM (exit code 137): Increase Docker Desktop memory to at least 12 GB, or reduce the JVM heap settings for the process that is being killed.

  2. Raft leader election timeout: Check that HG_PD_RAFT_PEERS_LIST is identical on all PD nodes. Verify connectivity with docker exec hg-pd0 ping pd1.

  3. Partition assignment does not complete: Check curl http://localhost:8620/v1/stores and confirm that all 3 stores show "state":"Up" before partition assignment can finish.

  4. Connection refused: Ensure HG_* environment variables use container hostnames (pd0, store0) instead of 127.0.0.1.

Viewing runtime logs: Use docker logs <container-name> (e.g. docker logs hg-pd0) to view logs directly without exec-ing into the container.