-
Notifications
You must be signed in to change notification settings - Fork 315
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
add listen_host for TiDB/TiKV/PD to specified the listen host #495
Conversation
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #495 +/- ##
==========================================
- Coverage 39.84% 39.06% -0.79%
==========================================
Files 201 205 +4
Lines 14847 15407 +560
==========================================
+ Hits 5916 6018 +102
- Misses 8072 8512 +440
- Partials 859 877 +18
Continue to review full report at Codecov.
|
pkg/cluster/meta/topology.go
Outdated
@@ -127,6 +127,7 @@ func AllComponentNames() (roles []string) { | |||
// TiDBSpec represents the TiDB topology specification in topology.yaml | |||
type TiDBSpec struct { | |||
Host string `yaml:"host"` | |||
ListenAddress string `yaml:"listen_address,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think listen_address
is a bad name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
em... Any suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call it listen_host
? (since Address should contain the port part)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Signed-off-by: crazycs520 <crazycs520@gmail.com>
… into add-listen-address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified that it works! Could you also open a PR for tiup playground
as well?
@crazycs520 Please update the documentation/examples for |
templates/scripts/run_tidb.sh.tpl
Outdated
@@ -24,6 +24,7 @@ exec env GODEBUG=madvdontneed=1 bin/tidb-server \ | |||
{{- end}} | |||
-P {{.Port}} \ | |||
--status="{{.StatusPort}}" \ | |||
--host="{{.ListenAddress}}" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add --status-host="{{.ListenAddress}}"
, too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in pingcap#495 and is already used for the --client-urls flag. This should resolve pingcap#337 and partially implement pingcap#691.
This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in #495 and is already used for the --client-urls flag. This should resolve #337 and partially implement #691. Co-authored-by: SIGSEGV <gnu.crazier@gmail.com> Co-authored-by: Ti Prow Robot <71242396+ti-community-prow-bot@users.noreply.github.com>
* Support host names in TLS certificates This commit updates TLS certificate generator to detect if IP address or host name was used as host value. If host name is detected field `DNSNames` of x509 SAN extenstion is used instead of `IPAddresses`. * https://en.wikipedia.org/wiki/Subject_Alternative_Name * https://tools.ietf.org/html/rfc5280#section-4.2.1.6 This contributes towards fixing #337. * Fix PD --peer-urls flag to use listen_host variable This commit updates run_pd.sh template to use `listen_host` for --peer-urls flag instead of `host`. This allows us to use server hostname instead of IP addresse. Without this change if PD service is declared using hostname it fails to start, reporting an error that it can not bind to given interface. Metadata variable `listen_host` was introduced in #495 and is already used for the --client-urls flag. This should resolve #337 and partially implement #691. * Switch to host names in integration tests This PR updates refactors integration tests to use host names instead of IP addresses. It resolves #337. All IP literals in the integration tests are replaced with host names `n1` to `n5`. This allows us to make integration test topology files immutable and remove extra topology file templating step. Extra topology file `full_scale_in_tidb_2nd.yaml` is introduced for second tidb scaling operation to avoid topology file mutation during the test. Using host names in the integration tests will help us to maintain compatibility with services declared using host names. There should be no extra maintenance to support using IP addresses. Co-authored-by: SIGSEGV <gnu.crazier@gmail.com>
Signed-off-by: crazycs520 crazycs520@gmail.com
What problem does this PR solve?
Before this PR, TiDB/TiKV will always listen to the
0.0.0.0
host, this PR addslisten_host
flag for PD/TiDB/TiKV to specify the listening address.If user doesn't specified the
listen_host
, PD/TiDB/TiKV will listen on0.0.0.0
defaultly.What is changed and how it works?
Check List
Tests