Skip to content

Commit

Permalink
Don't set pd-server.metric-storage because it's designed to set by us…
Browse files Browse the repository at this point in the history
…er (#1020)

* Don't set pd-server.metric-storage because it's designed to set by user

* Fix ineffectual assignment

Co-authored-by: Ti Prow Robot <[email protected]>
  • Loading branch information
lucklove and ti-chi-bot committed Dec 31, 2020
1 parent 59d0415 commit 9a09d8b
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions pkg/cluster/spec/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/pingcap/tiup/pkg/logger/log"
"github.com/pingcap/tiup/pkg/meta"
"github.com/pingcap/tiup/pkg/utils"
"golang.org/x/mod/semver"
)

// PDSpec represents the PD topology specification in topology.yaml
Expand Down Expand Up @@ -170,10 +169,8 @@ func (i *PDInstance) InitConfig(
AppendEndpoints(topo.Endpoints(deployUser)...).
WithListenHost(i.GetListenHost())

scheme := "http"
if enableTLS {
scheme = "https"
cfg = cfg.WithScheme(scheme)
cfg = cfg.WithScheme("https")
}

fp := filepath.Join(paths.Cache, fmt.Sprintf("run_pd_%s_%d.sh", i.GetHost(), i.GetPort()))
Expand All @@ -188,15 +185,6 @@ func (i *PDInstance) InitConfig(
return err
}

// Set the PD metrics storage address
if semver.Compare(clusterVersion, "v3.1.0") >= 0 && len(topo.Monitors) > 0 {
if spec.Config == nil {
spec.Config = map[string]interface{}{}
}
prom := topo.Monitors[0]
spec.Config["pd-server.metric-storage"] = fmt.Sprintf("%s://%s:%d", scheme, prom.Host, prom.Port)
}

globalConfig := topo.ServerConfigs.PD
// merge config files for imported instance
if i.IsImported() {
Expand Down

0 comments on commit 9a09d8b

Please sign in to comment.