Skip to content

Commit

Permalink
Utilize TiKV --advertise-status-addr (#951)
Browse files Browse the repository at this point in the history
Fix #892
  • Loading branch information
lucklove authored Dec 3, 2020
1 parent 4e336b2 commit a290d33
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pkg/cluster/embed/autogen_pkger.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func init() {
autogenFiles["/templates/scripts/run_pump.sh.tpl"] = "IyEvYmluL2Jhc2gKc2V0IC1lCgojIFdBUk5JTkc6IFRoaXMgZmlsZSB3YXMgYXV0by1nZW5lcmF0ZWQuIERvIG5vdCBlZGl0IQojICAgICAgICAgIEFsbCB5b3VyIGVkaXQgbWlnaHQgYmUgb3ZlcndyaXR0ZW4hCkRFUExPWV9ESVI9e3suRGVwbG95RGlyfX0KCmNkICIke0RFUExPWV9ESVJ9IiB8fCBleGl0IDEKCnt7LSBkZWZpbmUgIlBETGlzdCJ9fQogIHt7LSByYW5nZSAkaWR4LCAkcGQgOj0gLn19CiAgICB7ey0gaWYgZXEgJGlkeCAwfX0KICAgICAge3stICRwZC5TY2hlbWV9fTovL3t7JHBkLklQfX06e3skcGQuQ2xpZW50UG9ydH19CiAgICB7ey0gZWxzZSAtfX0KICAgICAgLHt7LSAkcGQuU2NoZW1lfX06Ly97eyRwZC5JUH19Ont7JHBkLkNsaWVudFBvcnR9fQogICAge3stIGVuZH19CiAge3stIGVuZH19Cnt7LSBlbmR9fQoKe3stIGlmIC5OdW1hTm9kZX19CmV4ZWMgbnVtYWN0bCAtLWNwdW5vZGViaW5kPXt7Lk51bWFOb2RlfX0gLS1tZW1iaW5kPXt7Lk51bWFOb2RlfX0gYmluL3B1bXAgXAp7ey0gZWxzZX19CmV4ZWMgYmluL3B1bXAgXAp7ey0gZW5kfX0Ke3stIGlmIC5Ob2RlSUR9fQogICAgLS1ub2RlLWlkPSJ7ey5Ob2RlSUR9fSIgXAp7ey0gZW5kfX0KICAgIC0t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ZpY2VOYW1lfX0uc2gKe3stIGlmIGVxIC5TZXJ2aWNlTmFtZSAicHJvbWV0aGV1cyJ9fQpFeGVjUmVsb2FkPS9iaW4va2lsbCAtSFVQICRNQUlOUElECnt7ZW5kfX0KCnt7LSBpZiAuUmVzdGFydH19ClJlc3RhcnQ9e3suUmVzdGFydH19Cnt7ZWxzZX19ClJlc3RhcnQ9YWx3YXlzCnt7ZW5kfX0KUmVzdGFydFNlYz0xNXMKe3stIGlmIC5EaXNhYmxlU2VuZFNpZ2tpbGx9fQpTZW5kU0lHS0lMTD1ubwp7ey0gZW5kfX0KCltJbnN0YWxsXQpXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldAo="
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/tikv.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func (i *TiKVInstance) InitConfig(
enableTLS := topo.GlobalOptions.TLSEnabled
spec := i.InstanceSpec.(TiKVSpec)
cfg := scripts.NewTiKVScript(
clusterVersion,
i.GetHost(),
paths.Deploy,
paths.Data[0],
Expand Down
39 changes: 23 additions & 16 deletions pkg/cluster/template/scripts/tikv.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,37 @@ import (
"text/template"

"github.com/pingcap/tiup/pkg/cluster/embed"
"golang.org/x/mod/semver"
)

const (
advertiseStatusAddrSupportedFrom = "v4.0.1"
)

// TiKVScript represent the data to generate TiKV config
type TiKVScript struct {
IP string
ListenHost string
Port int
StatusPort int
DeployDir string
DataDir string
LogDir string
NumaNode string
Endpoints []*PDScript
IP string
ListenHost string
Port int
StatusPort int
DeployDir string
DataDir string
LogDir string
SupportAdvertiseStatusAddr bool
NumaNode string
Endpoints []*PDScript
}

// NewTiKVScript returns a TiKVScript with given arguments
func NewTiKVScript(ip, deployDir, dataDir, logDir string) *TiKVScript {
func NewTiKVScript(version, ip, deployDir, dataDir, logDir string) *TiKVScript {
return &TiKVScript{
IP: ip,
Port: 20160,
StatusPort: 20180,
DeployDir: deployDir,
DataDir: dataDir,
LogDir: logDir,
IP: ip,
Port: 20160,
StatusPort: 20180,
DeployDir: deployDir,
DataDir: dataDir,
LogDir: logDir,
SupportAdvertiseStatusAddr: semver.Compare(version, advertiseStatusAddrSupportedFrom) >= 0,
}
}

Expand Down
3 changes: 3 additions & 0 deletions templates/scripts/run_tikv.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ exec bin/tikv-server \
--addr "{{.ListenHost}}:{{.Port}}" \
--advertise-addr "{{.IP}}:{{.Port}}" \
--status-addr "{{.ListenHost}}:{{.StatusPort}}" \
{{- if .SupportAdvertiseStatusAddr}}
--advertise-status-addr "{{.IP}}:{{.StatusPort}}" \
{{- end}}
--pd "{{template "PDList" .Endpoints}}" \
--data-dir "{{.DataDir}}" \
--config conf/tikv.toml \
Expand Down
1 change: 1 addition & 0 deletions tests/tiup-cluster/script/cmd_subtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function cmd_subtest() {
# check the data dir of tikv
# it's ok to omit client type after deploy
tiup-cluster exec $name -N $ipprefix.101 --command "grep /home/tidb/deploy/tikv-20160/data /home/tidb/deploy/tikv-20160/scripts/run_tikv.sh"
tiup-cluster exec $name -N $ipprefix.101 --command "grep advertise-status-addr /home/tidb/deploy/tikv-20160/scripts/run_tikv.sh"
tiup-cluster exec $name -N $ipprefix.103 --command "grep /home/tidb/my_kv_data /home/tidb/deploy/tikv-20160/scripts/run_tikv.sh"

# test patch overwrite
Expand Down

0 comments on commit a290d33

Please sign in to comment.