kitex-contrib / registry-etcd Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Tencent Cloud servers cannot directly bind to a public IP address and port; they can only bind to 0.0.0.0:port. However, in this case, the service is registered with the address [::]:port. How can this issue be resolved?
Is your feature request related to a problem? Please describe.
目前注册的地址、端口 和 kitex服务监听的地址和端口是一致的,在大多数情况下,是满足需求的。
但是有些部署场景需要动态指定服务注册的地址。例如docker的bridge网络模式需要指定一个注册的主机IP来进行外网通信。目前我司就是使用这种方式。
Describe the solution you'd like
期望可以设置系统变量用于设置对外通信的IP和端口地址(优先级最高)。同时建议,如果kitex服务监听地址为空或为::,默认获取本机IP
github.com/kitex-contrib/registry-etcd tested by
github.com/kitex-contrib/registry-etcd.test imports
go.etcd.io/etcd/server/v3/embed imports
go.opentelemetry.io/otel/semconv: module go.opentelemetry.io/otel@latest found (v1.11.2), but does not contain package go.opentelemetry.io/otel/semconv
kitex提供的服务发现接口,本身不包含watch, 那服务节点变更了,客户端怎么可能能动态知道呢,你们给出的这些例子简直把我看麻了.
在客户端服务发现的代码里面添加watch,这个我觉得应该是必须要有的吧
The service “stop keepalive lease %x for etcd registry” due to network fluctuations, the service will not reconnect etcd, nor will it go down
Is your feature request related to a problem? Please describe.
当多个研发在同一个需求中开发多个服务时,为了避免弄脏基准环境,预期可以有能力部署多泳道开发环境。
Describe the solution you'd like
目前想到的是在基准环境中建立需求功能环境,并将被修改的工程使用“功能环境标”签作为Tag注册到ETCD。
在测试流量中注入”功能环境标签“,Client在做服务发现时候,可基于该标签对Tag进行过滤,找出该功能环境中的实例,进行访问。(若无该标签的实例,则访问基准环境)。
Describe alternatives you've considered
暂无
Additional context
暂无
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
in docker , server use net.Addr with (0.0.0.0:8999) or (127.0.0.1:8999)
{"network":"tcp","address":"[::]:8999","weight":10,"tags":null}
client can't to connect [::]:8999 or 127.0.0.1:8999
Describe the solution you'd like
func (e *etcdRegistry) register(info *registry.Info, leaseID clientv3.LeaseID) error {
address := info.Addr.String()
if info.Tags != nil {
addr, ok := info.Tags["addr"]
if ok {
address = addr
}
}
val, err := json.Marshal(&instanceInfo{
Network: info.Addr.Network(),
Address: address,
Weight: info.Weight,
Tags: info.Tags,
})
if err != nil {
return err
}
ctx, cancel := context.WithTimeout(context.Background(), time.Second*3)
defer cancel()
_, err = e.etcdClient.Put(ctx, serviceKey(info.ServiceName, address), string(val), clientv3.WithLease(leaseID))
return err
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.