Git Product home page Git Product logo

Comments (11)

fanliang11 avatar fanliang11 commented on May 22, 2024

本地可以调用这就排除程序的问题, 看下服务器防火墙端口是否开放,如果还有疑问可以把日志设置为Debug级别,这样就能跟踪调用信息,或者打开网关管理后台,看下节点是否运行正常

from surging.

moyuanhui avatar moyuanhui commented on May 22, 2024

服务器防火墙就没有开启,不会是防火墙的问题,日志的话不能查看,不是运行在vs的,是发布在Docker容器出的问题,查看Consul,节点是正常的

from surging.

fanliang11 avatar fanliang11 commented on May 22, 2024

可以通过以下去查找问题
1,可以看命令行打印出来的日志,如下图

1
2,可以看文本文件打印出来的日志,如下图
2
3.可以通过网关查看节点运行是否正常

3

from surging.

fanliang11 avatar fanliang11 commented on May 22, 2024

还有如果是docker 部署请使用以下进行配置
第一种:

options.IpEndpoint= new IPEndPoint(IPAddress.Any, 98)

第二种:

options.Ip = "0.0.0.0";
options.Port = 98;

from surging.

moyuanhui avatar moyuanhui commented on May 22, 2024

那么服务容器对外暴露的端口也是98嘛?还是任意?任何一个服务都是98?
image
image

from surging.

fanliang11 avatar fanliang11 commented on May 22, 2024

这个端口是由你自己设置的

from surging.

moyuanhui avatar moyuanhui commented on May 22, 2024

改成0.0.0.0,部署在容器同样是错误的,网关可以调用服务
image
暴露的端口是:
image
image

from surging.

fanliang11 avatar fanliang11 commented on May 22, 2024

启用0.0.0.0后 查找ip4 地址,你看下docker是否正确

from surging.

moyuanhui avatar moyuanhui commented on May 22, 2024

经测试,发现是服务应该不是不能立即更新注册,发布在Docker容器过几分钟后,网关能够正常返回正确的数据,不知道具体是什么延时了!
image

from surging.

moyuanhui avatar moyuanhui commented on May 22, 2024

options.Ip = "0.0.0.0";
options.Port = 随意; 服务才有这种形式

from surging.

fanliang11 avatar fanliang11 commented on May 22, 2024

你可以更改WatchInterval设置,默认是1分钟,也就是说间隔1分钟会心跳读取一次注册中心。可以按照以下进行更改成间隔5秒读一次。

    option.UseConsulManager(new ConfigInfo("127.0.0.1:8500") {
                           WatchInterval = 5
                       });

from surging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.