配置consul
This commit is contained in:
@@ -58,13 +58,13 @@
|
|||||||
"TopicName": "kafkalog"
|
"TopicName": "kafkalog"
|
||||||
},
|
},
|
||||||
"ConsulClientOption": {
|
"ConsulClientOption": {
|
||||||
"IP": "192.168.2.128",
|
"IP": "118.195.191.41",
|
||||||
"Port": "8500",
|
"Port": "8500",
|
||||||
"Datacenter": "dc1"
|
"Datacenter": "dc1"
|
||||||
},
|
},
|
||||||
"ConsulRegisterOption": {
|
"ConsulRegisterOption": {
|
||||||
"IP": "192.168.1.104",
|
"IP": "183.216.18.15",
|
||||||
"Port": "7001",
|
"Port": "44329",
|
||||||
"GroupName": "ApiMicroservice",
|
"GroupName": "ApiMicroservice",
|
||||||
"HealthCheckUrl": "/Health",
|
"HealthCheckUrl": "/Health",
|
||||||
"Interval": 10,
|
"Interval": 10,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
|||||||
{
|
{
|
||||||
var consulRegisterOption = Appsettings.app<ConsulRegisterOption>("ConsulRegisterOption");
|
var consulRegisterOption = Appsettings.app<ConsulRegisterOption>("ConsulRegisterOption");
|
||||||
|
|
||||||
var consulClientOption = Appsettings.app<ConsulClientOption>("ConsulRegisterOption");
|
var consulClientOption = Appsettings.app<ConsulClientOption>("ConsulClientOption");
|
||||||
using (ConsulClient client = new ConsulClient(c =>
|
using (ConsulClient client = new ConsulClient(c =>
|
||||||
{
|
{
|
||||||
c.Address = new Uri($"http://{consulClientOption.IP}:{consulClientOption.Port}/");
|
c.Address = new Uri($"http://{consulClientOption.IP}:{consulClientOption.Port}/");
|
||||||
|
|||||||
Reference in New Issue
Block a user