3 Star 6 Fork 4

winlinvip / srs.wiki

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
v3_EN_OriginCluster.md 2.75 KB
一键复制 编辑 原始数据 按行查看 历史
winlinvip 提交于 2022-01-06 11:57 . Update

HOME > EN > OriginCluster

OriginCluster

Design

About the design of Origin Cluster, please read the Issue#464. SRS Origin Cluster is designed for large amount of streams.

Remark: Origin cluster only supports RTMP, use Edge to transmux RTMP to FLV.

Config

The config for origin cluster:

vhost __defaultVhost__ {
    # The config for cluster.
    cluster {
        # The cluster mode, local or remote.
        #       local: It's an origin server, serve streams itself.
        #       remote: It's an edge server, fetch or push stream to origin server.
        # default: local
        mode            local;

        # For origin(mode local) cluster, turn on the cluster.
        # @remark Origin cluster only supports RTMP, use Edge to transmux RTMP to FLV.
        # default: off
        # TODO: FIXME: Support reload.
        origin_cluster      on;

        # For origin (mode local) cluster, the co-worker's HTTP APIs.
        # This origin will connect to co-workers and communicate with them.
        # please read: https://github.com/ossrs/srs/wiki/v3_EN_OriginCluster
        # TODO: FIXME: Support reload.
        coworkers           127.0.0.1:9091 127.0.0.1:9092;
    }
}
  • mode: The mode of cluster, it should be local for origin cluster.
  • origin_cluster: Whether enable origin cluster.
  • coworkers: The HTTP APIs of other origin servers in the cluster.

Remark: Say, a client, a player or edge server, starts to play a stream from a origin server. The origin server would query the coworkers and redirect client by RTMP302 when it doesn't serve the stream. If no origin is found, it responses error. The HTTP API response message includes fields for whether owns the stream, and stream information.

Remark: Note in particular that server response error when the requested stream hasn't been publish to origin server. For independent origin server, server responses success and waits for stream to be published. While when origin in origin cluster, as the stream might not be published to it, it should responses error and shouldn't wait for the stream.

Usage

To use origin cluster, please read #464.

We also recommend to use a edge server please read here. The edge server can transmux RTMP to HTTP-FLV, supports fault-tolerance.

2018.02

1
https://gitee.com/winlinvip/srs-wiki.git
git@gitee.com:winlinvip/srs-wiki.git
winlinvip
srs-wiki
srs.wiki
master

搜索帮助