Skip to content

Commit

Permalink
fix: replace the remote configuration center apollo with the lighter …
Browse files Browse the repository at this point in the history
…weight etcd

- udates dependences version to the latest
  • Loading branch information
OldSmokeGun committed Mar 14, 2024
1 parent 36a7b9f commit 7ad9e46
Show file tree
Hide file tree
Showing 13 changed files with 467 additions and 1,496 deletions.
11 changes: 1 addition & 10 deletions deploy/docker-compose/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ APP_CONFIG_PATH=../../etc/config.yaml

#################### mysql ####################
MYSQL_TAG=latest
MYSQL_PORT=33066
MYSQL_PORT=3306
#################### mysql ####################

#################### postgres ####################
Expand All @@ -30,15 +30,6 @@ JAEGER_OTLP_GRPC_PORT=4317
JAEGER_OTLP_HTTP_PORT=4318
#################### jaeger ####################

#################### apollo ####################
APOLLO_CONFIG_SERVICE_TAG=latest
APOLLO_CONFIG_SERVICE_PORT=8080
APOLLO_ADMIN_SERVICE_TAG=latest
APOLLO_ADMIN_SERVICE_PORT=8090
APOLLO_PORTAL_SERVICE_TAG=latest
APOLLO_PORTAL_SERVICE_PORT=8070
#################### apollo ####################

#################### etcd ####################
ETCD_TAG=3.5.4
ETCD_PORT=2379
Expand Down
426 changes: 0 additions & 426 deletions deploy/docker-compose/apollo/migrate/apolloconfigdb.sql

This file was deleted.

383 changes: 0 additions & 383 deletions deploy/docker-compose/apollo/migrate/apolloportaldb.sql

This file was deleted.

58 changes: 0 additions & 58 deletions deploy/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ services:
volumes:
- "./mysql/mysql.cnf:/etc/mysql/conf.d/mysql.cnf"
- "./mysql/data:/var/lib/mysql"
- "./apollo/migrate:/docker-entrypoint-initdb.d"
#################### mysql ####################

#################### postgres ####################
Expand Down Expand Up @@ -118,63 +117,6 @@ services:
- "./jaeger/data:/badger"
#################### jaeger ####################

#################### apollo ####################
apollo-configservice:
image: apolloconfig/apollo-configservice:${APOLLO_CONFIG_SERVICE_TAG}
networks:
go-scaffold:
aliases:
- apollo-configservice
depends_on:
- mysql
restart: always
environment:
SPRING_DATASOURCE_URL: "jdbc:mysql://mysql:3306/ApolloConfigDB?characterEncoding=utf8"
SPRING_DATASOURCE_USERNAME: "root"
SPRING_DATASOURCE_PASSWORD: "root"
EUREKA_INSTANCE_HOME_PAGE_URL: "http://apollo-configservice:8080"
ports:
- "${APOLLO_CONFIG_SERVICE_PORT}:8080"

apollo-adminservice:
image: apolloconfig/apollo-adminservice:${APOLLO_ADMIN_SERVICE_TAG}
networks:
go-scaffold:
aliases:
- apollo-adminservice
depends_on:
- mysql
- apollo-configservice
restart: always
environment:
SPRING_DATASOURCE_URL: "jdbc:mysql://mysql:3306/ApolloConfigDB?characterEncoding=utf8"
SPRING_DATASOURCE_USERNAME: "root"
SPRING_DATASOURCE_PASSWORD: "root"
EUREKA_INSTANCE_HOME_PAGE_URL: "http://apollo-adminservice:8090"
ports:
- "${APOLLO_ADMIN_SERVICE_PORT}:8090"

apollo-portal:
image: apolloconfig/apollo-portal:${APOLLO_PORTAL_SERVICE_TAG}
networks:
go-scaffold:
aliases:
- apollo-portal
depends_on:
- mysql
- apollo-configservice
- apollo-adminservice
restart: always
environment:
SPRING_DATASOURCE_URL: "jdbc:mysql://mysql:3306/ApolloPortalDB?characterEncoding=utf8"
SPRING_DATASOURCE_USERNAME: "root"
SPRING_DATASOURCE_PASSWORD: "root"
APOLLO_PORTAL_ENVS: "dev"
DEV_META: "http://apollo-configservice:8080"
ports:
- "${APOLLO_PORTAL_SERVICE_PORT}:8070"
#################### apollo ####################

#################### etcd ####################
etcd:
image: bitnami/etcd:${ETCD_TAG}
Expand Down
193 changes: 93 additions & 100 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,70 +1,73 @@
module go-scaffold

go 1.21
go 1.22

