jitsivideobridge负载均衡搭建

写在前面如果我们使用官方教程快速安装了jitsi(包含jitsi-meet,prosody,jitsi-videobridge,jicofo,nginx)。是的,环境搭建起来了,但是如果生产环境上面想多人使用,这个配置或者负载还是支撑不来多少的。官方推荐的方式有两种,一种就是简单的对jitsi-videobridge(以下简称jvb)做负载,一种就是使用proxy,将整个jitsi-meet开始负载。目前我们使用的是将jvb做负载。 使用jvb做负载有什么好处之所以用jvb做负载,我们需要知道一点jitsi的基本知识:jitsi-meet,prosody,jvb,jicofo分别在jitsi中扮演什么角色? jitsi-meet: 前端模块,nginx直接转发过来到jitsi-meetprosody: xmpp协议服务器框架,jitsi是基于xmppjvb: 视频桥,负责所有视频在各个服务器中共享jicofo: 负责房间管理官网有介绍,我们如果需要有更多的音视频用户,需要将这几个数字调大: vim /etc/systemd/system.conf DefaultLimitNOFILE=65000 DefaultLimitNPROC=65000 DefaultTasksMax=65000使其生效:sudo systemctl daemon-reloadsudo systemctl restart jitsi-videobridge2检查是否生效: systemctl show --property DefaultLimitNPROC systemctl show --property DefaultLimitNOFILE systemctl show --property DefaultTasksMax但是当我们有更多的音视频会议用户进来的时候,可能这个也不够,那么我们就需要使用多个jvb来负载均衡了 多个ubuntu18上安装jvb负载均衡前提:你是基于官网教程快速安装我以两台机器为例子,一台上面就是按照官方快速搭建,在一个机器上面安装了prosody,jicofo,jvb,nginx,jitsi-meet等机子,一下简称JMS,另外我们还需要一台干净的ubuntu18的机子,以下简称JVB机器 首先,我们需要更新jvb补丁到最新版本echo 'deb https://download.jitsi.org stable/' >> /etc/apt/sources.list.d/jitsi-stable.listwget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add -apt-get install apt-transport-httpsapt updateapt upgrade在新的videobridge服务器JVB上设置防火墙ufw statusufw allow sshufw allow 443/tcpufw allow 4443/tcpufw allow 10000:20000/udpufw enable在第一个实例在JMS上运行的jitsi-meet服务器上设置防火墙ufw allow 5222/tcpufw reload在新的videobridge服务器JVB上安装jitsi-videobridgeapt -y install jitsi-videobridge2在JVB上进行安装期间,从jitsi-meet服务器(JMS)输入DNS名称查看/etc/jitsi/videobridge/configJVB上的文件,它应该类似下面的情况(注意你并不需要编辑,只是确认到目前为止走对了没有): # Jitsi Videobridge settings# sets the XMPP domain (default: none)JVB_HOSTNAME=<your jitsi-meet domain name which you entered during installation># sets the hostname of the XMPP server (default: domain if set, localhost otherwise)JVB_HOST=# sets the port of the XMPP server (default: 5275)JVB_PORT=5347# sets the shared secret used to authenticate to the XMPP serverJVB_SECRET=fg4t55z# extra options to pass to the JVB daemonJVB_OPTS="--apis=,"# adds java system props that are passed to jvb (default are for home and logging config file)JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi -Djava.util.logging.config.file=/etc/jitsi/videobridge/logging.properties"将值从jitsi-meet服务器(JMS)复制到JVB服务器:打开JMS的文件/etc/jitsi/videobridge/sip-communicator.properties,将所有内容复制到剪贴板,并将其粘贴到JVB服务器中的文件中/etc/jitsi/videobridge/sip-communicator.properties替换其中的所有其他文件,并且添加这个配置:org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=trueJVB上的内容应类似于: ...

July 3, 2020 · 2 min · jiezi