【问题标题】:cf create-service-broker fails with connection refusedcf create-service-broker 失败,连接被拒绝
【发布时间】:2018-04-06 04:23:15
【问题描述】:

我正在本地 bosh-lite 设置中试验 CF。 如果运行良好,我部署到的应用程序。我现在正在尝试按照此处的步骤进行操作 https://github.com/cf-platform-eng/cf-community-workshop/blob/master/demos/service-broker-lab.adoc 试用自定义服务代理设置。

https://github.com/mstine/haash-broker 应用程序启动并运行良好:

$ cf apps
name            requested state   instances   memory   disk   urls
haash-broker    started           1/1         768M     1G     haash-broker.vbox.mojito, haash-broker.192.168.50.6.xip.io

我可以从我的主机浏览器很好地访问它: http://haash-broker.192.168.50.6.xip.io/v2/catalog

但是当我执行

cf create-service-broker haash-broker warreng natedogg http://haash-broker.192.168.50.6.xip.io

我明白了

$ cf create-service-broker haash-broker warreng natedogg http://haash-broker.192.168.50.6.xip.io
Creating service broker haash-broker as admin...
FAILED
Server error, status code: 502, error code: 10001, message: The service broker could not be reached: http://haash-broker.192.168.50.6.xip.io/v2/catalog

当我登录 CC 虚拟机时:

$ bosh -e vbox -f cf ssh api/eb4cec99-bab1-4513-a980-fb92775ac2d8

我可以 ping 主机名:

api/eb4cec99-bab1-4513-a980-fb92775ac2d8:~$ sudo ping haash-broker.192.168.50.6.xip.io
PING haash-broker.192.168.50.6.xip.io (192.168.50.6) 56(84) bytes of data.
64 bytes from 192.168.50.6: icmp_seq=1 ttl=64 time=0.080 ms

但是 wget 连接被拒绝:

api/eb4cec99-bab1-4513-a980-fb92775ac2d8:~$ wget http://warreng:natedogg@haash-broker.192.168.50.6.xip.io/v2/catalog
--2018-04-06 04:19:05--  http://warreng:*password*@haash-broker.192.168.50.6.xip.io/v2/catalog
Resolving haash-broker.192.168.50.6.xip.io (haash-broker.192.168.50.6.xip.io)... 192.168.50.6
Connecting to haash-broker.192.168.50.6.xip.io (haash-broker.192.168.50.6.xip.io)|192.168.50.6|:80... failed: Connection refused.

防火墙允许该 VM (sudo iptables -L) 上的所有内容。 主机名得到正确解析。 ping 正常,并且目标 IP 上的 80 端口已打开,因为我可以从主机浏览器访问它。

wget 在这种情况下怎么会不起作用? 这似乎也是我未能创建服务代理的原因cf create-service-broker

更新

我已经设法使用在我的 bosh-lite 环境之外运行的 nginx 反向代理的 URL 执行 cf create-service-broker 命令。代理重定向到相同的初始 URL http://haash-broker.192.168.50.6.xip.io 并且命令以这种方式成功。 但随后的

cf create-service-broker haash-broker warreng natedogg http://haash-broker.192.168.50.1.xip.io:9999
cf enable-service-access haash
cf create-service HaaSh basic my-hash

(其中 haash-broker.192.168.50.1.xip.io:9999 是我的 nginx 代理)失败并显示

Server error, status code: 502, error code: 10001, message: The service broker rejected the request to http://haash-broker.192.168.50.1.xip.io:9999/v2/service_instances/4ef19154-d238-4cb3-8003-803fba53af3f?accepts_incomplete=true. Status Code: 400 Bad Request, Body: {"timestamp":1523008856993,"error":"Bad Request","status":400,"message":""}

我可以在 nginx 和代理应用程序日志中看到请求到达代理并以 400 响应。 现在调试为什么。

【问题讨论】:

    标签: cloud-foundry cf-bosh


    【解决方案1】:

    您能否发布与wget 一起使用的--server-response 选项的结果?另外,当您尝试curl 经纪人时会发生什么?

    Broker 需要凭据,但如果它在 wget 在没有凭据的情况下发出的第一个请求时响应 401 或 500 会很有趣。

    【讨论】:

    • 感谢您对此进行调查!使用当前详细信息更新了问题
    • wget --server-response 没有更改 wget 错误消息中的任何内容。这是 curl 的结果: $ curl warreng:natedogg@haash-broker.192.168.50.6.xip.io/v2/catalog curl: (7) 无法连接到 haash-broker.192.168.50.6.xip.io 端口 80:连接被拒绝
    猜你喜欢
    • 2019-08-22
    • 2014-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-22
    • 2014-09-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多