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

Optimize: the registered address #25

Merged

Conversation

lafer-fz
Copy link
Contributor

@lafer-fz lafer-fz commented Jul 4, 2023

现状:
目前注册的地址、端口 和 kitex服务监听的地址和端口是一致的,在大多数情况下,是满足需求的。
但是有些部署场景需要动态指定服务注册的地址。例如docker的bridge网络模式需要指定一个注册的主机IP来进行外网通信。目前我司就是使用这种方式。

优化:

  1. 判断系统变量(KITEX_IP_TO_REGISTRY、KITEX_PORT_TO_REGISTRY)存在,则使用系统变量的ip:port 进行注册(优先级最高)
  2. 如果监听地址不为空、则使用监听地址进行注册
  3. 如果监听地址不为空,则获取本机IPV4地址进行注册

@CLAassistant
Copy link

CLAassistant commented Jul 4, 2023

CLA assistant check
All committers have signed the CLA.

@bytedance-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lafer-fz

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@GuangmingLuo GuangmingLuo requested a review from lizhemingi July 4, 2023 08:20
@lizhemingi
Copy link
Collaborator

LGTM. Thanks for your contribution.

@lizhemingi lizhemingi merged commit b1978f4 into kitex-contrib:main Jul 4, 2023
@felix021
Copy link
Contributor

felix021 commented Jul 4, 2023

Please update the document or example to present this feature @lafer-fz

@lafer-fz lafer-fz mentioned this pull request Aug 14, 2023
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.

4 participants