Skip to content

Commit

Permalink
config enable multi etcd endpoint (cluster)
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Jul 9, 2021
1 parent f0777ca commit 9397b4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/config/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ func (t *remoteConfig) WatchChannel(rp viper.RemoteProvider) (<-chan *viper.Remo

func (t *remoteConfig) client() (*clientv3.Client, error) {
cfg := clientv3.Config{
Endpoints: []string{t.Endpoint()},
DialTimeout: time.Second * 5,
AutoSyncInterval: time.Second * 10,
Logger: log.Get().WithOptions(zap.IncreaseLevel(zapcore.ErrorLevel)),
Endpoints: strings.Split(t.Endpoint(), ","),
DialTimeout: time.Second * 5,
DialKeepAliveTime: time.Second * 10,
AutoSyncInterval: time.Second * 30,
Logger: log.Get().WithOptions(zap.IncreaseLevel(zapcore.ErrorLevel)),
}
if username := os.Getenv(core.EnvEtcdUser); username != "" {
cfg.Username = username
Expand Down

0 comments on commit 9397b4f

Please sign in to comment.