meteorhacks / cluster

Clustering solution for Meteor with load balancing and service discovery
https://meteorhacks.com/cluster-a-different-kind-of-load-balancer-for-meteor.html
MIT License
632 stars 80 forks source link

cluster.discoverConnection now uses ConnectionWatcher on the client a… #97

Closed patrickleet closed 6 years ago

patrickleet commented 9 years ago

…s well as the server. Added a server side method to pick endpoint from client, which is used by ConnectionWatcher when not on the server.

Addresses #27

patrickleet commented 9 years ago

All tests pass when run locally.

patrickleet commented 9 years ago

I'm not sure the best practices for doing adding a Meteor.Method to a package. If you have a better way let me know.

patrickleet commented 9 years ago

This works locally but running into some issues when deployed.

On my production environment, pickEndpoint returns an IP Address instead of a domain name. The IP address is http, not https.

Guessing this has something to do with balancer, and selecting the balancer URL instead of the endpoint when available.

patrickleet commented 9 years ago

@arunoda Please advise on usage of balancer in this situation.

I'm concerned with the scenario where a balancer is not provided for the endpoint, as then it would return the IP Address?

arunoda commented 9 years ago

ConnectionWatcher is server side only. It wraps a DDP connection. Once disconnected, it'll try to connect to a different service instance.

I'll respond #27 regarding the issue.