码迷,mamicode.com
首页 > Web开发 > 详细

NetCore去注册Eureka

时间:2020-01-11 00:37:20      阅读:256      评论:0      收藏:0      [点我收藏+]

标签:oca   war   service   ddd   http   desc   pad   get   url   

首先先安装nuget组件:Steeltoe.Discovery.ClientCore 
然后在ConfigureServices中进行注入
services.AddDiscoveryClient(Configuration);

Configure中引用
app.UseDiscoveryClient();


Appsettings中编写
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
},
"spring": {
"application": {
"name": "order11111"  //注入的名称
}
},
"eureka": {
"client": {
"serviceUrl": "http://192.168.130.132:8761/eureka/",  //eureka地址
"shouldFetchRegistry": false,
"shouldRegisterWithEureka": true
},
"instance": {
"port": 8010
//"hostName": "localhost"
//"preferIpAddress": true,
//"instanceId": "agent-service-container:8010"
}
}
}

NetCore去注册Eureka

标签:oca   war   service   ddd   http   desc   pad   get   url   

原文地址:https://www.cnblogs.com/ITzhangyunpeng/p/12178468.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!