From 98f0bb475e207f1df3ce04f0cad40d0ee6dc1671 Mon Sep 17 00:00:00 2001
From: wey-gu <1651790+wey-gu@users.noreply.github.com>
Date: Thu, 4 Nov 2021 13:43:03 +0800
Subject: [PATCH] Add a nerdctl Compatible yaml file
Also introduced m1 macOS guide in FAQ
close #101
---
README.md | 41 +++++
README_zh-CN.md | 40 ++++
docker-compose-nerdctl.yaml | 358 ++++++++++++++++++++++++++++++++++++
3 files changed, 439 insertions(+)
create mode 100644 docker-compose-nerdctl.yaml
diff --git a/README.md b/README.md
index 01c2af5..e3115cb 100644
--- a/README.md
+++ b/README.md
@@ -27,3 +27,44 @@ Choose a nebula-docker-compose branch before you start. The following table list
| [`v2.5.0`](https://github.com/vesoft-inc/nebula-docker-compose/tree/v2.5.0) | `v2.5.0` of the nebula-graph repository | v.2.5.0 | [Deploy Nebula Graph with Docker Compose](https://github.com/vesoft-inc/nebula-docker-compose/blob/v2.5.0/README.md) |
| [`v2.0.0`](https://github.com/vesoft-inc/nebula-docker-compose/tree/v2.0.0) | `v2.0.0` of the nebula-graph repository | v.2.0.0-GA | [Deploy Nebula Graph with Docker Compose](https://github.com/vesoft-inc/nebula-docker-compose/blob/v2.0.0/README.md) |
| [`v1.0`](https://github.com/vesoft-inc/nebula-docker-compose/tree/v1.0) | `master` of the [nebula](https://github.com/vesoft-inc/nebula) repository | The latest development
version of v1.x | [Deploy Nebula Graph with Docker Compose](https://github.com/vesoft-inc/nebula-docker-compose/blob/v1.0/README.md) |
+
+## FAQ
+
+### Running in M1 macOS
+
+If you are using Docker Desktop:
+
+```bash
+docker compose up -d
+```
+
+Alternatively, you could use [lima](https://github.com/lima-vm/lima):
+
+- Install lima with `brew install lima`
+- Start the lima VM with `limactl start`
+- Then you could use shell inside the lima VM with `lima ` like `lima uname -a`
+
+Then you could use `lima nerdctl` like `docker`:
+
+```bash
+rm -fr data logs
+mkdir -p data/{meta,storage}{0..2}/nebula logs/{meta,storage,graph}{0..2} logs/graph
+lima nerdctl --debug-full compose --file docker-compose-nerdctl.yaml up -d
+```
+
+To access the cluster from lima:
+
+```bash
+lima ./nebula-console-linux-arm64-v2.6.0 -addr host.lima.internal -port 9669 -user root -p password
+```
+
+### Running with nerdctl
+
+If you are running this compose file via [nerdctl](https://github.com/containerd/nerdctl), please use `docker-compose-nerdctl.yaml` instead:
+
+```bash
+mkdir -p data/{meta,storage}{0..2}/nebula logs/{meta,storage,graph}{0..2} logs/graph
+
+nerdctl compose --file docker-compose-nerdctl.yaml up -d
+```
+
diff --git a/README_zh-CN.md b/README_zh-CN.md
index 36522d5..122fa0f 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -29,3 +29,43 @@
| [`master`](https://github.com/vesoft-inc/nebula-docker-compose/tree/master) | [nebula-graph仓库](https://github.com/vesoft-inc/nebula-graph)的`master`分支 | 最新的v2.x开发版本 | [Docker Compose部署Nebula Graph](https://docs.nebula-graph.com.cn/2.0/2.quick-start/2.deploy-nebula-graph-with-docker-compose/) |
| [`v2.0.0`](https://github.com/vesoft-inc/nebula-docker-compose/tree/v2.0.0)(**推荐**) | nebula-graph仓库的`v2.0.0`分支 | v.2.0.0-GA | [Docker Compose部署Nebula Graph](https://github.com/vesoft-inc/nebula-docker-compose/blob/v2.0.0/README_zh-CN.md) |
| [`v1.0`](https://github.com/vesoft-inc/nebula-docker-compose/tree/v1.0) | [nebula](https://github.com/vesoft-inc/nebula)仓库的`master`分支 | 最新的v1.x开发版本 | [Docker Compose部署Nebula Graph](https://github.com/vesoft-inc/nebula-docker-compose/blob/v1.0/README_zh-CN.md) |
+
+## FAQ
+
+### Running in M1 macOS
+
+如果您使用 Docker Desktop,只需要执行:
+
+```bash
+docker compose up -d
+```
+
+或者,如果您想使用 [lima](https://github.com/lima-vm/lima):
+
+- 安装 lima `brew install lima`
+- 启动 lima VM `limactl start`
+- 然后您可以在 lima VM 中执行指令: `lima ` ,比如 `lima uname -a`
+
+- 在这之后,就可以用 `lima nerdctl` 替代 `docker` 这个命令行了,值得注意的是因为这里用的是 `nerdctl` 而不是 docker-compose,需要引用 `docker-compose-nerdctl.yaml`。
+
+```bash
+rm -fr data logs
+mkdir -p data/{meta,storage}{0..2}/nebula logs/{meta,storage,graph}{0..2} logs/graph
+lima nerdctl compose --file docker-compose-nerdctl.yaml up -d
+```
+
+- 从 lima VM 里用 console 接入 nebula:
+
+```bash
+lima ./nebula-console-linux-arm64-v2.6.0 -addr host.lima.internal -port 9669 -user root -p password
+```
+
+### Running with nerdctl
+
+如果您使用 [nerdctl](https://github.com/containerd/nerdctl),可以用下边的兼容的 yaml 文件,这个情况下需要先创建 data、logs 目录。
+
+```bash
+mkdir -p data/{meta,storage}{0..2}/nebula logs/{meta,storage,graph}{0..2} logs/graph
+
+nerdctl compose --file docker-compose-nerdctl.yaml up -d
+```
diff --git a/docker-compose-nerdctl.yaml b/docker-compose-nerdctl.yaml
new file mode 100644
index 0000000..d1bc572
--- /dev/null
+++ b/docker-compose-nerdctl.yaml
@@ -0,0 +1,358 @@
+version: '3.4'
+services:
+ metad0:
+ image: vesoft/nebula-metad:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --local_ip=metad0
+ - --ws_ip=metad0
+ - --port=9559
+ - --ws_http_port=19559
+ - --data_path=/data/meta
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://metad0:19559/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "9559:9559"
+ - "19559:19559"
+ - "19560:19560"
+ volumes:
+ - type: bind
+ source: ./data/meta0
+ target: /data/meta
+ - type: bind
+ source: ./logs/meta0
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+ metad1:
+ image: vesoft/nebula-metad:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --local_ip=metad1
+ - --ws_ip=metad1
+ - --port=9559
+ - --ws_http_port=19559
+ - --data_path=/data/meta
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://metad1:19559/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "29559:9559"
+ - "39559:19559"
+ - "39560:19560"
+ volumes:
+ - type: bind
+ source: ./data/meta1
+ target: /data/meta
+ - type: bind
+ source: ./logs/meta1
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+ metad2:
+ image: vesoft/nebula-metad:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --local_ip=metad2
+ - --ws_ip=metad2
+ - --port=9559
+ - --ws_http_port=19559
+ - --data_path=/data/meta
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://metad2:19559/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "49559:9559"
+ - "59559:19559"
+ - "59560:19560"
+ volumes:
+ - type: bind
+ source: ./data/meta0
+ target: /data/meta
+ - type: bind
+ source: ./logs/meta0
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+ storaged0:
+ image: vesoft/nebula-storaged:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --local_ip=storaged0
+ - --ws_ip=storaged0
+ - --port=9779
+ - --ws_http_port=19779
+ - --data_path=/data/storage
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ depends_on:
+ - metad0
+ - metad1
+ - metad2
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "9779:9779"
+ - "19779:19779"
+ - "19780:19780"
+ volumes:
+ - type: bind
+ source: ./data/storage0
+ target: /data/storage
+ - type: bind
+ source: ./logs/storage0
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+ storaged1:
+ image: vesoft/nebula-storaged:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --local_ip=storaged1
+ - --ws_ip=storaged1
+ - --port=9779
+ - --ws_http_port=19779
+ - --data_path=/data/storage
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ depends_on:
+ - metad0
+ - metad1
+ - metad2
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://storaged1:19779/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "29779:9779"
+ - "39779:19779"
+ - "39780:19780"
+ volumes:
+ - type: bind
+ source: ./data/storage1
+ target: /data/storage
+ - type: bind
+ source: ./logs/storage1
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+ storaged2:
+ image: vesoft/nebula-storaged:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --local_ip=storaged2
+ - --ws_ip=storaged2
+ - --port=9779
+ - --ws_http_port=19779
+ - --data_path=/data/storage
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ depends_on:
+ - metad0
+ - metad1
+ - metad2
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://storaged2:19779/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "49779:9779"
+ - "59779:19779"
+ - "59780:19780"
+ volumes:
+ - type: bind
+ source: ./data/storage2
+ target: /data/storage
+ - type: bind
+ source: ./logs/storage2
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+ graphd:
+ image: vesoft/nebula-graphd:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --port=9669
+ - --local_ip=graphd
+ - --ws_ip=graphd
+ - --ws_http_port=19669
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ depends_on:
+ - storaged0
+ - storaged1
+ - storaged2
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://graphd:19669/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "9669:9669"
+ - "19669:19669"
+ - "19670:19670"
+ volumes:
+ - type: bind
+ source: ./logs/graph
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+ graphd1:
+ image: vesoft/nebula-graphd:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --port=9669
+ - --local_ip=graphd1
+ - --ws_ip=graphd1
+ - --ws_http_port=19669
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ depends_on:
+ - storaged0
+ - storaged1
+ - storaged2
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://graphd1:19669/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "29669:9669"
+ - "39669:19669"
+ - "39670:19670"
+ volumes:
+ - type: bind
+ source: ./logs/graph1
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+ graphd2:
+ image: vesoft/nebula-graphd:nightly
+ environment:
+ USER: root
+ TZ: "${TZ}"
+ command:
+ - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
+ - --port=9669
+ - --local_ip=graphd2
+ - --ws_ip=graphd2
+ - --ws_http_port=19669
+ - --log_dir=/logs
+ - --v=0
+ - --minloglevel=0
+ depends_on:
+ - storaged0
+ - storaged1
+ - storaged2
+ healthcheck:
+ test: ["CMD", "curl", "-sf", "http://graphd2:19669/status"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 20s
+ ports:
+ - "49669:9669"
+ - "59669:19669"
+ - "59670:19670"
+ volumes:
+ - type: bind
+ source: ./logs/graph2
+ target: /logs
+ networks:
+ - nebula-net
+ restart: on-failure
+ cap_add:
+ - SYS_PTRACE
+
+networks:
+ nebula-net: