imbajin commented on code in PR #423: URL: https://github.com/apache/incubator-hugegraph-doc/pull/423#discussion_r2533203606
########## content/cn/docs/quickstart/computing/hugegraph-vermeer.md: ########## @@ -16,6 +16,144 @@ master 是负责通信、转发、汇总的节点,计算量和占用资源量 ### 1.2 运行方法 +1. **方案一:Docker Compose(推荐)** + +确保docker-compose.yaml存在于您的项目根目录中。如果没有,以下是一个示例: +```yaml +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +version: '3.8' + +services: + vermeer-master: + image: hugegraph/vermeer + container_name: vermeer-master + volumes: + - ~/:/go/bin/config # Change here to your actual config path + command: --env=master + networks: + vermeer_network: + ipv4_address: 172.20.0.10 # Assign a static IP for the master + + vermeer-worker: + image: hugegraph/vermeer + container_name: vermeer-worker + volumes: + - ~/:/go/bin/config # Change here to your actual config path + command: --env=worker + networks: + vermeer_network: + ipv4_address: 172.20.0.11 # Assign a static IP for the worker + +networks: + vermeer_network: + driver: bridge + ipam: + config: + - subnet: 172.20.0.0/24 # Define the subnet for your network +``` + +修改 docker-compose.yaml +- **Volume**:例如将两处 ~/:/go/bin/config 改为 /home/user/config:/go/bin/config(或您自己的配置目录)。 +- **Subnet**:根据实际情况修改子网IP。请注意,每个容器需要访问的端口在config文件中指定,具体请参照项目`config`文件夹下内容。 + +在项目目录构建镜像并启动(或者先用 docker build 再 docker-compose up) + +```shell +# 构建镜像(在项目根 vermeer 目录) +docker build -t hugegraph/vermeer . + +# 启动(在 vermeer 根目录) +docker-compose up -d +# 或使用新版 CLI: +# docker compose up -d +``` + +查看日志 / 停止 / 删除: + +```shell +docker-compose logs -f +docker-compose down +``` + +2. **方案二:通过 docker run 单独启动(手动创建网络并分配静态 IP)** + +确保CONFIG_DIR对Docker进程具有适当的读取/执行权限。 + +构建镜像: + +```shell +docker build -t hugegraph/vermeer . +``` + +创建自定义 bridge 网络(一次性操作): + +```shell +docker network create --driver bridge \ + --subnet 172.20.0.0/24 \ + vermeer_network +``` + +运行 master(调整 CONFIG_DIR 为您的绝对配置路径,可以根据实际情况调整IP): + +```shell +CONFIG_DIR=/home/user/config + +docker run -d \ Review Comment: ‼️ **docker run 命令缺少端口映射** 与 Docker Compose 类似,docker run 命令也没有映射端口,导致无法访问服务。需要添加 `-p` 参数: ```suggestion docker run -d \ --name vermeer-master \ --network vermeer_network --ip 172.20.0.10 \ -p 8688:8688 \ -v ${CONFIG_DIR}:/go/bin/config \ ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
