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 with MupX gives random 404s. Doesn't seem to work with Mupx? #104

Closed satyavh closed 8 years ago

satyavh commented 8 years ago

I recently switched to MupX for deploys (reason: better security), but ever since my Cluster fails randomly to load meteor.js, gives a 404 error

GET https://our.postjar.com/a64bd6752cad2338dae6daa9716a453d3ee61fe6.js?meteor_js_resource=true > 404

Refresh the browser, it sometimes gives 404, sometimes not. It's really random. In the server logs is not that much going on, sometimes I see a Cluster: web proxy error: Connection droped.

Now I did some debugging:

  1. I deployed 3 servers using Mupx, without the Cluster packages installed. All 3 servers work fine, no 404s at all.
  2. I installed the cluster package, no changes to mup.json, deployed again with Mupx. Immediately I get random 404s on all 3 servers.

So this is even without any balancers configured. When I deployed with Mup I didn't have those issues.

So does Cluster actually work with MupX?

madhan5000 commented 8 years ago

Just curious, Do you have your Cluster DB configured? Do all the 3 servers connect to a central Cluster DB? and have the same name ? I am trying to see if the issue I had is some how related to yours? https://github.com/meteorhacks/cluster/issues/102

BTW, 404 reminds me of something, I have noticed 404s with my Microservices due to stale entries in Cluster DB. I don't know how often Cluster package cleans them up but try deleting them.

satyavh commented 8 years ago

Damn you really opened my eyes!! I had tons of stale entries in my Cluster DB, because I moved to a set of new Digital Ocean instances, because I deployed with MupX instead of Mup. Now that I removed those entries, Cluster works like a charm again.

So yes, all 3 servers connect to a single central cluster DB. I hope this is of any use to your issue?

madhan5000 commented 8 years ago

@satyavh I am glad that it helped to resolve your issue. Mine, I think it has more to do with names of the microservices being the same in Cluster DB. If I had to guess, Load balancer functionality is looking at the Names instead of endpoint hash or some unique identifier. @arunoda needs to look at it :)