Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

High Availability

Open calebmeyer opened this issue 11 years ago • 30 comments

Can this app be set up for high availability? If you have a cluster, can you have a load balancer, at least two application nodes, and several mongo nodes?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

calebmeyer avatar Aug 20 '15 16:08 calebmeyer

We need to try it in a lab environment. Configure a mongo replica set with op log. Load balancer needs to support sticky sessions if you have old browsers and/or older mobile clients. @calebmeyer -- do you have access to test facilities for HA configurations? If issues are found in such configurations - we can fix them. (note - some optional packages, such as file-upload to local filesystem, are by design not HA compatible)

Sing-Li avatar Aug 20 '15 19:08 Sing-Li

I have access to some testing facilities. I will be trying this out. Can you recommend a load balancer?

calebmeyer avatar Aug 20 '15 19:08 calebmeyer

haproxy? Other community members may have more experience with other software load balancers. Please keep us posted on how it goes.

Sing-Li avatar Aug 20 '15 19:08 Sing-Li

I enjoy playing with these things. I'll give this a go.

So things wanted tested?

  • cluster mongodb (couple nodes)
  • rocket.chat (couple instances. Pointing to the master of the mongo cluster)
  • load balancer (haproxy or nginx)

Anything else? I guess rattle it a bit and see what bolts fall out? :D

geekgonecrazy avatar Aug 22 '15 06:08 geekgonecrazy

My 2c

  • variety of client browser/devices (especially IE versions)
  • force-fail mongo instance; force-fail meteor instance; observe interruption in user experience - expected to see some UI anomalies due to delayed session recovery/fail-over, but no data lost

Sing-Li avatar Aug 22 '15 12:08 Sing-Li

@calebmeyer any update on experiments with clusters of more than 4 RC instances? Thanks.

Sing-Li avatar Sep 07 '15 02:09 Sing-Li

I have logged a JIRA for access to my organization's openstack cluster, I'm just waiting on a response. I'll keep you posted.

calebmeyer avatar Sep 07 '15 05:09 calebmeyer

Thanks, @calebmeyer ! :+1:

Sing-Li avatar Sep 07 '15 07:09 Sing-Li

#769 <---- where are the HA guys when we really need them?! :grinning:

Sing-Li avatar Sep 11 '15 22:09 Sing-Li

We need to do some testing this weekend

geekgonecrazy avatar Sep 11 '15 22:09 geekgonecrazy

@geekgonecrazy @Sing-Li

I have an HA solution up and running at Google Cloud. Here is the private Gist that describes what I did. I still need to tweak some of the docs, but it is running famously at http://130.211.152.251/.

leefaus avatar Sep 15 '15 22:09 leefaus

@leefaus sweet! Come across any issues?

Also did you use anything in front of your nodes?

geekgonecrazy avatar Sep 15 '15 22:09 geekgonecrazy

@geekgonecrazy

The only issue is trying to automate setting up the MongoDB Replica Set. I am digging more into that. And on Google Cloud, the HTTP Load Balancing doesn't support websockets so you need to use Network Load Balancing. Other than that, everything went according to plan.

leefaus avatar Sep 15 '15 22:09 leefaus

Thanks for the update! Automated provisioning of failed mongo would be cool ... k8s can do that for sure. But websocket load balance front end is going to take some testing and tinkering. I think. We need to come up with some way to blast it from the front, then introduce different failures at the back and see how the thing behaves :smile_cat:

What is NLB? Is it round robin?

Please keep us in the 'loop' :-)

Sing-Li avatar Sep 15 '15 22:09 Sing-Li

@leefaus Thanks for the awesome starting point! @Sing-Li I got access to our internal open stack. I'll be looking into setting up a cluster with: 1 HAProxy node 2 Rocket.Chat meteor nodes 3 MongoDB nodes

I'm new to setting all this up, so it will likely take some time while I learn the technologies (or at least how to configure them).

Can anyone recommend testing tools for hitting the frontend, or should I just script something?

calebmeyer avatar Sep 21 '15 15:09 calebmeyer

@calebmeyer thanks for the update! Two suggestions:

  1. Can you please 'up' the number of Rocket.Chat meteor nodes from 2 to either 6 or 10? The reason being the 24 x 7 demo chat that we have running now is already 4 nodes - and we see no problem at that tier so far
  2. For front-end loading, I'd suggest scripting something yourself. We will have a Rocket.Chat specific scalable 'load test tool' in the future.

Sing-Li avatar Sep 21 '15 15:09 Sing-Li

@calebmeyer for load i'd recommend taking a look at Asteroid

Could use multiple instances of a script using this and hit the server with as many messages as you want.

geekgonecrazy avatar Sep 21 '15 16:09 geekgonecrazy

@Sing-Li will I need to set up sticky sessions?

calebmeyer avatar Sep 28 '15 17:09 calebmeyer

@calebmeyer

Yes, you need sticky sessions.

leefaus avatar Sep 29 '15 16:09 leefaus

Hey all, sorry for the long downtime. I got one of the openstack admins to help me. Didn't get my 6-10 app nodes, but I have it running behind a proxy on our corporate network.

I used @leefaus gist to help with the mongo replicaset (thank you very much!), and I have my haproxy balancing via source.

However, I noticed that avatars are stored on the filesystem in the administration/accounts section. Is that intended? How did we get around that limitation for the demo?

calebmeyer avatar Nov 13 '15 20:11 calebmeyer