Openshift Layer4 connection, App Won't Start

前端 未结 2 628
青春惊慌失措
青春惊慌失措 2020-12-17 02:51

I recently pushed a set of node.js changes to an app on Openshift. The app runs fine on my local machine and is pretty close to the vanilla example deployed by Openshift. Th

相关标签:
2条回答
  • 2020-12-17 03:40

    Looking at the question I think it is happening because you don't have any routes configured at root '/'. OpenShift uses HAProxy as a load balancer in scalable applications. HAProxy is configured to ping root '/' url for health checks to determine whether your application is up or down. In your application, you have not configured anything at the root url so when HAProxy pings '/' it gets 503, hence your application behaves like this. There are two ways you can fix this problem

    1. Create an index.html and push it to OpenShift application
    2. The better solution is to configure HAProxy configuration file. SSH into the main gear using rhc ssh --app command, then change directory to haproxy/conf, and then update option httpchk GET / to option httpchk GET /valid_location, and finally restart the HAProxy using rhc cartridge-restart --cartridge haproxy. You can check the status of your gears by going to http://myapp-myusername.rhcloud.com/haproxy-status.

    Hope this will help you.

    0 讨论(0)
  • 2020-12-17 03:54

    Thanks for the response! However, I just discovered what the issue was by rolling back and making one change at a time. There was a buried npm dependency down in a subfile. This dependency had not been added to the package.json file and Openshift was failing to rebuild node appropriately. Once the dependency was added everything started to run again. The log errors were a bit of a red herring and simply a side effect of not having a good application to start!

    0 讨论(0)
提交回复
热议问题