auto_join_3.3
Håvar Aambø Fosstveit 2020-03-31 21:27:21 +02:00 committed by Mészáros Mihály
parent 35c2bc7dd8
commit bac00a87e1
1 changed files with 41 additions and 41 deletions

View File

@ -1,9 +1,9 @@
# Howto deploy a (room based) load balanced cluster # Howto deploy a (room based) load balanced cluster
We use in this example an HA proxy loadbalancer to loadbalance between 3 backend server This example will show how to setup an HA proxy to provide load balancing between several
The static web will be loadbalanced rounrdobin, and the websocket(signaling) and the media will be loadbalnced based on roomId URL parameter. multiparty-meeting servers.
## IP and dns ## IP and DNS
In this basic example we use the following names and ips: In this basic example we use the following names and ips:
@ -17,37 +17,37 @@ In this basic example we use the following names and ips:
* `redis.example.com` <=> `192.0.2.4` * `redis.example.com` <=> `192.0.2.4`
### LoadBalncer HAproxy ### Load balancer HAproxy
* `meet.example.com` <=> `192.0.2.5` * `meet.example.com` <=> `192.0.2.5`
## Deploy multiple backend/worker ## Deploy multiple multiparty-meeting servers
This is most easily done using Ansible (see below), but can be done
in any way you choose (manual, Docker, Ansible).
For example with ansible
Read more here: [mm-ansible](https://github.com/misi/mm-ansible) Read more here: [mm-ansible](https://github.com/misi/mm-ansible)
[![asciicast](https://asciinema.org/a/311365.svg)](https://asciinema.org/a/311365) [![asciicast](https://asciinema.org/a/311365.svg)](https://asciinema.org/a/311365)
## Setup redis for central session store ## Setup Redis for central HTTP session store
### Use one redis for all multiparty meeting ### Use one Redis for all multiparty-meeting servers
* Deploy a redis cluster so use one redis HA cluster for all instances. * Deploy a Redis cluster for all instances.
* We will use in our actual example `192.0.2.4` as redis HA cluster ip. * We will use in our actual example `192.0.2.4` as redis HA cluster ip. It is out of scope howto deploy it.
It is out of scope howto deploy it.
OR OR
* Just for testing you can use one of the redis from the worker's. * For testing you can use Redis from one the multiparty-meeting servers. e.g. If you plan only for testing on your first multiparty-meeting server.
e.g. If you plan only for testing on your first worker * Configure Redis `redis.conf` to not only bind to your loopback but also to your global ip address too:
* Configure redis configs/redis/redis.conf to not only bind to your loopback but also to your global ip address too:
``` plaintext ``` plaintext
bind 192.0.2.1 bind 192.0.2.1
``` ```
And use `192.0.2.1` where we use in this example `192.0.2.4` This example sets this to `192.0.2.1`, change this according to your local installation.
* modify /etc/ferm/ferm.cfg or where ever your firewall config is to allow incoming redis * Change your firewall config to allow incoming Redis. Example (depends on the type of firewall):
``` plaintext ``` plaintext
chain INPUT { chain INPUT {
@ -58,11 +58,11 @@ e.g. If you plan only for testing on your first worker
} }
``` ```
* **Use password or if you don't (like in this basic example) take care and use strict firewall rules** * **Set a password, or if you don't (like in this basic example) take care to set strict firewall rules**
## Setup backends/workers ## Configure multiparty-meeting servers
### Setup App config ### App config
mm/configs/app/config.js mm/configs/app/config.js
@ -70,21 +70,21 @@ mm/configs/app/config.js
multipartyServer : 'meet.example.com', multipartyServer : 'meet.example.com',
``` ```
### Setup Server config ### Server config
mm/configs/server/config.js mm/configs/server/config.js
``` js ``` js
redisOptions : { host: '10.0.2.4'}, redisOptions : { host: '192.0.2.4'},
listeningPort: 80, listeningPort: 80,
httpOnly: true, httpOnly: true,
trustProxy : ['10.0.2.5'], trustProxy : ['192.0.2.5'],
``` ```
## Deploy host with HA proxy ## Deploy HA proxy
* configure cerificate / letsencrypt for your meet.example.com * Configure cerificate / letsencrypt for `meet.example.com`
* in this example we put concat the privkey and full cert chain to /root/fullchain.pem. * In this example we put a complete chain and private key in /root/certificate.pem.
* Install and setup haproxy * Install and setup haproxy
`apt install haproxy` `apt install haproxy`
@ -102,7 +102,7 @@ backend multipartymeeting
frontend meet.example.com frontend meet.example.com
bind 192.0.2.5:80 bind 192.0.2.5:80
bind 192.0.2.5:443 ssl crt /root/fullchain.pem bind 192.0.2.5:443 ssl crt /root/certificate.pem
http-request redirect scheme https unless { ssl_fc } http-request redirect scheme https unless { ssl_fc }
reqadd X-Forwarded-Proto:\ https reqadd X-Forwarded-Proto:\ https
default_backend multipartymeeting default_backend multipartymeeting