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

[Feature] Make StarRocks support FQDN #5127

Merged
merged 13 commits into from
Jun 6, 2022

Conversation

waittttting
Copy link
Contributor

@waittttting waittttting commented Apr 15, 2022

What type of PR is this:

  • bug
  • feature
  • enhancement
  • others

Which issues of this PR fixes :

Fixes #5527 #401

Problem Summary(Required):

StarRocks only supported IP before. Some users' network environments need to support FQDN.
You can refer to the following documentation to use FQDN in your StarRocks cluster
First, you need to configure all the FQDN information of the cluster in each machine's /etc/hosts file.
If you want to use FQDN to create a new cluster, you should do nothing, this feature will make cluster use fqdn automatically
And if you want to upgrade an old cluster, please follow the next steps.

Be change ip to fqdn

  1. BE Reboot directly after upgrading to the version that contains the feature
  2. FE Execute SQL
    alter system modify backend host "192.1.1.0" to "testFqdn"

Fe upgrade ip to fqdn

  • FE cluster upgrade with less than three followers is not supported
  • Change follower node first, then master node

How to follower's ip to fqdn?

  1. stop the node you want to change the IP to FQDN, wait for the alive state to be false
  2. Execute the following SQL
    alter system modify frontend host "127.1.1.0" to "sandbox16"
  3. After the FE is upgraded to the version that includes the feature
  4. restart the FE with sh bin/start_fe.sh --host_type=fqdn --daemon and wait for the FE alive state to be true

How to master's ip to fqdn?

When all the follower besides of the master in the cluster are upgraded, shut down the master and wait for the new master to be elected, and then restart the original master, wait it to be a follower and alive.
Then the new follower could be processed according to the above to upgrade ip to fqdn

Other:

this feature can help you start fe by using specified host type,just like sh bin/start_fe.sh --host_type=fqdn sh bin/start_fe.sh --host_type=ip

@waittttting waittttting changed the title Main fqdn Make StarRocks support FQDN Apr 16, 2022
@padmejin
Copy link
Contributor

Please add a more detailed description. This is an obvious change for the users, that is to say, all our users will notice that after this version released, their FQDN can be directly shown in the "show backends" result or on our dashboard, and that casually changing their FQDN will probably ends in a chaos for the whole cluster. Therefore we should explain our designs and trade-offs as clear as possible.

be/src/service/backend_options.cpp Outdated Show resolved Hide resolved
be/src/service/backend_options.cpp Outdated Show resolved Hide resolved
be/src/util/brpc_stub_cache.h Outdated Show resolved Hide resolved
be/src/util/brpc_stub_cache.h Outdated Show resolved Hide resolved
@chaoyli
Copy link
Contributor

chaoyli commented Apr 17, 2022

Create a issue related to this pull request.

@waittttting waittttting force-pushed the main-fqdn branch 2 times, most recently from 1c3a115 to 3cccdb1 Compare April 20, 2022 12:46
@gengjun-git
Copy link
Contributor

Remember to add user guide to https://github.com/StarRocks/docs.zh-cn

@chaoyli
Copy link
Contributor

chaoyli commented Apr 24, 2022

Why we must restart FE to change the IP:port to 'FQDN:port'?
It's not very friendly to users. The cluster online should avoid the restart as far as possible.

@waittttting
Copy link
Contributor Author

Why we must restart FE to change the IP:port to 'FQDN:port'? It's not very friendly to users. The cluster online should avoid the restart as far as possible.

As stated in the PR description, if the host is changed without restarting the cluster, it is a process with very many intermediate states, and the failure of any one step does not guarantee the consistency of the change, and the user may end up having to restart the cluster anyway

@waittttting waittttting force-pushed the main-fqdn branch 2 times, most recently from 8fbf157 to b22e52d Compare April 26, 2022 12:17
@chaoyli chaoyli changed the title Make StarRocks support FQDN [Feature] Make StarRocks support FQDN Apr 27, 2022
@waittttting waittttting force-pushed the main-fqdn branch 4 times, most recently from c9e474c to 855062a Compare April 29, 2022 03:15
@waittttting waittttting force-pushed the main-fqdn branch 3 times, most recently from 8aeda1d to 5b5068f Compare May 5, 2022 02:22
@waittttting
Copy link
Contributor Author

run starrocks_fe_unittest

@wanpengfei-git
Copy link
Collaborator

[FE PR Coverage check]

😍 pass : 221 / 275 (80.36%)

file detail

