Skip to content

Commit

Permalink
[feat]: 3 broker + 3 storage cluster by docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingCrush committed Sep 5, 2021
1 parent e1e898e commit 9b561e6
Show file tree
Hide file tree
Showing 14 changed files with 230 additions and 144 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Expand Up @@ -15,7 +15,9 @@ cpu_profile
*.db

# config files
*.toml
broker.toml
storage.toml
standalone.toml

## Go
# Binaries for programs and plugins
Expand All @@ -30,6 +32,10 @@ cpu_profile
*mock.pb.go
*mock_test.go

# docker cluster
docker/broker*/
docker/storage*/

default.etcd
web/node_modules/
web/build/*
Expand Down
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

14 changes: 1 addition & 13 deletions README-zh_CN.md
Expand Up @@ -59,22 +59,10 @@ LinDB 目前在饿了么存储了全量的监控数据,每天增量写入 88TB
### 依赖

在本地编译 LinDB 需要以下工具:
- [Go >=1.14](https://golang.org/doc/install)
- [Go >=1.16](https://golang.org/doc/install)
- [Make tool](https://www.gnu.org/software/make/)
- [Yarn](https://classic.yarnpkg.com/en/docs/install)

### 环境设置

设置 Go path 与 PATH 环境变量,GOPATH 通常默认为 `$HOME/go`

```
# 将以下命令添加到 ~/.bashrc 或 ~/.bash_profile 文件中
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# 使用 source 命令使 bashrc 文件立刻生效
$ source ~/.bashrc
```

### 获取代码

Expand Down
15 changes: 1 addition & 14 deletions README.md
Expand Up @@ -59,23 +59,10 @@ Once we implement the final feature and replace the LinDB under production envir

To build LinDB from source you require the following on your system.

- [Go >=1.14](https://golang.org/doc/install)
- [Go >=1.16](https://golang.org/doc/install)
- [Make tool](https://www.gnu.org/software/make/)
- [Yarn](https://classic.yarnpkg.com/en/docs/install)

### Setup environment

Export GO path and system PATH to your environment. GOPATH typically defaults to `$HOME/go`.

```
# Add these to your ~/.bashrc or ~/.bash_profile file and save file.
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# Source bashrc to export to environment
$ source ~/.bashrc
```

### Get the code

```
Expand Down
49 changes: 0 additions & 49 deletions docker-compose.yml

This file was deleted.

53 changes: 0 additions & 53 deletions docker.sh

This file was deleted.

18 changes: 18 additions & 0 deletions docker/configs/broker1.toml
@@ -0,0 +1,18 @@
[coordinator]
namespace = "/lindb-cluster"
endpoints = ["http://etcd:2379"]

[broker]
[broker.http]
port = 9000

[broker.grpc]
port = 9001

[monitor]
report-interval = "10s"
url = "http://broker1:9000/api/native/write?db=_internal"

[logging]
dir = "/lindb/broker1"
level = "debug"
18 changes: 18 additions & 0 deletions docker/configs/broker2.toml
@@ -0,0 +1,18 @@
[coordinator]
namespace = "/lindb-cluster"
endpoints = ["http://etcd:2379"]

[broker]
[broker.http]
port = 9000

[broker.grpc]
port = 9001

[monitor]
report-interval = "10s"
url = "http://broker2:9000/api/native/write?db=_internal"

[logging]
dir = "/lindb/broker2"
level = "debug"
18 changes: 18 additions & 0 deletions docker/configs/broker3.toml
@@ -0,0 +1,18 @@
[coordinator]
namespace = "/lindb-cluster"
endpoints = ["http://etcd:2379"]

[broker]
[broker.http]
port = 9000

[broker.grpc]
port = 9001

[monitor]
report-interval = "10s"
url = "http://broker3:9000/api/native/write?db=_internal"

[logging]
dir = "/lindb/broker3"
level = "debug"
24 changes: 24 additions & 0 deletions docker/configs/storage1.toml
@@ -0,0 +1,24 @@
[coordinator]
namespace = "/lindb-cluster"
endpoints = ["http://etcd:2379"]

[storage]
indicator = 1

[storage.grpc]
port = 2891

[storage.wal]
dir = "/lindb/storage1/wal"

[storage.tsdb]
dir = "/lindb/storage1/data"

[monitor]
report-interval = "10s"
url = "http://broker1:9000/api/native/write?db=_internal"

[logging]
dir = "/lindb/storage1"
level = "debug"

24 changes: 24 additions & 0 deletions docker/configs/storage2.toml
@@ -0,0 +1,24 @@
[coordinator]
namespace = "/lindb-cluster"
endpoints = ["http://etcd:2379"]

[storage]
indicator = 2

[storage.grpc]
port = 2891

[storage.wal]
dir = "/lindb/storage2/wal"

[storage.tsdb]
dir = "/lindb/storage2/data"

[monitor]
report-interval = "10s"
url = "http://broker2:9000/api/native/write?db=_internal"

[logging]
dir = "/lindb/storage2"
level = "debug"

24 changes: 24 additions & 0 deletions docker/configs/storage3.toml
@@ -0,0 +1,24 @@
[coordinator]
namespace = "/lindb-cluster"
endpoints = ["http://etcd:2379"]

[storage]
indicator = 3

[storage.grpc]
port = 2891

[storage.wal]
dir = "/lindb/storage3/wal"

[storage.tsdb]
dir = "/lindb/storage3/data"

[monitor]
report-interval = "10s"
url = "http://broker3:9000/api/native/write?db=_internal"

[logging]
dir = "/lindb/storage3"
level = "debug"

2 changes: 2 additions & 0 deletions docker/create_database.sh
@@ -0,0 +1,2 @@

docker exec -it lindb_broker1 bash -c '/usr/bin/lind cli --config /lindb/configs/broker1.toml database-create _internal'

0 comments on commit 9b561e6

Please sign in to comment.