Srsデプロイメント・ノット

4891 ワード

インストール


[yum/apt-get] install wget perl ntp ntpdate vim

タイミング


ntpdate 0.cn.pool.ntp.org

ダウンロードsrs

    wget --no-check-certificate -c https://github.com/ossrs/srs/archive/v2.0-r5.tar.gz
    tar xzvf v2.0-r5.tar.gz
    cd srs-2.0-r5/trunk
    ./configure && make && make install

Srsメイン構成


プロファイルは/usr/local/srs/conf/srs.conf
# main config for srs.
# @see full.conf for detail config.

listen              16635;
max_connections     10000;
srs_log_tank        file;
srs_log_file        ./objs/srs.log;
http_api {
	enabled         on;
	listen          16685;
}
http_server {
	enabled         on;
	listen          16680;
	dir             ./objs/nginx/html;
}
stats {
	network         0;
	disk            sda sdb xvda xvdb;
}
vhost __defaultVhost__ {
	security{
		enabled         on;
		deny            play        all;
		allow           publish     all;
	}
	forward			128.1.201.x:16635 128.1.202.x:16635;
}


Srsスレーブ構成

# main config for srs.
# @see full.conf for detail config.

listen              16635;
max_connections     10000;
srs_log_tank        file;
srs_log_file        ./objs/srs.log;

vhost __defaultVhost__ {
	security{
		enabled         on;
		allow            play        all;
		deny           publish     all;
	}
}


最大オープンファイル数構成


変更/etc/security/limits.conf
* soft nofile 1048576
* hard nofile 1048576


ファイアウォールの構成

  • centos 6.9ファイアウォールサービスiptables statusオープンtcpポートiptables-I INPUT-p tcp--dport 16635-j ACCEPT iptables-I INPUT-p tcp--dport 16685-j ACCEPT iptables-p tcp--dport 16680-j ACCEPT保存構成service iptables save再起動有効service iptables restart
  • centos 7.4ファイアウォールfirewall-cmd--state firewall-cmd--list-allオープンtcpポートfirewall-cmd--zone=public--permanent--add-port=16635/tcp再起動service firewalld restart
  • 電源オン


    cp/usr/local/srs/etc/init.d/srs/etc/init.d/srs ln -sf/etc/init.d/srs/etc/rc3.d/S70srs