Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster/dm: add gloabl listen_host #2303

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/dm/spec/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (c *DMMasterComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
Source: s.GetSource(),
Expand Down Expand Up @@ -304,6 +305,7 @@ func (c *DMWorkerComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
Source: s.GetSource(),
Expand Down
2 changes: 2 additions & 0 deletions embed/examples/cluster/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ global:
deploy_dir: "/tidb-deploy"
# # TiDB Cluster data storage directory
data_dir: "/tidb-data"
# # default listen_host for all components
listen_host: 0.0.0.0
# # Supported values: "amd64", "arm64" (default: "amd64")
arch: "amd64"
# # Resource Control is used to limit the resource of an instance.
Expand Down
2 changes: 2 additions & 0 deletions embed/examples/cluster/multi-dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ global:
deploy_dir: "/tidb-deploy"
# # TiDB Cluster data storage directory
data_dir: "/tidb-data"
# # default listen_host for all components
listen_host: 0.0.0.0
# # Supported values: "amd64", "arm64" (default: "amd64")
arch: "amd64"
# # Resource Control is used to limit the resource of an instance.
Expand Down
2 changes: 2 additions & 0 deletions embed/examples/cluster/topology.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ global:
deploy_dir: "/tidb-deploy"
# # TiDB Cluster data storage directory
data_dir: "/tidb-data"
# # default listen_host for all components
listen_host: 0.0.0.0
# # Supported values: "amd64", "arm64" (default: "amd64")
arch: "amd64"
# # Resource Control is used to limit the resource of an instance.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (c *AlertManagerComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: s.ListenHost,
ListenHost: utils.Ternary(s.ListenHost != "", s.ListenHost, c.Topology.BaseTopo().GlobalOptions.ListenHost).(string),
Port: s.WebPort,
SSHP: s.SSHPort,
NumaNode: s.NumaNode,
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (c *CDCComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
Source: s.GetSource(),
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func (c *DashboardComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
Source: s.Source,
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/drainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ func (c *DrainerComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
Source: s.GetSource(),
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/grafana.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (c *GrafanaComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
NumaNode: "",
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func (c *MonitorComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
NumaNode: s.NumaNode,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (c *PDComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: s.ListenHost,
ListenHost: utils.Ternary(s.ListenHost != "", s.ListenHost, c.Topology.BaseTopo().GlobalOptions.ListenHost).(string),
Port: s.ClientPort,
SSHP: s.SSHPort,
Source: s.GetSource(),
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/pump.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func (c *PumpComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
Source: s.GetSource(),
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type (
SSHPort int `yaml:"ssh_port,omitempty" default:"22" validate:"ssh_port:editable"`
SSHType executor.SSHType `yaml:"ssh_type,omitempty" default:"builtin"`
TLSEnabled bool `yaml:"enable_tls,omitempty"`
ListenHost string `yaml:"listen_host,omitempty" validate:"listen_host:editable"`
DeployDir string `yaml:"deploy_dir,omitempty" default:"deploy"`
DataDir string `yaml:"data_dir,omitempty" default:"data"`
LogDir string `yaml:"log_dir,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (c *TiDBComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: s.ListenHost,
ListenHost: utils.Ternary(s.ListenHost != "", s.ListenHost, c.Topology.BaseTopo().GlobalOptions.ListenHost).(string),
Port: s.Port,
SSHP: s.SSHPort,
Source: s.Source,
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/tiflash.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ func (c *TiFlashComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.GetMainPort(),
SSHP: s.SSHPort,
Source: s.GetSource(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/tikv.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (c *TiKVComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: s.ListenHost,
ListenHost: utils.Ternary(s.ListenHost != "", s.ListenHost, c.Topology.BaseTopo().GlobalOptions.ListenHost).(string),
Port: s.Port,
SSHP: s.SSHPort,
Source: s.Source,
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/tikv_cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (c *TiKVCDCComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
Source: s.GetSource(),
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/spec/tiproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func (c *TiProxyComponent) Instances() []Instance {
Name: c.Name(),
Host: s.Host,
ManageHost: s.ManageHost,
ListenHost: c.Topology.BaseTopo().GlobalOptions.ListenHost,
Port: s.Port,
SSHP: s.SSHPort,
Source: ComponentTiProxy,
Expand Down