融合通信平台安装部署
1、 环境说明
序号 | IP | 系统版本 | cpu | 内存 | 硬盘 |
---|---|---|---|---|---|
1 | 172.27.54.65 | Ubuntu 22.04.4 LTS | 8c | 16G | 200G |
2 | 172.27.54.66 | Ubuntu 22.04.4 LTS | 8c | 16G | 200G |
安装中文语言包,并修改字符集为中文
apt install language-pack-zh-han* -y
update-locale LANG=zh_CN.UTF-8
mkdir /data_video/rtp
主机名配置
hostnamectl set-hostname ICC-UCS-test01 --static
2、安装
2.1 kamailio安装
2.1.1 依赖安装
apt install gcc g++ flex bison libmysqlclient-dev make autoconf pkg-config libssl-dev
apt install libcurl4-openssl-dev libxml2-dev libpcre3-dev unzip
apt install libjansson-dev libevent-dev libhiredis-dev
2.1.2 编译安装kamailio
mkdir /usr/local/kamailio
cd /data/package
unzip kamailio-5.6.5.zip -d /usr/local/src
cd /usr/local/src/kamailio-5.6.5
make PREFIX="/usr/local/kamailio" include_modules="avpops acc_json rtimer mqueue avp acc http_async_client http_client rtjson jansson ndb_redis dialog dispatcher ipops htable rtpengine nathelper jsonrpcs presence permissions auth_db auth counters cfg_rpc ctl sanity xlog siputils sdpops textopsx textops registrar usrloc maxfwd pv uac rr sl tmx tm corex kex xhttp_rpc xhttp db_mysql outbound" cfg
make install
ln -s /usr/local/kamailio/sbin/* /bin/
ln -s /usr/local/kamailio/etc/kamailio /etc/
2.2 rtpengine安装
2.2.1 依赖安装
apt install libpcap-dev libswresample-dev libavcodec-dev libopus-dev libspandsp-dev libavformat-dev
apt install libxmlrpc-core-c3-dev libwebsockets-dev libiptc-dev libavfilter-dev libjson-glib-dev
apt install gperf pandoc libncurses5-dev libncursesw5-dev libxtables-dev libbcg729-dev libglib2.0-dev
2.2.2 编译安装rtpengine
cd /data/package
unzip rtpengine-mr11.5.1.25.zip -d /usr/local/src/
cd /usr/local/src/rtpengine-mr11.5.1.25/daemon
make
make install
mkdir /etc/rtpengine
cp /usr/local/src/rtpengine-mr11.5.1.25/etc/* /etc/rtpengine/
# 加载内核模块
cd /usr/local/src/rtpengine-mr11.5.1.25/kernel-module
make && make install
modprobe xt_RTPENGINE
安装完成后注意修改配置文件vim /etc/rtpengine/rtpengine.conf
62 recording-dir = /data_video/recordings # 录音存储路径
63 recording-method = pcap # 录音存储方式
rtpengine启动内核转发vim /etc/sysctl.conf
# 永久启用 编辑/etc/sysctl.conf
net.ipv4.ip_forward = 1 # 添加保存并关闭文件
# 执行以下命令
sysctl -p
# 临时生效
echo 1 > /proc/sys/net/ipv4/ip_forward
2.3 FFmpeg安装
2.3.1 依赖安装
apt install cmake libass-dev libvorbis-dev libvpx-dev libvdpau-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev
apt install libfreetype6-dev libsdl2-dev libva-dev texinfo zlib1g-dev libnet-dev
2.3.2 nasm安装
mkdir /usr/local/ffmpeg
cd /data/package
tar xvfj nasm-2.15.05.tar.bz2 -C /usr/local/src/
cd /usr/local/src/nasm-2.15.05
./autogen.sh
./configure --prefix="/usr/local/ffmpeg" --bindir="/usr/local/ffmpeg/bin"
make
make install
2.3.3 安装yasm
cd /data/package
tar xvfz yasm-1.3.0.tar.gz -C /usr/local/src/
cd /usr/local/src/yasm-1.3.0/
./configure --prefix="/usr/local/ffmpeg" --bindir="/usr/local/ffmpeg/bin"
make && make install
2.3.4 安装x264
cd /data/package/
unzip x264-stable.zip -d /usr/local/src/
cd /usr/local/src/x264-stable/
export PATH="/usr/local/ffmpeg/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/ffmpeg/lib/pkgconfig"
./configure --prefix="/usr/local/ffmpeg" --bindir="/usr/local/ffmpeg/bin" --enable-static
make && make install
2.3.5 安装libx265
cd /data/package
tar xvfz x265_3.2.tar.gz -C /usr/local/src
cd /usr/local/src/x265_3.2/build/linux
export PATH="/usr/local/ffmpeg/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/ffmpeg/lib/pkgconfig"
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/usr/local/ffmpeg" -DENABLE_SHARED:bool=off ../../source
make
make install
2.3.6 安装FFmpeg
cd /data/package
tar xvfj ffmpeg-4.1.tar.bz2 -C /usr/local/src/
cd /usr/local/src/ffmpeg-4.1/
export PATH="/usr/local/ffmpeg/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/ffmpeg/lib/pkgconfig"
./configure --prefix="/usr/local/ffmpeg" \
--pkg-config-flags="--static" \
--extra-cflags="-I/usr/local/ffmpeg/include" \
--extra-ldflags="-L/usr/local/ffmpeg/lib" \
--extra-libs="-lpthread -lm" \
--bindir="/usr/local/ffmpeg/bin" \
--enable-gpl \
--enable-libass \
--enable-libfreetype \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree
make && make install
ln -s /usr/local/ffmpeg/bin/* /usr/bin/
ffmpeg -version
2.3.7 安装rtpbreak
cd /data/package
tar xvfz rtpbreak.tar.gz -C /usr/local/src/
cd /usr/local/src/rtpbreak/
mkdir -p /usr/local/rtpbreak/bin/
make
make install INSTALL_DIR="/usr/local/rtpbreak/bin/"
ln -s /usr/local/rtpbreak/bin/* /usr/bin/
2.4 应用部署
jdk安装
mkdir /usr/local/java
tar xvfz jdk-8u381-linux-x64.tar.gz -C /usr/local/java/
编辑文件vim /etc/profile
并在文件末尾添加以下内容
export JAVA_HOME=/usr/local/java/jdk1.8.0_381
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
重载环境变量
source /etc/profile
应用配置文件修改vim application.yml
# spring配置下的redis使用哨兵模式进行连接
spring:
redis:
sentinel:
master: mymaster # 哨兵监控的主节点名称
nodes:
- 172.27.54.65:26379
- 172.27.54.66:26379
- 172.27.54.67:26380
password: o^PZ&qilIFhUOL3R # 如果有密码,填写在这里
timeout: 10000
lettuce:
pool:
min-idle: 2
max-idle: 10
max-active: 20
max-wait: 2000
2.5 前端部署
3、安装错误统计
3.1 rtpengine安装后启动报错
加载内核模块即可
cd /usr/local/src/rtpengine-mr11.5.1.25/kernel-module
make && make install
modprobe xt_RTPENGINE
4、服务配置及启动
4.1 rtpengine配置修改及启动
4.2 kamailio配置修改及启动
4.3 应用配置及启动
4.5 前端启动
5、补充
5.1 防火墙策略调整
keepalived启动防火墙后脑裂问题处理
iptables -A INPUT -p vrrp -j ACCEPT
iptables -A OUTPUT -p vrrp -j ACCEPT
标签:rtpengine,ffmpeg,部署,make,dev,--,usr,local,kamailio
From: https://www.cnblogs.com/bzer/p/18474430