在Ocelot中配置好Consul之后.
在浏览器中查看,返回502错误.
控制台给出的错误信息:
warn: Ocelot.Responder.Middleware.ResponderMiddleware[0]
requestId: 0HMBJ7BTDT1K6:00000006, previousRequestId: no previous request id, message:
Error Code: ConnectionToDownstreamServiceError Message: Error connecting to downstream service
, exception: System.Net.Http.HttpRequestException: 不知道这样的主机。
解决方案:
consul agent -server -datacenter=dc1 -bootstrap -data-dir ./data -config-file ./conf -ui -node=n1 -bind 10.0.194.104 -client=0.0.0.0
改为
consul agent -server -datacenter=dc1 -bootstrap -data-dir ./data -config-file ./conf -ui -node=10.0.194.104 -bind 10.0.194.104 -client=0.0.0.0
去掉node的配置