问题描述:

When you have a meteor cluster (lets say 2 boxes) and a server stops responding (goes down), does all the traffic get re-routed to the other "live" server? I'm building an application for someone that it is very likely will be a fire and forget application (where it runs and just provides updates when they come in).

My concern is that if one server goes down, there won't be any traffic to any of the clients that were attached to that box.

Info about app:

  1. The app will be a fire and forget (load page and walk away). Likely someone won't refresh the page or anything.

  2. This app is mission critical and someone not getting a notification is really, really bad, and a difference of a few seconds does matter.

  3. Websockets must be used. The 10 second dely in pull-logging is unacceptable.

Most Importantly....

  1. The app must auto recover. If a server goes down, the client must switch to a good box without a page refresh or someone walking over to the box and causing the refresh.

网友答案:

Meteor has will always try to reconnect to the server when a connection is lost, So if the server gets back online it will reconnect. But if you need a custom logic to retry a connection to different cluster when the user disconnect should also be easily coded the docs have reactive API to see the connection status (Meteor.status) here is a new package I found it can be a great place to see how it should work: https://github.com/nspangler/autoreconnect

also if you're using meteorhacks:cluster it's possible it will retry to connect to a different server, the docs don't really say anything about it but if it's not I think aruonda might add that just by asking on git.

good luck :)

相关阅读:
Top