path covered line new line coverage
🔵 com/starrocks/alter/Alter.java 0 1 00.00%
🔵 com/starrocks/StarRocksFE.java 0 3 00.00%
🔵 com/starrocks/qe/DdlExecutor.java 0 1 00.00%
🔵 com/starrocks/alter/SystemHandler.java 4 7 57.14%
🔵 com/starrocks/alter/SchemaChangeHandler.java 4 7 57.14%
🔵 com/starrocks/persist/EditLog.java 3 5 60.00%
🔵 com/starrocks/server/NodeMgr.java 29 42 69.05%
🔵 com/starrocks/service/FrontendOptions.java 60 76 78.95%
🔵 com/starrocks/server/GlobalStateMgr.java 4 5 80.00%
🔵 com/starrocks/sql/analyzer/AlterSystemStmtAnalyzer.java 11 13 84.62%
🔵 com/starrocks/common/proc/FrontendsProcNode.java 7 8 87.50%
🔵 com/starrocks/system/SystemInfoService.java 42 48 87.50%
🔵 com/starrocks/analysis/ModifyFrontendAddressClause.java 8 9 88.89%
🔵 com/starrocks/analysis/ModifyBackendAddressClause.java 8 9 88.89%
🔵 com/starrocks/sql/parser/AstBuilder.java 6 6 100.00%
🔵 com/starrocks/common/proc/BackendsProcDir.java 1 1 100.00%
🔵 com/starrocks/sql/ast/AstVisitor.java 2 2 100.00%
🔵 com/starrocks/persist/Storage.java 11 11 100.00%
🔵 com/starrocks/system/Backend.java 2 2 100.00%
🔵 com/starrocks/catalog/BrokerMgr.java 1 1 100.00%
🔵 com/starrocks/common/util/NetUtils.java 11 11 100.00%
🔵 com/starrocks/system/Frontend.java 3 3 100.00%
🔵 com/starrocks/ha/BDBHA.java 3 3 100.00%
🔵 com/starrocks/alter/MaterializedViewHandler.java 1 1 100.00%

@gengjun-git gengjun-git merged commit aed944f into StarRocks:main Jun 6, 2022
@waittttting waittttting deleted the main-fqdn branch June 6, 2022 08:26
@waittttting waittttting restored the main-fqdn branch June 7, 2022 04:43
waittttting added a commit that referenced this pull request Jun 7, 2022
chaoyli pushed a commit that referenced this pull request Jun 7, 2022
imay pushed a commit that referenced this pull request Jun 7, 2022
abc982627271 pushed a commit to abc982627271/starrocks that referenced this pull request Jun 22, 2022
StarRocks only supported IP before. Some users' network environments need to support FQDN.
You can refer to the following documentation to use FQDN in your StarRocks cluster
First, you need to configure all the FQDN information of the cluster in each machine's /etc/hosts file.
If you want to use FQDN to create a new cluster,  you should do nothing, this feature will make cluster use fqdn automatically 
And if you want to upgrade an old cluster, please follow the next steps.

### **Be change ip to fqdn**
1. BE Reboot directly after upgrading to the version that contains the feature
2. FE Execute SQL
alter system modify backend host "192.1.1.0" to "testFqdn"

### **Fe upgrade ip to fqdn**
- FE cluster upgrade with less than three followers is not supported
- Change follower node first, then master node

**How to follower's ip to fqdn?**
1. stop the node you want to change the IP to FQDN, wait for the alive state to be false
2. Execute the following SQL
alter system modify frontend host "127.1.1.0" to "sandbox16"
3. After the FE is upgraded to the version that includes the feature
4. restart the FE with `sh bin/start_fe.sh --host_type=fqdn` --daemon and wait for the FE alive state to be true

**How to master's ip to fqdn?**

When all the follower besides of the master in the cluster are upgraded, shut down the master and wait for the new master to be elected, and then restart  the original master, wait it to be a follower and alive. 
Then the new follower could be processed according to the above to upgrade ip to fqdn

## Other:

this feature can help you start fe by using specified host type,just like `sh bin/start_fe.sh --host_type=fqdn` `sh bin/start_fe.sh --host_type=ip`
abc982627271 pushed a commit to abc982627271/starrocks that referenced this pull request Jun 22, 2022
jaogoy pushed a commit to jaogoy/starrocks that referenced this pull request Nov 15, 2023
Signed-off-by: EsoragotoSpirit <wanglichen@starrocks.com>
(cherry picked from commit c9f5695)

Co-authored-by: 絵空事スピリット <wanglichen@starrocks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make StarRocks support FQDN
8 participants