-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
support both ip address and hostname for service discovery service call #946 #950
Conversation
@@ -130,6 +131,14 @@ trait ProcessEngineConnLaunch extends EngineConnLaunch with Logging { | |||
var springConf = Map("spring.application.name" -> GovernanceCommonConf.ENGINE_CONN_SPRING_NAME.getValue, | |||
"server.port" -> engineConnPort, "spring.profiles.active" -> "engineconn", | |||
"logging.config" -> s"classpath:${EnvConfiguration.LOG4J2_XML_FILE.getValue}") ++: discoveryMsgGenerator.generate(engineConnManagerEnv) | |||
|
|||
//暂时通过判断engineConnManagerHost是否为IP地址来判断是否使用eureka.instance.prefer-ip-address,后续需要通过engineConnManagerEnv.properties获取相关属性 | |||
logger.info(s"engineConnManagerHost:" + engineConnManagerEnv.engineConnManagerHost) |
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.
It is recommended to read Commvars to read this Key(EUREKA_PREFER_IP), which will contain the key Value of the environment variable,CommonVars[String]("EUREKA_PREFER_IP", false),If there is a value in the environment variable, it will not take the default false
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.
thanks, I will try and submit changes.
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 have updated,pls review.
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.
Thank you, you should use the environment variable EUREKA_PREFER_IP instead of spring parameters, because Commvar will read the environment variables
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.
Hello, to facilitate communication, you can add my wechat
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.
sorry,I can't find you webchat, I send my webchat to your email:[email protected],pls check it.
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 linkis-env.sh export EUREKA_PREFER_IP, in Configuration read it through CommonVars, and related code has been modified.
This is a great feature, thank you |
…ow through read vavlue from Commvars to decide.
…ow through read vavlue from Commvars to decide.
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.
What is the purpose of the change
Linkis support ip address for service discovery service call,Related issues: #946 )
Brief change log
Verifying this change
This change is already covered by existing tests, such as (please describe tests).
in config/linkis-env.sh ,set EUREKA_PREFER_IP=true, after install, view eureka page will see services name contains ipAddress,it works!
Does this pull request potentially affect one of the following parts:
Documentation