doc: add docker-compose guide and update deployment docs#455
doc: add docker-compose guide and update deployment docs#455bitflicker64 wants to merge 4 commits intoapache:masterfrom
Conversation
|
|
||
| - Docker Engine 20.10+ or Docker Desktop 4.x+ | ||
| - Docker Compose v2 | ||
| - For the 3-node cluster: at least **12 GB** memory allocated to Docker Desktop (Settings → Resources → Memory) |
There was a problem hiding this comment.
maybe we need minimum the memory usage? (12G → 4G?)
PS: like 1~3 server + 3pd + 3 store is fine for a test?
There was a problem hiding this comment.
During testing I hit OOM kills with 8GB in Docker Desktop which caused silent Raft failures so I bumped to 12GB and it worked, that's why I documented it. I haven't done any JVM heap tuning, containers are running with default settings. If the default heaps can be reduced for a test scenario that would help lower the requirement, happy to update the docs once we know a confirmed working lower limit.
|
BTW, we could only update the EN version during the review-period, then sync the CN version in the final stage |
|
Updated all EN files pinned HUGEGRAPH_VERSION=1.7.0 on all compose commands, updated image references from :latest to 1.7.0, and removed the stale clone workaround notes. CN sync can be done in the final stage. |
| @@ -1,4 +1,4 @@ | |||
| --- | |||
| cl--- | |||
There was a problem hiding this comment.
Pull request overview
Adds missing documentation for running HugeGraph’s Docker-based distributed cluster (bridge networking), and updates existing deployment quickstarts to reference the new Docker/compose guidance introduced in apache/hugegraph#2952.
Changes:
- Add new EN/CN “HugeGraph Docker Cluster Guide” pages with quickstarts, env var reference tables, ports, and troubleshooting.
- Update EN/CN HugeGraph-Server quickstart Docker section to reference
docker/compose files and include a cluster quickstart. - Add Docker deployment sections (with
HG_PD_*/HG_STORE_*env var tables) to the PD and Store quickstarts (EN/CN).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| content/en/docs/quickstart/hugegraph/hugegraph-server.md | Updates Docker links/compose guidance and adds a Docker cluster quickstart; removes inline compose example. |
| content/en/docs/quickstart/hugegraph/hugegraph-pd.md | Adds Docker deployment section and HG_PD_* env var reference. |
| content/en/docs/quickstart/hugegraph/hugegraph-hstore.md | Adds Docker deployment section and HG_STORE_* env var reference; adds Docker cluster quickstart notes. |
| content/en/docs/guides/hugegraph-docker-cluster.md | New EN standalone Docker cluster guide. |
| content/cn/docs/quickstart/hugegraph/hugegraph-server.md | CN mirror updates for Docker links/compose guidance plus cluster quickstart. |
| content/cn/docs/quickstart/hugegraph/hugegraph-pd.md | CN mirror Docker deployment section and env var reference. |
| content/cn/docs/quickstart/hugegraph/hugegraph-hstore.md | CN mirror Docker deployment section and cluster quickstart notes. |
| content/cn/docs/guides/hugegraph-docker-cluster.md | New CN standalone Docker cluster guide. |
Comments suppressed due to low confidence (2)
content/en/docs/quickstart/hugegraph/hugegraph-hstore.md:46
- The “Compile from source” instructions mention cloning the repo, but the actual
git clonecommand was removed. Please restore the clone step (or rewrite the section to clearly assume an existing working copy) so the build steps are complete.
```bash
# 1. Clone the source code
# 2. Build the project
cd hugegraph
mvn clean install -DskipTests=true
content/en/docs/quickstart/hugegraph/hugegraph-pd.md:45
- The “Compile from source” step says “# 1. Clone the source code” but no clone command is provided (it was removed), so the instructions can’t be followed as-is. Please add the appropriate
git clone+cdsteps or adjust the section text to match the intended workflow.
```bash
# 1. Clone the source code
# 2. Build the project
cd hugegraph
mvn clean install -DskipTests=true
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -38,7 +38,6 @@ cd apache-hugegraph-incubating-{version}/apache-hugegraph-pd-incubating-{version | |||
|
|
|||
| ```bash | |||
| # 1. Clone the source code | |||
There was a problem hiding this comment.
In “3.2 Compile from source”, step 1 says “Clone the source code” but the git clone https://github.com/apache/hugegraph.git command is missing, so the following cd hugegraph step can’t be followed as written. Please add the clone command back or adjust the steps.
| # 1. Clone the source code | |
| # 1. Clone the source code | |
| git clone https://github.com/apache/hugegraph.git |
| When using Docker, we can use Cassandra as the backend storage. We highly recommend using docker-compose directly to manage both the server and Cassandra. | ||
|
|
||
| The sample `docker-compose.yml` can be obtained on [GitHub](https://github.com/apache/hugegraph/blob/master/hugegraph-server/hugegraph-dist/docker/example/docker-compose-cassandra.yml), and you can start it with `docker-compose up -d`. (If using Cassandra 4.0 as the backend storage, it takes approximately two minutes to initialize. Please be patient.) | ||
| The sample `docker-compose.yml` can be obtained on [GitHub](https://github.com/apache/hugegraph/blob/master/hugegraph-server/hugegraph-dist/docker/example/docker-compose-cassandra.yml), and you can start it with `HUGEGRAPH_VERSION=1.7.0 docker-compose up -d`. (If using Cassandra 4.0 as the backend storage, it takes approximately two minutes to initialize. Please be patient.) | ||
|
|
||
| ```yaml |
There was a problem hiding this comment.
This section suggests starting the Cassandra compose with HUGEGRAPH_VERSION=1.7.0 ..., but the YAML shown below uses image: hugegraph/hugegraph (no ${HUGEGRAPH_VERSION} interpolation). As written, the env var won’t affect the compose run. Please either update the YAML to use ${HUGEGRAPH_VERSION} (or an explicit tag) or remove the HUGEGRAPH_VERSION=... prefix from the command.
|
|
||
| ```bash | ||
| cd docker | ||
| docker compose up -d |
There was a problem hiding this comment.
中文文档这里直接使用 docker compose up -d,但英文版同一段落使用了 HUGEGRAPH_VERSION=1.7.0 docker compose up -d 来固定镜像版本。建议两种语言保持一致:要么都显式指定版本(推荐),要么都说明默认会使用哪个版本/标签。
| docker compose up -d | |
| HUGEGRAPH_VERSION=1.7.0 docker compose up -d |
| ``` | ||
|
|
||
| Use `docker-compose up -d` to start the container | ||
| Use `HUGEGRAPH_VERSION=1.7.0 docker-compose up -d` to start the container |
There was a problem hiding this comment.
In the PRELOAD docker-compose example, the YAML already pins image: hugegraph/hugegraph:1.7.0, so prefixing the startup command with HUGEGRAPH_VERSION=1.7.0 is misleading (it won’t change the image). Please remove the env var from the command or change the YAML to reference ${HUGEGRAPH_VERSION}.
| Use `HUGEGRAPH_VERSION=1.7.0 docker-compose up -d` to start the container | |
| Use `docker-compose up -d` to start the container |
|
|
||
| ## Single-Node Quickstart | ||
|
|
||
| ```bash |
There was a problem hiding this comment.
The quickstart assumes the compose files already exist locally (cd hugegraph/docker), but earlier the doc only links to the GitHub docker/ directory. Please add an explicit step to obtain those files (e.g., git clone https://github.com/apache/hugegraph.git or a download instruction) so the commands work from a clean machine.
| ```bash | |
| ```bash | |
| git clone https://github.com/apache/hugegraph.git |
| HugeGraph-Store Docker 镜像已发布在 Docker Hub,镜像名为 `hugegraph/store:latest`。 | ||
|
|
||
| 使用 compose 文件部署完整的 3 节点集群(PD + Store + Server): |
There was a problem hiding this comment.
这里示例使用 hugegraph/store:latest 会导致部署不可复现,且与英文文档使用固定版本标签(如 :1.7.0)不一致。建议改用明确的发布版本标签,或在文档中强调 latest 仅用于开发/体验用途。
| @@ -39,7 +39,6 @@ cd apache-hugegraph-incubating-{version}/apache-hugegraph-hstore-incubating-{ver | |||
|
|
|||
| ```bash | |||
| # 1. Clone the source code | |||
There was a problem hiding this comment.
In “3.2 Compile from source”, step 1 says “Clone the source code” but the actual git clone https://github.com/apache/hugegraph.git command is missing, making the subsequent cd hugegraph step invalid. Please restore the clone command or rewrite the steps accordingly.
| # 1. Clone the source code | |
| # 1. Clone the source code | |
| git clone https://github.com/apache/hugegraph.git |
| HugeGraph-PD Docker 镜像已发布在 Docker Hub,镜像名为 `hugegraph/pd:latest`。 | ||
|
|
||
| 使用 compose 文件部署完整的 3 节点集群(PD + Store + Server): |
There was a problem hiding this comment.
这里示例使用 hugegraph/pd:latest 会导致部署不可复现(不同时间拉取到的镜像内容可能不同),且与英文文档使用固定版本标签(如 :1.7.0)不一致。建议改用明确的发布版本标签,或至少说明 latest 仅用于体验开发版。
|
|
||
| **容器 OOM 被杀(退出码 137)**:将 Docker Desktop 内存增加到 12 GB 以上。 | ||
|
|
||
| **Raft 选举超时**:检查所有 PD 节点的 `HG_PD_RAFT_PEERS_LIST` 是否一致。验证连通性:`docker exec hg-pd0 ping pd1` |
There was a problem hiding this comment.
故障排查里使用了 docker exec hg-pd0 ping pd1,但文档没有说明容器名一定是 hg-pd0。为避免依赖 container_name 约定,建议改为 docker compose exec pd0 ping pd1,或在文档中明确 compose 文件中实际的容器名。
| **Raft 选举超时**:检查所有 PD 节点的 `HG_PD_RAFT_PEERS_LIST` 是否一致。验证连通性:`docker exec hg-pd0 ping pd1` | |
| **Raft 选举超时**:检查所有 PD 节点的 `HG_PD_RAFT_PEERS_LIST` 是否一致。验证连通性:`docker compose exec pd0 ping pd1` |
Purpose of the PR
Follow-up documentation update for apache/hugegraph#2952 which migrated Docker cluster setup from
network_mode: hostto Docker bridge networking.Related PR: apache/hugegraph#2952
The doc repo had no wrong content — it simply never documented the Docker-based distributed cluster setup at all. This PR adds that missing documentation.
Main Changes
content/en/docs/guides/hugegraph-docker-cluster.md— new standalone Docker cluster guide covering single-node and 3-node setup, fullHG_*env var reference tables, port reference, health checks, and troubleshootingcontent/cn/docs/guides/hugegraph-docker-cluster.md— Chinese mirrorhugegraph-server.md(EN + CN) — fix Docker README URL, replace outdated inline compose yaml with references to newdocker/files, add 3-node cluster Docker quickstart inside section 5.1.1, add auth notehugegraph-pd.md(EN + CN) — add section 3.3 Docker Deployment withHG_PD_*env var reference tablehugegraph-hstore.md(EN + CN) — add section 3.3 Docker Deployment withHG_STORE_*env var reference table, add section 6.3 Docker cluster quickstart