centos6.4 simple-rtmp-server流媒体集群服务器配置文档

Simple-RTMP-Server集群服务器初步配置文档

此次配置使用srs2.0 stable版本

配置环境 centos 6.4 软件版本 srs2.0 stable   srs下载地址:https://github.com/ossrs/srs

服务器:

origin  edge  10.0.1.1

edge  10.0.1.2

  1. 服务器镜像获取

wgt –S wget https://github.com/ossrs/srs/archive/2.0release.zip

编译系统

./configure  –prefix=/usr/local/srs

make && make install

安装命令会将SRS默认安装到/usr/local/srs中,可以在configure时指定其他目录,建立启动服务

2 编写10.0.1.1 SRS源站配置文件。

将以下内容保存为文件,譬如conf/origin.conf,服务器启动时指定该配置文件(srs的conf文件夹有该文件)。

# conf/origin.conf

listen              19350;

max_connections     1000;

pid                 objs/origin.pid;

srs_log_file        ./objs/origin.log;

vhost __defaultVhost__ {

}

3.编写10.0.1.1 SRS边缘配置文件。

将以下内容保存为文件,譬如conf/edge.conf,服务器启动时指定该配置文件(srs的conf文件夹有该文件)。

# conf/edge.conf

listen              1935;

max_connections     1000;

pid                 objs/edge.pid;

srs_log_file        ./objs/edge.log;

vhost __defaultVhost__ {

mode            remote;

origin          10.0.1.1:19350;

}

  1. 编写10.0.1.2 SRS边缘配置文件。

将以下内容保存为文件,譬如conf/edge.conf,服务器启动时指定该配置文件(srs的conf文件夹有该文件)。

# conf/edge.conf

listen              1935;

max_connections     1000;

pid                 objs/edge.pid;

srs_log_file        ./objs/edge.log;

vhost __defaultVhost__ {

mode            remote;

origin          10.0.1.1:19350;

}

 

  1. 启动SRS。详细参考RTMP分发

10.0.1.1

./objs/srs -c conf/origin.conf &&

./objs/srs -c conf/edge.conf

10.0.1.2

./objs/srs -c conf/edge.conf

  1. 启动推流编码器。详细参考RTMP分发

使用FMLE推流:

FMS URL: rtmp://10.0.1.1/live

Stream:sdtv

  1. 播放RTMP流

rtmp://10.0.1.1/live/sdtv

rtmp://10.0.1.2/live/sdtv

后续有待深入研究优化。