I believe that services should be able to start in any order, further more your processes should tolerate failure of their backing services by trying to reconnect. If a client attempts to connect while your backing services are unavailable, you fail fast, even if this means giving the client an "oops" type of page.
You can use something like an elastic load balancer with periodic health-checks to move instances in and out of production. Create a basic "health-check" page that returns HTTP 200 when all backing services are active, and 500 otherwise. Amazon's Elastic Load Balancer for example with not move an image into production until it receives a minimum number of successful heartbeats. Also, upstart does not guarantee order necessarily, they use an event-based startup mechanism. Upstart cannot guarantee dependencies are started first without some hackery. tl;dr auto-reconnect, fail-fast On Sat, Dec 1, 2012 at 11:06 AM, Isaac Schlueter <[email protected]> wrote: > Well, it depends on the service. How would you check if it's ready if > you were just sitting at a terminal? > > For many services, you could check for a pid file, or try to connect > to it. If it succeeds, you're ready. Another option is to perhaps > not start node until that other service is up. Many service managers > (SMF, Upstart, etc.) have the ability to make one service depend on > another. > > On Sat, Dec 1, 2012 at 3:55 AM, Angelo Chen <[email protected]> > wrote: > > hi, > > > > what is the best way to check if other service is ready(ex:redis) > > before: > > http.createServer(function(req, res) ? thanks, > > > > angelo > > > > -- > > Job Board: http://jobs.nodejs.org/ > > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > You received this message because you are subscribed to the Google > > Groups "nodejs" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/nodejs?hl=en?hl=en > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
