微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

领事连接问题

如何解决领事连接问题

我有一个要与Connect代理并遵循the instructions on HashiCorp Learn portal的服务。

这是我的“ hello”服务:

{
  "service": {
    "name": "node","port": 3000,"connect": {
      "sidecar_service": {}
    }
  }
}

然后我进行“领事重装”并使用创建代理

consul connect proxy -sidecar-for node &

当我创建另一个这样的服务

consul connect proxy -service web -upstream node:9191

我可以通过在端口9191(curl localhost:9191)上调用Web服务来验证是否可以访问节点服务。但是,当我如下图所示在json文件中定义我的Web服务,然后使用consul reload注册它并想连接到它时,出现以下错误

curl: (7) Failed to connect to localhost port 9191: Connection refused 

web.json

{
  "service": {
    "name": "web","connect": {
      "sidecar_service": {
        "proxy": {
          "upstreams": [
            {
              "destination_name": "node","local_bind_port": 9191
            }
          ]
        }
      }
    }
  }
}

有什么我想念的吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。