Bluemix node.js app sends 502 Bad Gateway responses during the push of a new app

时间:2015-07-28 16:10:48

标签: node.js cloudfoundry ibm-cloud

I am pushing a node.js app to IBM Bluemix by using the blue-to-green pattern.

Basically my Jenkins job is doing the following steps:

  • upload the new app: cf push my-app-tmp -f cf/manifest-my-app.yml -n my-app-tmp
  • add the app to the loadbalancer: cf map-route my-app-tmp mybluemix.net -n my-app
  • delete the old app: cf delete my-app -f
  • rename the new app to the old name: cf rename my-app-tmp my-app
  • remove the old route: cf unmap-route my-app mybluemix.net -n my-app-tmp

During this process my app is sometimes returning 502 Bad Gateway. It seems to be a problem with the loadbalancer for me, any ideas?

1 个答案:

答案 0 :(得分:1)

再次检查模式: http://docs.pivotal.io/pivotalcf/devguide/deploy-apps/blue-green.html

删除时,您仍然可以找到正在运行的应用的地图。路由器可能会向它发送请求,直到它发现旧应用程序被销毁为止。删除允许参数删除映射,但只是为了确保:取消映射旧应用程序,然后将其删除。您甚至可以在删除它之前暂停一下,以允许它处理它正在做的任何事情。

但请记住:在云中期待失败!如果有意义,请重试。因此,即使502不应该对使用您的应用程序的某些内容产生影响,因为它会很快恢复。

HP