我正在试验CF在我当地的波什-莱特设置。如果我部署的应用程序运行良好的话。我现在正在尝试遵循这里的步骤,https://github.com/cf-platform-eng/cf-community-workshop/blob/master/demos/service-broker-lab.adoc来尝试定制的service设置。
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我可以打开主机名:
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工作,80端口在目标IP上打开,因为我可以通过我的主机浏览器到达它。
为什么在这种情况下wget不起作用呢?这似乎也是我未能创建service cf create-service-broker的原因。
更新
我已经成功地使用nginx反向代理的URL执行create service-broker命令,该代理运行在我的bosh-lite环境之外。代理重定向到相同的初始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(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和broker应用程序日志中都可以看到,请求到达代理,并得到400的答复。现在调试为什么。
发布于 2018-04-06 09:56:04
你能张贴--server-response选项与wget一起使用的结果吗?另外,当您尝试curl代理时会发生什么?
代理需要凭据,但是如果它在wget发出的第一个没有凭据的请求上响应401或500,这是很有趣的。
https://stackoverflow.com/questions/49685270
复制相似问题