kitex-contrib / registry-etcd

Apache License 2.0
20 stars 24 forks source link

Optimize the registered address #24

Closed lafer-fz closed 1 year ago

lafer-fz commented 1 year ago

获取注册地址逻辑优化:

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

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
11 out of 14 committers have signed the CLA.

:white_check_mark: simon0-o
:white_check_mark: li-jin-gou
:white_check_mark: baiyutang
:white_check_mark: ppzqh
:white_check_mark: jetsung
:white_check_mark: GuangmingLuo
:white_check_mark: bodhisatan
:white_check_mark: joway
:white_check_mark: succulentxb
:white_check_mark: lafer-fz
:white_check_mark: kezhenxu94
:x: lizhemingi
:x: zmdaily404
:x: mingtian2250
You have signed the CLA already but the status is still pending? Let us recheck it.

lafer-fz commented 1 year ago

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

bytedance-oss-robot[bot] commented 1 year ago

[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: - **[OWNERS](https://github.com/kitex-contrib/registry-etcd/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment