OpenRTMFP/Cumulus Primer(1)入门介绍与部署CumulusServer

本文是OpenRTMFP/Cumulus的入门介绍,涵盖背景、准备工作、安装、配置、启动及基本使用。重点讨论如何部署CumulusServer,包括依赖安装、配置文件设置和端口监听。同时,文章提及了CumulusServer的可扩展性,如Server Application的创建和动态更新。
摘要由CSDN通过智能技术生成

OpenRTMFP/Cumulus Primer(1)入门介绍与部署CumulusServer

  • 作者:柳大·Poechant
  • 博客:Blog.csdn.net/poechant
  • 邮箱:zhongchao.ustc@gmail.com
  • 日期:April 10th, 2012

1 背景介绍

OpenRTMFP 可以帮助你实现 Flash 的实时应用的高并发扩展,OpenRTMFP/Cumulus 是基于 GNU General Public License 的。

  • OpenRTMFP: Real Time Media Flow Protocol
  • POCO: POrtable COmponents,是一个强大的开源 C++ 库。其在 C++ 开发中的角色,相当于 Java Class Library、苹果的 Cocoa、.NET framework。

2 准备工作

下载:

External DependenciesOfficial SiteWindowsLinux/OSX
OpenSSLOfficial SiteDownloadDownload
LuaOfficial SiteDownloadDownload
POCOOfficial SiteDownloadDownload

注意:

  • POCO for linux: 版本必须是 1.4.0 或更高,否则会引起 TCP 相关的 bug。

3 安装

3.1 外部依赖的安装

Windows 下略,Linux 下基本就是:

./configure
make
sudo make install

3.2 安装 OpenRTMFP/Cumulus

OpenRTMFP-Cumulus/CumulusLib
make
cd ../CumulusServer
make

如果出现了.h文件、lib 库找不到的情况,请修改 OpenRTMFP-Cumulus/CumulusLib/Makefile 或 OpenRTMFP-Cumulus/CumulusServer/Makefile。

4 配置

通过编写OpenRTMFP-Cumulus/CumulusServer/CumulusServer.ini文件来为 OpenRTMFP-Cumulus 进行个性化配置(默认是没有这个文件的),这个文件的内容形如:

;CumulusServer.ini
port = 1985 
udpBufferSize = 114688
keepAlivePeer = 10
keepAliveServer = 15
[logs]
name=log
directory=C:/CumulusServer/logs

一些字段的设置含义如下,摘自:地址

  • 公开给 Client 的端口号:port, equals 1935 by default (RTMFP server default port), it’s the port used by CumulusServer to listen incoming RTMFP requests.
  • UDP 缓冲区字节数:udpBufferSize, allows to change the size in bytes of UDP reception and sending buffer. Increases this value if your operating system has a default value too lower for important loads.
  • keepAliveServer, time in seconds for periodically sending packets keep-alive with server, 15s by default (valid value is from 5s to 255s).
  • keepAlivePeer, time in seconds for periodically sending packets keep-alive between peers, 10s by default (valid value is from 5s to 255s).
  • edges.activated, activate or not the edges server on the RTMFP server (see CumulusEdge, Scalability page for more details about CumulusEdge). By default, CumulusServer stays a RTMFP server without edges ability (default value is false).
  • edges.port, port for the edges server, to accept incoming new CumulusEdge instances (see CumulusEdge, Scalability page for more details about CumulusEdge). By default, it’s the port 1936.

    Warning: This port will receive plain text request from edges, for this purpose it should not be made public. It’s very important for security consideration. It must be available only for CumulusEdge instances, and anything else.

  • edges.attemptsBeforeFallback, number of CumulusEdge attempt connections before falling back to CumulusServer (see CumulusEdge, Scalability page for more details about CumulusEdge). By default the value is 2 (in practical, 2 attempts happens after 5 sec approximately).
  • smtp.host, configure a SMTP host to use mails feature provided by Cumulus in server application (see Server Application, Sockets page for more details about mails feature). By default the value is localhost.
  • smtp.port, configure a SMTP port to use mails feature provided by Cumulus in server application (see Server Application, Sockets page for more details about mails feature). By default the value is 25.
  • smtp.timeout, configure a SMTP timeout session in seconds to use mails feature provided by Cumulus in server application (see Server Application, Sockets page for more details about mails feature). By default the value is 60 seconds.
  • 日志路径:logs.directory, directory where are written log files (CumulusServer/logs by default).
  • 日志文件名称:logs.name, name of log file (log by default).

