Chinaunix首页 | 论坛 | 博客
  • 博客访问: 550596
  • 博文数量: 469
  • 博客积分: 50
  • 博客等级: 民兵
  • 技术积分: 1495
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-15 21:04
文章分类

全部博文(469)

文章存档

2015年(81)

2014年(125)

2013年(261)

2012年(2)

分类: 架构设计与优化

2013-09-28 16:53:07

原文地址:crtmpserver组网方案 作者:andersonyan

A Powerful Live Streaming Setup
搭建强大的直播系统

Recently we had a project requiring live streaming setup, but wasn’t for sure what the load 
or client usage would be. The prerequisite was to be prepared for 1-1000 users watching the 
event live. Thus we developed this configuration to insure end users would have a good 
streaming experience. As we continue using this configuration, I’ll be sure to stop back 
and update any configuration changes…
最近,我们有项目要求搭建一套直播系统,但是不确定加载的内容和客户端将如何使用;
先决条件是要准备支持1-1000个用户可以观看这个直播;
因此,我们开发了这个配置来确保终端用户都能获得良好的观看体验;
如果持续使用这个配置,我们做一些更新支持;


Our idea was to stream the live event directly to a “master server” and then distribute it 
to a multitude of “Mirror Servers” in order to handle the load. We could use more or less 
Mirror Servers to accommodate the number of connections expected, and could also ramp up the 
servers if needed during the event. We are using cloud servers with a pre-saved image for the 
Mirror Servers to build from. We personally use Rackspace Cloud just because we’ve had very 
good experience with them and feel like their prices are very reasonable. They also allow us 
to save a server-image and pay pennies a month for its storage. We can then start up a server 
from that custom image in a matter of minutes, sometimes even seconds.
我们的目的是将直播事件发送到主服务器,
为了处理加载,将它分发到多个镜像服务器;
我们可以依据连接数的预计来增删镜像服务器;
也可以在直播事件中添加服务器;
我们使用云服务器在镜像服务器上预存储文件;
我们使用的是Rackspace 云, 因为它有很好的功能并且价格合理;可实现实时扩充;


In the scenario pictured above we are using Wirecast to encode on a computer and transmit the 
live feed to the master server. The master server is a very small cloud server that costs next 
to nothing to keep running all the time. (Approximately $15 a month) All unused ports are 
blocked off and Flash Media Live Encoder Authentication is activated to prevent hackers/morons 
from using the server for their own use. Public clients never actually connect to the master 
server, only mirror servers connect to the master server. Since the master server is always 
online, we know its IP address and can easily connect to it. It was important to us to be able 
to replicate servers on the fly from an image, and not have to change each one’s configuration 
or the master server configuration for the event. Each mirror server is configured to pull a RTMP 
stream from the master server, and then stream it to anyone who connects. When the mirror server 
boots up, it immediately starts running C++ RTMP server and the RTMP server immediately connects 
to the master and begins re-broadcasting the live feed.
在上图中,我们使用Wirecast将直播种子传输到主服务器;
主服务器是一个很小的云服务器,对于全天候运行的成本非常小; 
所有的未使用的端口都是阻塞的,并且FMLE有授权限制;
发布内容的客户端不会直接连到主服务器;只有镜像服务器连接主服务器中;
因为主服务器是一直在线的,我们知道它的IP地址所以很容易连接;
能将服务器配置复制到镜像服务器上去很重要,这样就不用去修改每个镜像服务器的配置;
每个镜像服务器配置成从主服务器上去拉流,然后分发给建立连接的客户;
当镜像服务器启动后,它将立即运行crtmpserver并且它马上连接主服务器开始提供直播服务;


Thanks to Andrei’s wonderful help. We compiled C++ RTMP server on the mirror servers with 
live streaming completely disabled, thus adding a second layer of protection to the 
configuration from people trying to utilize our servers for their own event.
我们在镜像服务器上编译了crtmpserver并完全禁用了直播流,
这样为别人未授权就使用我们的配置提供了第二层保护;


By using FlowPlayer, its cluster plugin, we are able to distribute the load of connections 
in a round robin configuration in order to insure no one mirror server is too overloaded.
通过使用FlowPlayer, 它的集群插件,我们可以对连接负载进行分配,
以保护镜像服务器不过载;


这个文档并没讲实际要如何用crtmpserver如何组网,
如果要组网的话首先得解决多服务器间的crtmpserver流如何传输;
然后就是服务器的通信实现控制;
如果没有什么更详细的文档,就只能自己开发啦!

第三卦:《屯卦》

 

屯:元,亨,利,贞;勿用有攸往,利建侯。

【白话】《屯卦》象征初生:元始,亨通,和谐,贞正。不要急于发展,首先要立君建国。

 

《象》曰:云雷屯,君子以经纶。

【白话】《象辞》说:《屯卦》的卦象是震(雷)下坎(水)上,为雷上有水之表象,水在上表示雨尚未落,故释为云。
云雷大作,是即将下雨的征兆,故《屯卦》象征初生。
这里表示天地初创,国家始建,正人君子应以全部才智投入到创建国家的事业中去。


阅读(577) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~