Skip to content

Commit b458933

Browse files
jddocsnmelehan
andauthored
[New] Manually Deploy a Jitsi Cluster on Akamai (#7012)
* [New] Manually Deploy a Jitsi Cluster on Akamai * added commands, screenshot, and dictionary entries * copy edit and file content additions, markdown fixes * update API reference link and copy * added architecture diagram * edit to SVG viewbox dimensions * swapped out SVG diagram file * Set width and height attributes on SVG * typo and formatting fix * code and copy edits * dictionary.txt edit * added virtualenv prerequisite * command updates and copy edits * instruction tech and copy edits * typo fix * copy edits --------- Co-authored-by: Nathan Melehan <[email protected]>
1 parent debbc33 commit b458933

File tree

4 files changed

+326
-0
lines changed

4 files changed

+326
-0
lines changed

ci/vale/dictionary.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,7 @@ jenkinsx
11631163
jessie
11641164
jetpack
11651165
jez
1166+
Jicofo
11661167
JIDs
11671168
jira
11681169
jitsi
@@ -1192,6 +1193,9 @@ julialang
11921193
jumpbox
11931194
junit
11941195
jupyter
1196+
JVB
1197+
jvb_cluster_size
1198+
JVBs
11951199
jwebserver
11961200
JWTs
11971201
jx
@@ -1748,6 +1752,7 @@ oauth
17481752
obfuscator
17491753
observium
17501754
OCAs
1755+
Octo
17511756
octopress
17521757
ODMs
17531758
odoo
@@ -1855,6 +1860,7 @@ pentesting
18551860
pepi
18561861
perceptron
18571862
percona
1863+
Perf
18581864
performant
18591865
perl
18601866
perldoc
@@ -2732,6 +2738,8 @@ veritas
27322738
vhost
27332739
vhosts
27342740
Vickery
2741+
Videobridge
2742+
Videobridges
27352743
viewport
27362744
vigenere
27372745
vimrc
@@ -2807,6 +2815,7 @@ webpy
28072815
WEBrick
28082816
webroot
28092817
webroots
2818+
webrtcperf
28102819
webserver
28112820
webservers
28122821
webservice

docs/guides/applications/messaging/manually-deploy-jitsi-cluster/Jitsi-Cluster-Reference-Architecture.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 316 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,316 @@
1+
---
2+
slug: manually-deploy-jitsi-cluster
3+
title: "Manually Deploy a Jitsi Cluster on Akamai"
4+
description: "This guide goes over how to manually deploy a scalable Jitsi conferencing cluster with Ansible using provided playbooks."
5+
authors: ["John Dutton","Elvis Segura"]
6+
contributors: ["John Dutton","Elvis Segura"]
7+
published: 2024-08-06
8+
keywords: ['jitsi','conferencing','communications','cluster']
9+
license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
10+
external_resources:
11+
- '[Jitsi Official Documentation](https://jitsi.github.io/handbook/docs/intro/)'
12+
- '[Jitsi Community](https://community.jitsi.org/)'
13+
---
14+
15+
[Jitsi](https://jitsi.org/) is a free, open source video conferencing and communication platform that provides a secure, stable, and free alternative to other popular video conferencing services. With Jitsi, you can use built-in features to limit meeting access with passwords or stream on YouTube so anyone can attend.
16+
17+
This guide walks through creating a scalable Jitsi Meet cluster using [Ansible](https://www.ansible.com/). The provided Ansible playbook creates an initial deployment that can then be scaled up or down as needed.
18+
19+
If you wish to deploy Jitsi automatically rather than manually, consider either our single-instance [Jitsi Marketplace deployment](/docs/products/tools/marketplace/guides/jitsi/) or our [Jitsi Cluster Marketplace deployment](/docs/products/tools/marketplace/guides/jitsi-cluster/).
20+
21+
## Architecture Diagram
22+
23+
1. The manual deployment in this guide provisions a Jitsi cluster where the Jitsi Videobridges (JVB) are scalable components.
24+
25+
1. Each JVB connects to the singular Jitsi Meet instance running XMPP via Prosody on port 5222.
26+
27+
1. Jicofo (Jitsi Conference Focus) runs on the Jitsi meet instance and is configured to split load balanced traffic between each JVB instance.
28+
29+
1. NGINX runs on the meet instance and serves client requests and communicate with internal Jitsi components.
30+
31+
![Jitsi Cluster Reference Architecture](Jitsi-Cluster-Reference-Architecture.svg "Jitsi Cluster Reference Architecture")
32+
33+
### Architecture Components
34+
35+
- **[Jitsi Videobridge](https://jitsi.org/jitsi-videobridge/) (JVB):** An open source Selective Forwarding Unit (SFU) that runs up to thousands of video streams from a single server.
36+
37+
- **Jitsi Meet Instance:** A Compute Instance running Prosody for XMPP protocol, Jicofo, and NGINX.
38+
39+
- **[Extensible Messaging and Presence Protocol](https://xmpp.org/) (XMPP):** Standard open communication protocol. XMPP uses default ports 5222 and 5269.
40+
41+
- **[Prosody](https://prosody.im/):** An XMPP server written in Lua. Uses port 5222 in this architecture.
42+
43+
- **[Jitsi Conference Focus](https://github.com/jitsi/jicofo) (Jicofo):** Splits traffic between all JVBs and manages the media sessions for each participant. Directs traffic with Octo (a load balancing routing utility) using round robin protocol.
44+
45+
- **[NGINX](https://nginx.org/en/):** The web server used in this architecture.
46+
47+
## Prerequisites and Supported Distributions
48+
49+
### Prerequisites
50+
51+
The following software and components must be installed and configured on your local system in order for the playbooks in this guide to function:
52+
53+
- [Python](https://www.python.org/downloads/) version: > v3.8
54+
55+
- The [virtualenv](https://virtualenv.pypa.io/en/latest/installation.html) Python library
56+
57+
- A [Linode API access token](/docs/products/tools/api/get-started/#get-an-access-token)
58+
59+
- A configured [SSH key pair](/docs/guides/use-public-key-authentication-with-ssh/) along with your public key
60+
61+
- The [Git](https://git-scm.com/) utility
62+
63+
### Supported Deployment Distribution
64+
65+
- Ubuntu 22.04 LTS
66+
67+
## Clone the docs-cloud-projects Github Repository
68+
69+
In order to run the Jitsi deployment in this guide, the docs-cloud-projects Github repository must be cloned to your local machine. This includes all playbooks, configurations, and files for all project directories in the repository, including those needed to successfully deploy and scale the Jitsi cluster.
70+
71+
1. Using git, clone the docs-cloud-projects repository. This clones the repository to the current working directory on your local machine:
72+
73+
```command
74+
git clone https://github.com/linode/docs-cloud-projects.git
75+
```
76+
77+
1. Navigate to the manual-jitsi-cluster directory within your local cloned repository:
78+
79+
```command
80+
cd docs-cloud-projects/apps/manual-jitsi-cluster
81+
```
82+
83+
1. Confirm the manual-jitsi-cluster directory contents on your system:
84+
85+
```command
86+
ls
87+
```
88+
89+
The following contents should be visible:
90+
91+
```output
92+
ansible.cfg collections.yml group_vars hosts images LICENSE provision.yml
93+
README.md requirements.txt resize.yml roles site.yml
94+
```
95+
96+
## Installation
97+
98+
1. Using python, create a virtual environment with the virtualenv utility. This isolates dependencies from other packages on your system:
99+
100+
```command
101+
python3 -m virtualenv env
102+
source env/bin/activate
103+
pip install -U pip
104+
```
105+
106+
1. Install all packages in the `requirements.txt` file. This includes Ansible collections and required Python packages:
107+
108+
```command
109+
pip install -r requirements.txt
110+
ansible-galaxy collection install -r collections.yml
111+
```
112+
113+
1. Confirm Ansible is installed:
114+
115+
```command
116+
ansible --version
117+
```
118+
119+
Sample output:
120+
121+
```output
122+
ansible [core 2.13.13]
123+
(...)
124+
python version = 3.12.4 (main, Jun 18 2024, 08:58:27) [Clang 15.0.0 (clang-1500.0.40.1)]
125+
jinja version = 3.1.4
126+
libyaml = True
127+
```
128+
129+
{{< note title="Upgrading the ansible-core package" >}}
130+
Some ansible-core package versions may contain older parameters. Should you experience any errors related to out-of-date or deprecated parameters, you can update the ansible-core version with the below command:
131+
```command
132+
python -m pip install --upgrade ansible-core
133+
```
134+
{{< /note >}}
135+
136+
## Setup
137+
138+
All secrets are encrypted with the Ansible Vault utility as a best practice.
139+
140+
1. Export `VAULT_PASSWORD`, replacing {{< placeholder "MY_VAULT_PASSWORD" >}} with a password of your choosing. This password acts as a key for decrypting encrypted secrets. Save this password for future use:
141+
142+
```command
143+
export VAULT_PASSWORD={{< placeholder "MY_VAULT_PASSWORD" >}}
144+
```
145+
146+
1. Encrypt a root password, sudo user password, and your Linode APIv4 token using the ansible-vault utility. Replace {{< placeholder "ROOT_PASSWORD" >}} with a root password, {{< placeholder "SUDO_PASSWORD" >}} with a sudo user password, and {{< placeholder "API_TOKEN" >}} with your Linode APIv4 token.
147+
148+
The command below also assigns values to the variables `root_password`, `sudo_password`, and `api_token` for Ansible to reference later, as well as generates encrypted output:
149+
150+
```command
151+
ansible-vault encrypt_string '{{< placeholder "ROOT_PASSWORD" >}}' --name 'root_password'
152+
ansible-vault encrypt_string '{{< placeholder "SUDO_PASSWORD" >}}' --name 'sudo_password'
153+
ansible-vault encrypt_string '{{< placeholder "API_TOKEN" >}}' --name 'api_token'
154+
```
155+
156+
{{< note title="Use strong passwords" >}}
157+
When making root and sudo user passwords, it is a best practice to use a random password generator for security purposes. Save these passwords in a safe place for future reference.
158+
{{< /note >}}
159+
160+
1. Copy the generated outputs for `root_password`, `sudo_password`, and `api_token`, and save them in the `secret_vars` file located in `group_vars/jitsi/secret_vars`. Sample output:
161+
162+
```output
163+
root_password: !vault |
164+
$ANSIBLE_VAULT;1.1;AES256
165+
38306438386334663834633634363930343233373066353234616363356534653033346232333538
166+
3163313031373138383965383739356339663831613061660a666332636564356236656331323361
167+
61383134663166613462363633646330678356561386230383332313564643135343538383161383236
168+
6432396332643232620a393630633132336134613039666336326337376566383531393464303864
169+
34306435376534653961653739653232383262613336383837343962633565356546
170+
sudo_password: !vault |
171+
$ANSIBLE_VAULT;1.1;AES256
172+
38306438386334663834633634363930343233373066353234616363356534653033346232333538
173+
3163313031373138383965383739356339663831613061660a666332636564356236656331323361
174+
61383134663166613462363633646330356561386230383332313564643135343538383161383236
175+
6432396332643232620a393630633sdf32336134613039666336326337376566383531393464303864
176+
34306435376534653961653739653232383262613336383837343962633565356546
177+
api_token: !vault |
178+
$ANSIBLE_VAULT;1.1;AES256
179+
38306438386334663834633634363930343233373066353234616363356534653033346232333538
180+
3163313031373138383965383739356339663831613061660a666332636564356236656331323361
181+
6138313466316661346236363364567330356561386230383332313564643135343538383161383236
182+
6432396332643232620a393630633132336134613039666336326337376566383531393464303864
183+
34306435376534653961653739653232383262613336383837343962633565356546
184+
```
185+
186+
1. Using a text editor, open and edit the Linode instance parameters in the `group_vars/jitsi/vars` file. Replace the values for the following variables with your preferred deployment specifications:
187+
188+
- `ssh_keys`: Your SSH public key(s); replace the example keys with your own and remove any unused keys.
189+
- `jitsi_type`: Compute Instance type and plan for the Jitsi Meet instance
190+
- `jvb_type`: Compute Instance type and plan for each JVB instance
191+
- `region`: The data center region for the cluster
192+
- `group` and `linode_tags` (optional): Any [groups or tags](/docs/guides/tags-and-groups/) you wish to apply to your cluster's instances for organizational purposes
193+
- `soa_email_address`: An SOA administrator email for DNS records
194+
- `jvb_cluster_size`: The number of JVB instances in the cluster deployment
195+
- `sudo_username`: A sudo username for each cluster instance
196+
- `subdomain` and `subdomain` (optional): If you have a FQDN, you can use these optional values to customize your Jitsi meet URL. If you choose to leave these blank, you can navigate to your Jitsi meet using the Jitsi meet instance's default rDNS value once the cluster is provisioned. See our guide on [Managing IP Addresses](/docs/products/compute/compute-instances/guides/manage-ip-addresses/#viewing-ip-addresses) for how to find an instance's rDNS value.
197+
198+
```file {title="group_vars/jitsi/vars"}
199+
ssh_keys:
200+
- ssh-ed25519: {{< placeholder "YOUR_PUBLIC_KEY" >}}
201+
- ssh-rsa: {{< placeholder "YOUR_PUBLIC_KEY" >}}
202+
jitsi_prefix: jitsi
203+
jitsi_type: g6-dedicated-2
204+
jvb_prefix: jvb
205+
jvb_type: g6-dedicated-2
206+
region: us-southeast
207+
image: linode/ubuntu22.04
208+
group:
209+
linode_tags:
210+
soa_email_address: {{< placeholder "[email protected]" >}}
211+
jitsi_cluster_size: 1
212+
# jvb_cluster_size: 2
213+
sudo_username: {{< placeholder "SUDO_USERNAME" >}}
214+
215+
# domain vars
216+
# subdomain: {{< placeholder "YOUR_SUBDOMAIN" >}}
217+
# domain: {{< placeholder "YOUR_FQDN" >}}
218+
```
219+
220+
The `jvb_cluster_size` variable dynamically scales the cluster size. This variable determines how many Jitsi Videobridge instances are created in the initial deployment. This variable can be left commented out along with the `subdomain` and `domain` variables. These values are passed along using the `ansible-playbook` CLI during cluster provisioning.
221+
222+
See [Linode API: List Types](https://techdocs.akamai.com/linode-api/reference/get-linode-types) for information on Linode API parameters.
223+
224+
## Provision Your Cluster
225+
226+
1. Using the `ansible-playbook` utility, run the `provision.yml` playbook with verbose options to keep track of the deployment process. This creates Linode instances and dynamically writes the Ansible inventory to the hosts file. The playbook is complete when SSH is available on all deployed instances.
227+
228+
The command below uses the `jvb_cluster_size` variable to define the number of Jitsi Videobridge instances deployed in the cluster. Replace {{< placeholder "2" >}} with the number of instances you wish to include in your deployment. Replace {{< placeholder "YOUR_SUBDOMAIN" >}} and {{< placeholder "YOUR_FQDN" >}} with your subdomain and FQDN:
229+
230+
```command
231+
ansible-playbook -vvv provision.yml --extra-vars "jvb_cluster_size=2 subdomain={{< placeholder "YOUR_SUBDOMAIN" >}} domain={{< placeholder "YOUR_FQDN" >}}"
232+
```
233+
234+
If you are not using your own domain and wish to use the Jitsi meet instance's default rDNS value, remove the `subdomain` and `domain` variables from the command:
235+
236+
```command
237+
ansible-playbook -vvv provision.yml --extra-vars "jvb_cluster_size=2"
238+
```
239+
240+
1. Run the `site.yml` playbook with the hosts inventory file. This playbook configures and installs all required dependencies in the cluster.
241+
242+
```command
243+
ansible-playbook -vvv -i hosts site.yml --extra-vars "jvb_cluster_size=2 subdomain={{< placeholder "YOUR_SUBDOMAIN" >}} domain={{< placeholder "YOUR_FQDN" >}}"
244+
```
245+
246+
Likewise, if you are not using your own domain, remove the `subdomain` and `domain` variables:
247+
248+
```command
249+
ansible-playbook -vvv -i hosts site.yml --extra-vars "jvb_cluster_size=2"
250+
```
251+
252+
1. Once installation completes, visit the Jitsi meet application using your custom domain or the rDNS entry written to the `group_vars/jitsi/vars` file represented by the `default_dns` variable.
253+
254+
- **Example custom domain:** `https://{{< placeholder "YOUR_SUBDOMAIN.YOUR_FQDN" >}}`
255+
256+
- **Example rDNS entry:** `https://{{< placeholder "192-0-2-3" >}}.ip.linodeusercontent.com`
257+
258+
![Jitsi Meet Homepage](jitsi-meet-homepage.jpg "Jitsi Meet Homepage")
259+
260+
## Scaling options
261+
262+
Depending on your needs, you may wish to scale your Jitsi cluster up or down. To do this, use the `jvb_cluster_size` variable to manually add or remove JVB instances from the Jitsi cluster. Scaling your cluster up or down uses the same `ansible-playbook` command as when initially provisioning the cluster.
263+
264+
### Horizontal Up Scaling
265+
266+
To scale up your cluster size, use the `ansible-playbook` command and the `provision.yml` playbook with the new total number of JVB instances you want in the cluster. For example, if your initial cluster started with 2 instances and you would like to add 2 additional instances, edit the `jvb_cluster_size` variable to read {{< placeholder "4" >}}:
267+
268+
```command
269+
ansible-playbook -vvv provision.yml --extra-vars "jvb_cluster_size=4 subdomain={{< placeholder "YOUR_SUBDOMAIN" >}} domain={{< placeholder "YOUR_FQDN" >}}"
270+
ansible-playbook -vvv -i hosts site.yml --extra-vars "jvb_cluster_size=4 subdomain={{< placeholder "YOUR_SUBDOMAIN" >}} domain={{< placeholder "YOUR_FQDN" >}}"
271+
```
272+
273+
Once again, if you are not using a custom domain, remove the `subdomain` and `domain` variables from the above command:
274+
275+
```command
276+
ansible-playbook -vvv provision.yml --extra-vars "jvb_cluster_size=4"
277+
ansible-playbook -vvv -i hosts site.yml --extra-vars "jvb_cluster_size=4"
278+
```
279+
280+
### Down Scaling
281+
282+
Down scaling your cluster works similarly to scaling up. To scale down your cluster size, use the `ansible-playbook` command with the `resize.yml` playbook and the new number of JVB instances you wish to be in the cluster. For example, if your cluster has 4 instances and you would like scale down to 2 instances, edit the `jvb_cluster_size` variable to read {{< placeholder "2" >}}.
283+
284+
Note that the `resize.yml` playbook does not require a defined subdomain or domain:
285+
286+
```command
287+
ansible-playbook -vvv resize.yml --extra-vars "jvb_cluster_size=2"
288+
ansible-playbook -vvv -i hosts site.yml --extra-vars "jvb_cluster_size=2 subdomain={{< placeholder "YOUR_SUBDOMAIN" >}} domain={{< placeholder "YOUR_FQDN" >}}"
289+
```
290+
291+
If you are not using your own domain, remove the `subdomain` and `domain` variables from the second command above:
292+
293+
```command
294+
ansible-playbook -vvv resize.yml --extra-vars "jvb_cluster_size=2"
295+
ansible-playbook -vvv -i hosts site.yml --extra-vars "jvb_cluster_size=2"
296+
```
297+
298+
## Benchmarking Your Cluster With WebRTC Perf
299+
300+
[webrtcperf](https://github.com/vpalmisano/webrtcperf) is an open source utility used to evaluate the performance and quality for WebRTC-based services. To benchmark your Jitsi cluster's performance, WebRTC Perf can run from a Docker container. Note that Docker must be loaded and configured prior to running the below `docker run` command.
301+
302+
Replace {{< placeholder "https://192.0.2.3.ip.linodeusercontent.com" >}} with the domain or URL of your Jitsi meet instance (see: [Provision Your Cluster](#provision-your-cluster)), and replace {{< placeholder "ROOM_NAME" >}} with your meeting room name.
303+
304+
Edit the `sessions` and `tabs-per-session` values depending on the desired benchmarking criteria:
305+
306+
```command
307+
docker run -it --rm \
308+
-v /dev/shm:/dev/shm \
309+
ghcr.io/vpalmisano/webrtcperf \
310+
--url="https://192.0.2.3.ip.linodeusercontent.com/{{< placeholder "ROOM_NAME" >}}#config.prejoinPageEnabled=false" \
311+
--show-page-log=false \
312+
--sessions=6 \
313+
--tabs-per-session=1
314+
```
315+
316+
Press <kbd>q</kbd> to stop the WebRTC Perf benchmarking test.
119 KB
Loading

0 commit comments

Comments
 (0)