Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support docker-compose and update README #1429

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ HoraeDB 是一款高性能、分布式的云原生时序数据库。

## 快速开始
### 通过 Docker 运行
使用 Docker 运行单机版 HoraeDB
#### 使用 Docker 运行单机版 HoraeDB
```
docker run -d --name horaedb-server \
-p 8831:8831 \
Expand All @@ -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' \
Expand Down Expand Up @@ -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`
'
```

## 如何贡献

Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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.

```
Expand Down Expand Up @@ -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

Expand Down
46 changes: 46 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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