require (
entgo.io/ent v0.12.5
github.com/DATA-DOG/go-sqlmock v1.5.0
entgo.io/ent v0.13.1
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/bwmarrin/snowflake v0.3.0
github.com/casbin/casbin/v2 v2.77.2
github.com/casbin/casbin/v2 v2.84.1
github.com/casbin/ent-adapter v0.3.0
github.com/casbin/gorm-adapter/v3 v3.20.0
github.com/casbin/gorm-adapter/v3 v3.21.0
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/fatih/color v1.16.0
github.com/go-kratos/consul v0.1.5
github.com/go-kratos/kratos/contrib/config/apollo/v2 v2.0.0-20231122041305-e84cddeabddb
github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20231122041305-e84cddeabddb
github.com/go-kratos/kratos/v2 v2.7.1
github.com/go-kratos/kratos/contrib/config/etcd/v2 v2.0.0-20240311125537-f566bdc2e6ff
github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20240311125537-f566bdc2e6ff
github.com/go-kratos/kratos/v2 v2.7.2
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/go-redis/redis/v8 v8.11.5
github.com/go-redis/redismock/v8 v8.11.5
github.com/go-sql-driver/mysql v1.7.1
github.com/golang-jwt/jwt/v5 v5.1.0
github.com/google/uuid v1.4.0
github.com/google/wire v0.5.1-0.20220620021424-0675cdc9191c
github.com/hashicorp/consul/api v1.26.1
github.com/go-sql-driver/mysql v1.8.0
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/uuid v1.6.0
github.com/google/wire v0.6.0
github.com/hashicorp/consul/api v1.28.2
github.com/jackc/pgx v3.6.2+incompatible
github.com/labstack/echo/v4 v4.11.3
github.com/labstack/echo/v4 v4.11.4
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
github.com/mattn/go-sqlite3 v1.14.18
github.com/nyaruka/phonenumbers v1.2.1
github.com/mattn/go-sqlite3 v1.14.22
github.com/nyaruka/phonenumbers v1.3.3
github.com/olekukonko/tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/robfig/cron/v3 v3.0.1
github.com/rubenv/sql-migrate v1.5.2
github.com/samber/lo v1.38.1
github.com/segmentio/kafka-go v0.4.45
github.com/rubenv/sql-migrate v1.6.1
github.com/samber/lo v1.39.0
github.com/segmentio/kafka-go v0.4.47
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/swaggo/echo-swagger v1.4.1
github.com/swaggo/swag v1.16.2
go.etcd.io/etcd/client/v3 v3.5.10
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.46.1
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
go.opentelemetry.io/otel/trace v1.21.0
golang.org/x/time v0.4.0
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
gorm.io/driver/mysql v1.5.2
gorm.io/driver/postgres v1.5.4
gorm.io/driver/sqlite v1.5.4
gorm.io/gorm v1.25.5
gorm.io/plugin/dbresolver v1.5.0
github.com/swaggo/swag v1.16.3
go.etcd.io/etcd/client/v3 v3.5.12
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.49.0
go.opentelemetry.io/otel v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0
go.opentelemetry.io/otel/sdk v1.24.0
go.opentelemetry.io/otel/trace v1.24.0
golang.org/x/time v0.5.0
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
gorm.io/driver/mysql v1.5.4
gorm.io/driver/postgres v1.5.7
gorm.io/driver/sqlite v1.5.5
gorm.io/gorm v1.25.7
gorm.io/plugin/dbresolver v1.5.1
gorm.io/plugin/soft_delete v1.2.1
)

require (
ariga.io/atlas v0.15.0 // indirect
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
ariga.io/atlas v0.19.2 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.2.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apolloconfig/agollo/v4 v4.3.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/armon/go-metrics v0.5.3 // indirect
github.com/casbin/govaluate v1.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
Expand All @@ -73,109 +76,99 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/glebarez/sqlite v1.10.0 // indirect
github.com/glebarez/go-sqlite v1.22.0 // indirect
github.com/glebarez/sqlite v1.11.0 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-kratos/aegis v0.2.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-playground/assert/v2 v2.2.0 // indirect
github.com/go-openapi/inflect v0.21.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/form/v4 v4.2.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-hclog v1.6.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/hcl/v2 v2.20.0 // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/imdario/mergo v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect
github.com/jackc/pgconn v1.14.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jackc/pgx/v4 v4.18.1 // indirect
github.com/jackc/pgx/v5 v5.5.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
github.com/jackc/pgtype v1.14.2 // indirect
github.com/jackc/pgx/v4 v4.18.3 // indirect
github.com/jackc/pgx/v5 v5.5.5 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.3 // indirect
github.com/labstack/gommon v0.4.1 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/microsoft/go-mssqldb v1.6.0 // indirect
github.com/microsoft/go-mssqldb v1.7.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/viper v1.17.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/swaggo/files/v2 v2.0.0 // indirect
github.com/tidwall/gjson v1.17.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
github.com/zclconf/go-cty v1.14.3 // indirect
go.etcd.io/etcd/api/v3 v3.5.12 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.15.0 // indirect
google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240311173647-c811ad7063a7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/driver/sqlserver v1.5.2 // indirect
modernc.org/libc v1.34.9 // indirect
gorm.io/driver/sqlserver v1.5.3 // indirect
modernc.org/libc v1.44.1 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/sqlite v1.27.0 // indirect
modernc.org/sqlite v1.29.5 // indirect
)

replace (
github.com/armon/go-metrics v0.5.3 => github.com/hashicorp/go-metrics v0.5.3
github.com/imdario/mergo v1.0.0 => dario.cat/mergo v1.0.0
)
Loading

0 comments on commit 7ad9e46

Please sign in to comment.