This is an automated email from the ASF dual-hosted git repository.
chunshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-horaedb.git
The following commit(s) were added to refs/heads/main by this push:
new 834aca0f feat: support docker-compose and update README (#1429)
834aca0f is described below
commit 834aca0f814085db20948fed634e78c2e4fd90bc
Author: chunshao.rcs <[email protected]>
AuthorDate: Mon Jan 8 10:14:18 2024 +0800
feat: support docker-compose and update README (#1429)
## Rationale
Start horaedb cluster with docker-compose.
## Detailed Changes
Support docker-compose and update README.
## Test Plan
Manual test.
---------
Co-authored-by: CooooolFrog <[email protected]>
---
README-CN.md | 23 ++++++++++++++++++++---
README.md | 23 ++++++++++++++++++++---
docker/docker-compose.yaml | 46 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+), 6 deletions(-)
diff --git a/README-CN.md b/README-CN.md
index 0f428af4..37d73b1f 100644
--- a/README-CN.md
+++ b/README-CN.md
@@ -16,7 +16,7 @@ HoraeDB 是一款高性能、分布式的云原生时序数据库。
## 快速开始
### 通过 Docker 运行
-使用 Docker 运行单机版 HoraeDB
+#### 使用 Docker 运行单机版 HoraeDB
```
docker run -d --name horaedb-server \
-p 8831:8831 \
@@ -25,6 +25,17 @@ docker run -d --name horaedb-server \
ghcr.io/apache/horaedb-server:nightly-20231222-f57b3827
```
+#### 使用 docker compose 运行集群,包含两个 horaedb 节点和一个 horaemeta 节点
+
+```
+docker compose -f docker/docker-compose.yaml up
+```
+
+### 通过源码编译运行
+详见[文档](https://horaedb.apache.org/dev/compile_run.html)。
+
+### 基本操作
+
创建表
```
curl --location --request POST 'http://127.0.0.1:5440/sql' \
@@ -57,8 +68,14 @@ SELECT * FROM `demo`
'
```
-### 通过源码编译运行
-详见[文档](https://horaedb.apache.org/dev/compile_run.html)。
+删除表
+
+```
+curl --location --request POST 'http://127.0.0.1:5440/sql' \
+-d '
+Drop TABLE `demo`
+'
+```
## 如何贡献
diff --git a/README.md b/README.md
index 86b3678c..ffecaee8 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ HoraeDB is a high-performance, distributed, cloud native
time-series database.
### Run with Docker
-Run HoraeDB standalone Server.
+#### Run HoraeDB standalone Server
```
docker run -d --name horaedb-server \
@@ -29,6 +29,17 @@ docker run -d --name horaedb-server \
ghcr.io/apache/horaedb-server:nightly-20231222-f57b3827
```
+#### Run HoraeDB cluster with two horaedb-server node and one horaemeta-server
node.
+
+```
+docker compose -f docker/docker-compose.yaml up
+```
+
+### Run from source code
+
+See details [here](https://horaedb.apache.org/dev/compile_run.html).
+
+### Create Table and Write/Read data
Create Table.
```
@@ -64,9 +75,15 @@ SELECT * FROM `demo`
'
```
-### Run from source code
+Drop table.
+
+```
+curl --location --request POST 'http://127.0.0.1:5440/sql' \
+-d '
+Drop TABLE `demo`
+'
+```
-See details [here](https://horaedb.apache.org/dev/compile_run.html).
## Contributing
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
new file mode 100644
index 00000000..00a028ae
--- /dev/null
+++ b/docker/docker-compose.yaml
@@ -0,0 +1,46 @@
+version: '2'
+
+services:
+ horaemeta:
+ image: ghcr.io/apache/horaemeta-server:nightly-20240103-24322bc7
+ ports:
+ - "2379:2379"
+ volumes:
+ - ../docs/example-standalone.toml:/etc/horaemeta/horaemeta.toml
+ healthcheck:
+ test: [ "CMD-SHELL", "curl 0:2379" ]
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+ horaedb0:
+ image: ghcr.io/apache/horaedb-server:nightly-20240105-bd737b24
+ restart: always
+ ports:
+ - "8831:8831"
+ - "5440:5440"
+ volumes:
+ - ../docs/example-cluster-0.toml:/etc/horaedb/horaedb.toml
+ environment:
+ - HORAEDB_SERVER_ADDR=horaedb0
+ - HORAEMETA_SERVER_ADDR=http://horaemeta:2379
+ - ETCD_ADDRS=http://horaemeta:2379
+ depends_on:
+ horaemeta:
+ condition: service_healthy
+
+ horaedb1:
+ image: ghcr.io/apache/horaedb-server:nightly-20240105-bd737b24
+ restart: always
+ ports:
+ - "8832:8832"
+ - "5441:5441"
+ volumes:
+ - ../docs/example-cluster-1.toml:/etc/horaedb/horaedb.toml
+ environment:
+ - HORAEDB_SERVER_ADDR=horaedb1
+ - HORAEMETA_SERVER_ADDR=http://horaemeta:2379
+ - ETCD_ADDRS=http://horaemeta:2379
+ depends_on:
+ horaemeta:
+ condition: service_healthy
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]