Skip to content

Getting Started with Flussonic Central

This article contains tips to help you get started with Flussonic Central.

You will learn:

You can access Flussonic Central via web interface as well as Flussonic Central API.

Prerequisites

Before you proceed to install Flussonic Central:

  1. Update Flussonic Media Server on the streamers (peers) to the latest version. Make sure that cluster-key and http port are specified in their config.
  2. Create and configure the database following the steps below. Recommended version is PostgreSQL 14.4.

Install and start Flussonic Central

To install Flussonic Central on the server:

  1. Run the following commands in the terminal:

    echo "deb http://apt.flussonic.com/repo binary/" > /etc/apt/sources.list.d/flussonic.list

    wget http://apt.flussonic.com/binary/gpg.key -O /etc/apt/trusted.gpg.d/flussonic.gpg

    apt-get update && apt-get install flussonic-central

  2. After successfully installing Flussonic Central, open the configuration file /etc/central/central.conf and set the required parameters:

    • DATABASE_URL is a connection string to your PostgreSQL database. Make sure to replace the default login and password to those you set when installed PostgreSQL.

      If your database requires SSL support, specify the sslmode parameter in the URI string with one of the possible values: disable, prefer or require like that: postgres://central:pass@localhost:5432/central_dev?sslmode=prefer&search_path=central. The parameter values correspond to the sslmode in libpq.

    • API_KEY is an API key necessary for Flussonic Central to communicate with other Flussonic servers. Set any value at your discretion.

    • API_URL is a URL formatted as http://CENTRAL-HOSTNAME:PORT that is used for making config_external URL that is provisioned to streamers referring to Flussonic Central for configuration.

    • EDIT_AUTH is administrator login and password of your Flussonic Central server that you will need to access the web UI. If you do not plan to use the web interface, then this parameter can be omitted.

  3. You can also specify a different HTTP port number (HTTP_PORT) than the default 9019, for example if it is already in use. Please note that this port should be used in API_URL.

  4. Save the changes and exit the editor.

    Warning

    After you make changes to the configuration file in the future, make sure to restart the Flussonic Central by running the service central restart command to apply the changes.

  5. Start the Flussonic Central service by running the following command in the terminal:

    service central start

  6. Open the Flussonic Central administrator web interface using the following link:

    http://CENTRAL-HOSTNAME:PORT_NUMBER/admin

    where

    • CENTRAL-HOSTNAME is the IP address or URL of the server where Flusssonic Central is installed
    • PORT_NUMBER is the number of HTTP port specified in http_port variable.
  7. In the opened window, specify login and password of the Flussonic Central server and click Sign to log in to the server:

Central start page

You should see the Flussonic Central web interface:

Flussonic Central web interface

Running Flussonic Central in a Docker container

Execute the following command to run Flussonic Central in Docker:

docker run flussonic/central:latest

Use the environment variables of the same name as the settings in the configuration file to configure your containerized Flussonic Central.

Connect a streamer

To connect a streamer to Flussonic Central:

  1. Open the sidebar navigation menu to the left, go to the Streamers section and click + to add a new streamer.

  2. Type the unique name of the streamer you would like to connect in the New streamer hostname field. If using special characters, URL-encode them.

  3. Click Save to apply the changes. The settings of the created streamer are displayed.

  4. In the API URL field, enter the address of Flussonic Media Server streamer as http://FLUSSONIC_HOSTNAME:HTTP_PORT. Flussonic Central will use this address to send API requests to the streamer.

    If you use an API URL that is only accessible from your local network, make sure to specify a publicly accessible address in the Public payload URL field so that the streams could be accessed over the Internet.

    If no API URL is specified, Flussonic Central will try to use Hostname to access the streamer.

  5. Specify the cluster key in the Cluster key field. The same cluster key should be specified in the configuration of the Flussonic Media Server streamer that you want to connect.

  6. Click Save to apply the changes. If all parameters are set correctly, Flussonic Central will connect to the streamer and add config_external option to its configuration so that Flussonic Media Server could receive the configuration from Flussonic Central. If the config_external option does not appear in the streamer's configuration file, check your settings or contact support.

  7. Go back to the Flussonic Central web interface, open the Streamers section and click the Overview tab, where the streamer health should be displayed. Make sure that the streamer is connected.

Overview tab

Create a stream

To create a stream in Flussonic Central, you can use both admin web interface and Flussonic Central API.

Note

After a stream has been created, it is started on one of the randomly selected streamers connected to Flussonic Central. You can select a preferable streamer in the stream settings.

Warning

The stream configuration defined in Flussonic Central will not be written in the configuration file of the Flussonic Media Server on which the stream is running. The active stream will only be displayed on the server web interface and will be accessible via an API request.

Create a stream via web interface

To create a stream via web interface:

  1. Go to the Media section of the sidebar navigation menu.

  2. Click on the Add stream button and specify the name of your stream in the Stream name field and the source in the Source URL field. Then click Create to apply the changes.

    Creating a stream

  3. Go to the Streams tab and make sure your stream is up and running.

    Active stream

Use URLs on the Output tab in the stream profile to play the stream.

Create a stream using the API

To create a stream, use the PUT /streams/{name} method from the Flussonic Central API.

Here is the example of a simple PUT request to create a stream:

curl --request PUT --url http://CENTRAL-IP:CENTRAL_PORT/streamer/api/v3/streams/STREAM_NAME \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json' \
--data '{"name": "STREAM_NAME", "inputs": [{"url": "fake://fake"}]}'

Note

This request can be used to both create and modify the stream, so the stream name is specified twice: in the path and in the request body. If you specify different name values in the path and in the body, then the one in the body takes precedence.

The following response will be returned:

{"config_on_disk":{"inputs":[{"url":"fake://fake"}],"name":"STREAM_NAME"},"inputs":[{"url":"fake://fake"}],"name":"STREAM_NAME","named_by":"config"}

Creating a PostgreSQL database

To create a PostgreSQL database:

  1. Install PostgreSQL according to the instructions on the website.

  2. After successfully installing PostgreSQL, create a user by running the following command in the terminal:

    sudo -u postgres -i createuser -P central

    The system will then ask you to set a password that the user will have two times in a row:

    Caution

    Both login and password must NOT include any of the following characters: @, ;, #, [, \, /, =, $

    Enter password for new role: (think up and specify the password of the superuser of the database) Enter it again: (repeat the password for the superuser)

  3. Create a database with the superuser created at the previous step as the owner:

    sudo -u postgres -i createdb -O central -e -E UTF8 -T template0 central_dev

    If database is created successfully, the system's response will be as follows:

    CREATE DATABASE central_dev OWNER central ENCODING 'UTF8' TEMPLATE template0;