- SRS Wiki 首页
- SRS Arch
- ARM转码
- 带宽测试
- 安装
- 客户端 SDK
- 开源的客户端 SDK
- DeliveryHDS
- Delivery HLS
- Delivery HTTP FLV Stream
- Delivery Method
- 分发 RTMP 流
- HttpServer
- DRM
- DVR
- Edge Server
- 功能列表
- Live Streaming Transcode
- 点播 FLV 流
- Forward For Small Cluster
- GIT
- GPERF 内存和性能分析
- gprof 性能分析
- 心跳
- SRS 支持 HEVC 编码
- SRS 简介
- HTTP API
- HTTP Callback
- SRS Embeded HTTP Server
- 集成开发环境
- 采集
- K8S
- Kafka
- SRS 系统服务
- LiveShow
- LogRotate
- 低延时直播应用
- Exec
- OriginCluster
- Perf性能分析
- Performance Banchmark
- Project
- Performance benchmark for SRS on RaspberryPi
- Reload
- REUSE PORT
- WebRTC
- ATC支持HLS/HDS热备
- 分发方式比较
- RTMP Handshake
- URL Specification
- Use Scenarios
- ARM上部署SRS实例
- DASH部署实例
- Demo的部署
- FFMPEG转码部署实例
- RTMP流转发(Forward)部署实例
- HLS部署实例
- SRS-HTTP服务部署实例
- SRS-HTTP-FLV部署实例
- SRS-HTTP-FLV集群部署实例
- Ingest采集实例
- RTMP源站集群部署实例
- RTMP低延时配置
- RTMP部署实例
- RTMP边缘集群部署实例
- SRT deploy example
- 转码后分发HLS部署实例
- Security
- 服务器端开发脚本
- 开始使用
- Snapshot
- SpecialControl
- SRS提供的librtmp
- SRS for linux-arm
- SRS Log System
- SRT媒体编码支持格式
- SRT参数配置
- SRT直播地址格式简介
- SRT
- Streamer
- TimeJitter
- Web P2P
- Windows下的SRS
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
心跳
嵌入式设备上,只能运行SRS时,其他的业务系统可能需要知道这个设备的ip等信息,SRS可以以http方式主动汇报给api服务器。
编译
要求编译时支持http-parser,即开启了下面任何一个选项即支持:
- --with-http-api HTTP接口。
- --with-http-server HTTP服务器。
- --with-http-callback HTTP回调。
配置
在全局配置以下信息即可以开启心跳:
# heartbeat to api server
# @remark, the ip report to server, is retrieve from system stat,
# which need the config item stats.network_device_index.
heartbeat {
# whether heartbeat is enalbed.
# default: off
enabled on;
# the interval seconds for heartbeat,
# recommend 0.3,0.6,0.9,1.2,1.5,1.8,2.1,2.4,2.7,3,...,6,9,12,....
# default: 9.9
interval 9.3;
# when startup, srs will heartbeat to this api.
# @remark: must be a restful http api url, where SRS will POST with following data:
# {
# "device_id": "my-srs-device",
# "ip": "192.168.1.100"
# }
# default: http://127.0.0.1:8085/api/v1/servers
url http://127.0.0.1:8085/api/v1/servers;
# the id of devide.
device_id "my-srs-device";
# whether report with summaries
# if true, put /api/v1/summaries to the request data:
# {
# "summaries": summaries object.
# }
# @remark: optional config.
# default: off
summaries off;
}
# system statistics section.
# the main cycle will retrieve the system stat,
# for example, the cpu/mem/network/disk-io data,
# the http api, for instance, /api/v1/summaries will show these data.
# @remark the heartbeat depends on the network_device_index,
# for example, the eth0 maybe the device which index is 0.
stats {
# the index of device ip.
# we may retrieve more than one network device.
# default: 0
network 0;
# the device name to stat the disk iops.
# ignore the device of /proc/diskstats if not configed.
disk sda sdb xvda xvdb;
}
注意:enabled默认是off的,必须打开才行。
注意:需要配置stats中的设备索引,获取正确的ip。
默认SRS会将设备内网IP(在stats中配置设备的索引),设备名POST到url指定的地址。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论