AceStream 3.0/en
Contents
Where to download
You can download the latest alpha-versions of the engine here:
- Ubuntu 12 amd64: http://dl.acestream.org/ubuntu/12/acestream_3.0.0-a5_ubuntu_12_amd64.tar.gz
- CentOS 6 amd64: http://dl.acestream.org/centos/6/acestream_3.0.0-a5_centos_6_amd64.tar.gz
Changelog
3.0.0-a5
- start nodes are added
3.0.0-a2
- support nodes are added
- options for configuration of private nodes and schemes of distribution of traffic between support nodes and a source are added
3.0.0-a1
- the first alpha-version
How to launch without deleting an old version
Alpha-version can be launched on a server simultaneously with any release version.
For the launching you need to:
- download archive for your OS
- unpack archive in any folder (for example, /opt/acestream/engine_new)
- launch acestreamengine file in the unpacked folder with a parameter --lib-path /path/to/acestream_libraries. Example:
/opt/acestream/engine_new/acestreamengine --lib-path /opt/acestream/engine_new
Parameter --lib-path sets the path to Ace Stream libraries. By default the path /usr/share/acestream is used. If the release version of the engine is already installed on the server, it will be launched without specifying the parameter --lib-path. To know for sure which version was launched, you can check the version from command line. For example, if version 2.1.6 is already installed, the result without specifying --lib-path will be following:
# /opt/acestream/engine_new/acestreamengine --version version: 2.1.6 revision: 293
With specifying --lib-path a new version will be launched:
# /opt/acestream/engine_new/acestreamengine --lib-path /opt/acestream/engine_new --version version: 3.0.0-a1 revision: 565
Launch on CentOS
On CentOS there are some features of the engine launch.
Standard library openssl on CentOS do not support some necessary for the engine functions. In this regard, together with the engine for CentOS there is a recompiled library openssl and module python-m2crypto, which is superstructure over openssl. These libraries are in the folder usr in archieve with the engine. To use them you have to copy folders "lib64" and "local" from the folder "usr" into appropriate folders in /usr. If the engine of the previous version is installed on the server, these libraries are in your system and there is no need to copy them.
To launch the engine under CentOS script start.sh is used instead of acestreamengine in the folder with the engine.
This script sets an environment variable LD_LIBRARY_PATH=/usr/local/ssl/lib before the engine launch, so the recompiled version of the library openssl was used.
Also this script automatically passes the path to libraries to the engine through the parameter --lib-path, so there is no need to specify it additionally.
Changes in launch parameters
In a new version there are some differences on launch parameters.
New flags for the engine launch in different modes
- --stream-source-node (instead of --stream-source)
- --stream-support-node (instead of --stream-node)
New parameters for setting up cache
- --live-cache-type (string) - cache type: disk - store the cache on the disk in the folder specified by parameter --cache-dir, memory - store the cache in random-access memory (by default: disk)
- --live-cache-size (integer) - maximum size of the cache in bytes (by default: 209715200 bytes (200 Mb))
New parameters for configuration of support nodes infrastructure
- --private-node (0 or 1) - if you specify 1, the node will be private (by default: 0)
- --download-from (string) - add the address to a list of nodes from which this node is allowed to receive data. The address must be specified in a format ipv4_address:port. This parameter may occur more than once.
- --upload-to (string) - add the address to the list of nodes to which this node is allowed to give data. The address must be specified in a format ipv4_address:port. This parameter may occur more than once.
- --monitor-node-ip (string) - ipv4 address of monitoring-server
New parameters to launch the source
- --metatracker (string) - add the address of metatracker to the transport file
These parameters are not used any more
- --stream-source (is changed to --stream-source-node)
- --stream-node (is changed to --stream-support-node)
- --add-authorized-peers (list of authorized peers is not added to transport file any more)
- --private-source (is changed to --private-node)
- --support-node
- --source-node
- --allow-source-download
- --allow-support-download
- --allow-peers-download
New functional
Setting up support nodes
In a new version it is necessary to explicitly specify to support nodes from which nodes they have to download data. For this, parameter --download-from is used. A list of nodes, from which downloading is allowed, can be changed without restarting support node through node's web-interface (look below). For example, if node-source is launched by address 192.168.1.2:7764 and we want to launch support node which loads data only from the source, a command to launch support node will be following:
acestreamengine \ --stream-support-node \ --url http://192.168.1.2/transport/test.acelive \ --port 8631 \ --download-from "192.168.1.2:7764"
Private nodes
Private node gives data only to nodes that explicitly are added to its list of allowed. In order to make a node private you have to launch it with a parameter --private-node 1. To add the address to the list of allowed to upload a parameter --upload-to is used. Both, node-source and support node, can be private. Private node repulses incoming connections from all addresses except specified by parameters --download-from, --upload-to and --monitor-node-ip. To filter only ip-address is used (port is not used). Parameter --monitor-node-ip sets ip-address of the monitoring server and is used in case if there is a need to provide monitoring of the private node (without specifying this parameter private node will repulse all requests from the monitoring server).
Example of launching the private source which will give data only to support node from the previous example:
acestreamengine \ --stream-source-node \ --port 7764 \ --source "http://brodilo.tv/channel.php" \ --name "test" \ --title "test" \ --bitrate 350000 \ --publish-dir /var/www/transport \ --cache-dir /var/cache/acestream \ --private-node 1 \ --upload-to "192.168.1.3:8631"
Стартовые узлы
Стартовый узел предназначен для обеспечения максимально быстрого старта трансляции у пользователей.
Особенность работы стартового узла - постоянная ротация соединений. При получении новых входящих соединений стартовый узел разрывает соединения с узлами, которые подключились ранее и уже скачали определенный объем данных.
Для запуска движка в режиме стартового узла используется параметр --stream-startup-node.
Стартовый узел принимает такой же набор параметров, как и узел поддержки.
Пример запуска стартового узла:
acestreamengine \ --stream-startup-node \ --url http://192.168.1.2/transport/test.acelive \ --port 8632 \ --download-from "192.168.1.2:7764"
Метатрекеры
Метатрекер - это сервер, который сообщает узлам о доступных трекерах и стартовых узлах.
URL метатрекера задается на источнике при создании трансляции и записывается в транспортный файл.
Метатрекеры позволяют динамически добавлять трекеры и/или стартовые узлы для трансляции без необходимости перезапуска трансляции и пересоздания транспортного файла.
Пример запуска источника с метатрекером:
acestreamengine \ --stream-source-node \ --port 7764 \ --source "http://brodilo.tv/channel.php" \ --metatracker "http://example.org/metatracker.php" --name "test" \ --title "test" \ --bitrate 350000 \ --publish-dir /var/www/transport \ --cache-dir /var/cache/acestream \ --private-node 1 \ --upload-to "192.168.1.3:8631"
Метатрекер принимает запросы по протоколу HTTP и выдает ответ в формате JSON, поэтому метатрекер может быть реализован на базе любого веб-сервера.
Каждый узел при запуске трансляции отправляет на метатрекер HTTP GET запрос с параметром infohash (хеш трансляции в виде hex-строки). Пример запроса на метатрекер:
http://example.org/metatracker.php?infohash=a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
Формат ответа:
{ "trackers": ["tracker_url_1", "tracker_url_2", ...], "startup_nodes": ["node1_address", "node2_address", ...], "interval": UPDATE_INTERVAL_IN_SECONDS }
где
- tracker_url_1, tracker_url_2 - URL трекеров
- node1_address, node2_address - адреса стартовых узлов в виде строк в формате ip:port (например, 192.168.1.2:8632)
- UPDATE_INTERVAL_IN_SECONDS - интервал обновления в секундах (как часто каждый клиент должен повторно обращаться на метатрекер)
Пример ответа:
{ "trackers":["udp:\/\/tracker.example.org:2710\/announce"], "startup_nodes":["192.168.1.2:8632"], "interval":3600 }
Пример серверного кода метатрекера на PHP:
<?php $infohash = isset($_GET['infohash']) ? $_GET['infohash'] : ''; $trackers = array( 'udp://tracker.example.org:2710/announce', ); $startup_nodes = array( '192.168.1.2:8632', ); $data = array( 'trackers' => $trackers, 'startup_nodes' => $startup_nodes, 'interval' => 30, ); header('Content-Type: application/json'); echo json_encode($data);
Веб-интерфейс узла
Мониторинг
скоро будет
Управление
скоро будет