Jitsi high availability + Jigasi?

Hi there,

I’m currently working on improving jitsi resiliency, I read about how jitsi.meet are doing with the handbooks : Video Tutorials · Jitsi Meet Handbook

So far, I understand that I should have X shards, with each shard having jitsi (Jicofo, prosody…) + many JVBs.
I understand too that HaProxy are used to provide sticky sessions based on the meeting URIs (so two users joining a meeting “foobar” would not be sent to different shards).
By the way, I didn’t find the HaProxy configuration, can you share it? (or part of it?)

But I don’t understand how it works with an IPBX & Jigasi.

let say that I have my IPBX outside of the jitsi shards.
Jigasi can only connect to one of the 3 shards.
So I thought “fine, I will run 3 instance of Jigasi connecting to my 3 jitsi shards”, but then, there are an issue:

Let’s say my first user (with chrome browser) joins the room “phoneMeet”, and let’s say that haProxy choose the shard number 3.
Then the other user on the phone will dial a number configured on my IPBX.
My user on the phone is now on my IPBX, but the IPBX doesn’t know which jigasi it should use to send my user to the correct shard (3) .

Any thoughts on this? How are the Jitsi Meet team doing this?

Regards

Note that that is how we do it. There are probably other ways to do it too.

Sorry we cannot share that.

Jigasi connects to the infrastructure using BOSH. Thus, when it starts the connection will hit HAProxy and be directed to the right shard.

Hi @saghul ,

Thanks for your feedback,

As for the HaProxy configuration I will find how to configure it, can you confirm that a sync is needed between the two HaProxy instances because they have to be stateful?

As for Jigasi, If I understand correctly, I don’t need to have multiple Jigasi (one for each shard), only one is needed?

I can’t figure out how it is working exactly

I assume that I need to change my configuration from this :

# Internal XMPP server
# (Jicofo + prosody, internal private IP)
XMPP_SERVER=jitsi-core.example.com

# Internal XMPP server URL 
#(Jicofo + prosody, internal private IP)
XMPP_BOSH_URL_BASE=http://jitsi-core.example.com:5280

to this :

# Internal XMPP server
# (Jicofo + prosody, internal private IP -> behind the load balancers)
XMPP_SERVER=aws-internal-ALB-jitsi-core.example.com

# Internal XMPP server URL
# (Jicofo + prosody, internal private IP -> behind the load balancers)
XMPP_BOSH_URL_BASE=http://aws-internal-ALB-jitsi-core.example.com:5280

and it will work, can you confirm?

What’s the difference between XMPP_SERVER & XMPP_BOSH_URL_BASE parameters?

Is there something else that I should know about this setup?

Correct.

You can have a pool of them, per shard or otherwise really. A Jigasi can connect to multiple shards at the same time IIRC. Our Docker images don’t support that out of the box though.

Generally you use the public URL + /http-bind, which will be proxied to prosody. Prosody should not be publicly reachable.

Ok, so here is what I want to do according to what I understand now based on your feedback :

I assume that I have everything working with stateful HaProxies, web users should work fine.
As for my mobile phone user, it dials the number +1234, the call lands on my IPBX, and there is one jigasi connected to my IPBX. (I can have multiple IPBX so each IPBX will have it’s own jigasi).

The IPBX send the call to the locally connected jigasi with the X-room-name = phoneMeet.
That’s the last part (how jigasi is reaching the correct shard) that I don’t fully understand.

Based on your feedback, now I can imagine that jigasi uses the load balancer (XMPP_BOSH_URL_BASE to change with public URL + http-bind?), goes through the same process as my web user and lands on the correct jitsi shard.

But when starting jigasi, I know that it connects to a MUC room, and that’s where I’m lost.
I think it relates to the part of your reply when you state:

Can you elaborate a bit more on what to change on the jigasi container so it can communicate with multiple shards at the same time? (or if you have any documentation I will be happy to read it).

Thanks a lot

Correct.

Not sure that’s needed for inbound calling, it certainly is for outbound.

Jigasi connects to a “brewery” MUC. It should be able to connect to several. Check the sip-communicator.properties file.

Thanks for your answers, now I have a better idea of what to do, that’s a lot of work for sure :grinning:

1 Like