Skip to content

Commit

Permalink
[ISSUE arana-db#62] Feat configcenter (arana-db#120)
Browse files Browse the repository at this point in the history
* refactor: 配置中心模块重构

* feat: 添加etcd & file的配置存储实现

* feat: feat issue arana-db#62

* feat: feat issue arana-db#62

* fix: fix pr comment

* fix: fix test fail

* style: fix import style

* fix: fix code style
  • Loading branch information
chuntaojun authored Apr 9, 2022
1 parent 0d4ce64 commit 5c1951b
Show file tree
Hide file tree
Showing 23 changed files with 1,524 additions and 1,087 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/coverage.txt

# Dependency directories (remove the comment below to include it)
# vendor/
vendor/
.idea/

.tmp/
Expand Down
2 changes: 1 addition & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var (
Short: "start arana",

Run: func(cmd *cobra.Command, args []string) {
provider := boot.NewFileProvider(configPath)
provider := boot.NewProvider(configPath)
if err := boot.Boot(context.Background(), provider); err != nil {
log.Fatal("start failed: %v", err)
return
Expand Down
7 changes: 7 additions & 0 deletions docker/conf/bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config:
name: file
options:
path: ./config.yaml
# name: etcd
# options:
# endpoints: "http://localhost:2382"
3 changes: 2 additions & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ services:
arana:
image: arana:latest
container_name: arana
command: sh -c "./arana start -c config.yaml"
command: sh -c "./arana start -c bootstrap.yaml"
networks:
- local
ports:
- "13306:13306"
volumes:
- ./conf/config.yaml:/app/config.yaml
- ./conf/bootstrap.yaml:/app/bootstrap.yaml
depends_on:
- mysql
networks:
Expand Down
10 changes: 9 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,34 @@ require (
github.com/arana-db/parser v0.2.1
github.com/bwmarrin/snowflake v0.3.0
github.com/cespare/xxhash/v2 v2.1.2
github.com/creasty/defaults v1.5.2 // indirect
github.com/dop251/goja v0.0.0-20220102113305-2298ace6d09d
github.com/dubbogo/gost v1.11.23-0.20220113102152-a2ef9b809a45
github.com/ghodss/yaml v1.0.0
github.com/go-sql-driver/mysql v1.6.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.5.0
github.com/google/go-cmp v0.5.6 // indirect
github.com/hashicorp/golang-lru v0.5.4
github.com/kr/pretty v0.3.0 // indirect
github.com/lestrrat-go/strftime v1.0.5
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/olekukonko/tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/prometheus/common v0.28.0 // indirect
github.com/rogpeppe/go-internal v1.8.0 // indirect
github.com/spf13/cobra v1.2.1
github.com/stretchr/testify v1.7.0
github.com/testcontainers/testcontainers-go v0.12.0
github.com/tidwall/gjson v1.14.0
go.etcd.io/etcd/api/v3 v3.5.1
go.etcd.io/etcd/client/v3 v3.5.0
go.etcd.io/etcd/server/v3 v3.5.0-alpha.0
go.uber.org/atomic v1.9.0
go.uber.org/zap v1.19.1
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/net v0.0.0-20211108170745-6635138e15ea
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247 // indirect
google.golang.org/grpc v1.42.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)
47 changes: 33 additions & 14 deletions go.sum

Large diffs are not rendered by default.

Loading

0 comments on commit 5c1951b

Please sign in to comment.