Asp .Net Core 系列:Ocelot结合Consul实现服务注册、服务发现

来自:博客园
时间:2024-02-22
阅读:

Consul下载地址:https://www.consul.io/downloads.html

文档:https://learn.hashicorp.com/consul/getting-started/services

Ocelot文档:https://ocelot.readthedocs.io/en/latest/introduction/gettingstarted.html

运行Consul程序

执行命令:consul agent -dev

Asp .Net Core 系列:Ocelot结合Consul实现服务注册、服务发现

 

 Consul会暴露出一个Web端口

地址:127.0.0.1:8500

Asp .Net Core 系列:Ocelot结合Consul实现服务注册、服务发现

 

 新建我们的服务: 

执行命令 dotnet new webapi -n MSS.Service

返回顶部
顶部