-
Notifications
You must be signed in to change notification settings - Fork 9
服务注册与发现
Kakous edited this page Mar 21, 2019
·
7 revisions
服务注册与发现是所有的分布式服务都会涉及到的,常见的注册中心有zookeeper 、eureka、consul、etcd。 Uragano默认选择使用consul,因为它安装配置简单,支持多数据中心,支持k/v存储,可以扩展为配置中心,我也基于consul实现了一个配置中心。
当然也可以选择使用其他产品,你可以实现IServiceDiscovery接口,然后通过AddServiceDiscovery方法注入。
services.AddUragano(Configuration, builder =>
{
builder.AddClient();
builder.AddServiceDiscovery<CustomServiceDiscovery>();
});