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
[Improvement-3690][common] Get the native IP policy problem (获取本机ip策略问题 ) #3695
[Improvement-3690][common] Get the native IP policy problem (获取本机ip策略问题 ) #3695
Conversation
Please add test case to make sure this will success run in github docker. |
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.
In my opinion, preferential selection of internal network IP may not be suitable for some scenarios. In some cases, we need to obtain external network IP. Therefore, it is recommended to set a switch. By default, internal network IP is selected, but users can specify whether to give priority to Obtain the external network IP.
这种情况可以考虑在内,我加一个快关吧。默认内网优先。如果开关开启就把这个策略关闭,还是加一个外网优先?之前取第一个的策略是不合理的。 |
考虑到有的云服务器只有一块外网网卡的情况,需要做一个兼容。 |
|
In fact, in the original design, users can display the specified ip For scenarios where there are real multiple network cards and IP coexistence between internal and external networks, you cannot work hard on the framework side, and users also need to do something. There is no near perfect solution 事实上,原有的设计上优先选取用户所配置的网卡。 对于多网卡,内外网IP共存的场景,不能只是框架在做努力,用户也需要做一些事。没有近乎完美的方案。 |
Our default plan is to choose the internal network first, and then the external network. The user can display the designated intranet or extranet. If the user shows that the external network is specified, an error will be reported directly if the external network is not available 我们默认方案优先选择内网,其次选择外网。用户可以显示指定选择内网或者外网。如果用户显示指定了外网,拿不到外网的情况下就直接报错 @qiaozhanwei hi,do you have any good advice |
+1
…------------------ 原始邮件 ------------------
发件人: CalvinKirs <notifications@github.com>
发送时间: 2020年9月9日 10:43
收件人: apache/incubator-dolphinscheduler <incubator-dolphinscheduler@noreply.github.com>
抄送: Yichao Yang <1048262223@qq.com>, Comment <comment@noreply.github.com>
主题: 回复:[apache/incubator-dolphinscheduler] [Improvement][COMMON-NetUtils] Get the native IP policy problem (获取本机ip策略问题 ) (#3695)
Our default plan is to choose the internal network first, and then the external network. The user can display the designated intranet or extranet. If the user shows that the external network is specified, an error will be reported directly if the external network is not available
我们默认方案优先选择内网,其次选择外网。用户可以显示指定选择内网或者外网。如果用户显示指定了外网,拿不到外网的情况下就直接报错 @qiaozhanwei hi,do you have any good advice
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@CalvinKirs CalvinKirs Development has been completed |
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/NetUtils.java
Outdated
Show resolved
Hide resolved
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.
looks good to me,please you review @dailidong @qiaozhanwei
Co-authored-by: Yichao Yang <1048262223@qq.com>
Please change the title to |
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.
LGTM
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
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.
+1
Tips
What is the purpose of the pull request
Improvement #3690
The current policy is to take the first one, but the first test is not fixed。This is my debug screenshot.
当前策略是取第一个,但是第一个测试下来也是不固定的,这个是我调试截图。
The problem is that on the server, the acquired IP is the external network card IP.External network control is more strict, so it is not a full port through. Therefore, it is recommended to get IP of Intranet card first.So make logical optimizations in your code.
遇到的问题是服务器上,获取的ip为外网网卡ip.外网控制比较严格,所以不是全端口打通。所以,建议优先获取内网网卡ip。
所以做出代码中的逻辑优化。