eolinker / apinto-dashboard

Dashboard for Apinto
https://www.apinto.com
101 stars 31 forks source link

日志检索报错:node addr http://172.18.0.2:9400 can not be connected #25

Closed junxiaotan closed 11 months ago

junxiaotan commented 11 months ago

Current Behavior

日志检索异常:系统管理->日志检索,报错:

node addr http://172.18.0.2:9400 can not be connected

控制台network请求的一个API:api/log/files?cluster=cluster_2e34f6a8_509c_482b_9dd3_0d49d1060db6&node=5a399d0b6b9644b78a19e6f636825474&namespace=default,响应如下:

{"code":-1,"msg":"node addr http://172.18.0.2:9400 can not be connected"}

Expected Behavior

1,希望能解答一下,关于网关和节点中涉及到相关的访问地址及之间的关联; 2,日志检索能正常使用,以及该问题是否跟1相关;

Error Logs

/var/lib/apinto/error*.log 几个文件中,都是空的。

Steps to Reproduce

安装方式

1,dashboard 安装:https://help.eolink.com/tutorial/Apinto/c-1406 中 docker-compose ,修改项:密码和redis_cluster . environment . HOST 为 本地内网IP:172.17.0.5 2,节点安装:https://help.eolink.com/tutorial/Apinto/c-1378,单节点,Docker方式,直接复制文档中的配置,暂无任何修改;

问题:

1, dashboard 添加集群时,录入的是:172.17.0.5:9400,检测成功,录入之后,页面返回的管理地址和服务地址,ip 分别变成了 172.18.0.2,这是为啥? 2,第一条的内网变更,对功能没有任何影响,上游API及访问测试,无论通过 172.17.0.5:8099172.18.0.2:8099都可以; 3,日志检索异常:系统管理->日志检索,报错:

node addr http://172.18.0.2:9400 can not be connected

控制台network请求的一个API:api/log/files?cluster=cluster_2e34f6a8_509c_482b_9dd3_0d49d1060db6&node=5a399d0b6b9644b78a19e6f636825474&namespace=default,响应如下:

{"code":-1,"msg":"node addr http://172.18.0.2:9400 can not be connected"}

Environment

  1. uname -a: Linux sls-tc-sh 5.4.119-19-0009.11 #1 SMP Wed Oct 5 18:41:07 CST 2022 x86_64 x86_64 x86_64 GNU/Linux
  2. dashboard version:昨天基于 官方文档docker-composer 安装的最新。
junxiaotan commented 11 months ago

补充:策略->流量限制,发布时,也出现了同样的错误,相关的地方,可能还不止发现的这俩。

junxiaotan commented 11 months ago

果然,同步缓存->发布,也一样的问题~

Dot-Liu commented 11 months ago

您好,请您在启动网关节点,即apinto的时候,配置好对应的config.yml文件 文件中有多个advertise_urls的字段,配置好宿主机的IP地址,假设宿主机IP为172.203.12.32,则对应配置如下

version: 2
client:
  advertise_urls: # open api 服务的广播地址
    - http://172.203.12.32:9400
  listen_urls: # open api 服务的监听地址
    - http://0.0.0.0:9400
gateway:
  listen_urls: # 转发服务的监听地址
    - https://0.0.0.0:8099
    - http://0.0.0.0:8099
peer: # 集群间节点通信配置信息
  listen_urls: # 节点监听地址
    - http://0.0.0.0:9401
  advertise_urls: # 节点通信广播地址
    - http://172.203.12.32:9401

更新完后重启节点容器

Dot-Liu commented 11 months ago

打开浏览器,进入控制台页面,找到对应的集群,更新节点列表,如下图 image

junxiaotan commented 11 months ago

谢谢,可以了。