5 启动

Windows 下的启动方法为:

CumulusServer.exe /registerService [/displayName=CumulusServer /description="Open Source RTMFP Server" /startup=automatic]

Unix-like 下的启动方法为:

sudo ./CumulusServer --daemon [--pidfile=/var/run/CumulusServer.pid]

如我的启动命令为:

sudo ./CumulusServer --daemon --pidfile=./CumulusServer.pid

6 基本使用

本地 Flash client 可以通过如下语句连接:

var nc:NetConnection = new NetConnection();
nc.connect("rtmfp://localhost/");

RTMFP默认是采用1935端口,如果你特别指定了其他端口,比如12345,请使用如下方式:

nc.connect("rtmfp://localhost:12345/");

7 扩展 CumulusServer——Server Application

启动CumulusServer后,会在可执行文件的目录下出现一个www目录,该目录的作用,就是作为 Server Application 的默认根目录。具体的对应关系如下:

rtmfp://host:port/                   ->     [CumulusServer folder]/www/main.lua (root application)
rtmfp://host:port/myApplication      ->     [CumulusServer folder]/www/myApplication/main.lua
rtmfp://host:port/Games/myGame       ->     [CumulusServer folder]/www/Games/myGame/main.lua

另外要提醒的是,如果main.lua文件被修改,则不需要重启CumulusServer,因为 Server Application 的创建是一种动态的方式。

CumulusServer 的详细扩展方式会在下一篇文章中介绍。

-

转载请注明来自柳大的CSDN博客:Blog.csdn.net/poechant

-

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 18
    评论
您好,以下是Cumulus交换机配置V-STP的步骤: 1. 首先,确认您的交换机支持V-STP功能,并且已经启用了STP协议。 2. 进入交换机的配置模式。 3. 输入以下命令启用V-STP功能: ``` switch(config)# spanning-tree protocol-version rstp-mst switch(config)# spanning-tree vlan 1-4094 mode mstp ``` 其中,vlan 1-4094表示启用所有VLAN的MSTP模式。 4. 配置V-STP实例。您可以为每个VLAN配置一个实例,或者将多个VLAN分配到同一个实例中。 ``` switch(config)# spanning-tree mst configuration switch(config-mst)# name instance1 switch(config-mst)# revision 1 switch(config-mst)# instance 1 vlan 10-20 switch(config-mst)# instance 2 vlan 30-40 ``` 其中,instance1表示实例名称,revision 1表示版本号,vlan 10-20和vlan 30-40表示将这些VLAN分配到实例1和实例2中。 5. 配置V-STP端口。将每个端口配置为所属的VLAN和实例。 ``` switch(config)# interface swp1 switch(config-if)# switchport switch(config-if)# switchport mode trunk switch(config-if)# switchport trunk allowed vlan 10-20 switch(config-if)# spanning-tree mst instance 1 vlan 10-20 ``` 其中,swp1表示端口名称,switchport mode trunk表示将端口配置为trunk模式,switchport trunk allowed vlan 10-20表示允许VLAN 10-20通过该端口,spanning-tree mst instance 1 vlan 10-20表示将该端口配置为实例1中的VLAN 10-20。 6. 最后,保存并应用配置。 ``` switch# save switch# exit ``` 以上就是在Cumulus交换机上配置V-STP的步骤,希望能对您有所帮助。
评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

钟超

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值