Flussonic Watcher documentation

Installing Watcher

Flussonic Watcher can work both in cluster (multi-server) mode and in single-server mode. Watcher is installed in almost the same way regardless of the mode (single or cluster).

Watcher supports small to medium to large projects with unlimited number of cameras. The number of cameras is limited only by hardware.

When working in a cluster of servers, Watcher ensures the fault-tolerance of stream ingest (failover).

Watcher uses the PostgreSQL database engine.

Important! Watcher is installed from the package flussonic-watcher and Flussonic Media Server and the database are automatically installed with Watcher.

Comparing Watcher сluster with Watcher single

  • Watcher Cluster supports UI branding tools (adding your custom logo, choosing your custom colors, etc.)
  • Watcher Cluster can work with special firmware for cameras — Flussonic Agent, or simply Agent. Agent makes cameras accessible from behind NAT and greatly simplifies setting up the entire infrastructure. With Agent, you can add cameras in plug-and-play mode. This firmware improves the stability of video delivery and implements data encryption directly from cameras to streaming servers. To start using this firmware, contact our manager who leads your project.
  • Single-server mode is suitable for small and medium-size projects, where the maximum number of cameras does not exceed 500.

Servers' configuration

If your poject is small (less than 500 IP cameras) and you don't need a cluster of streaming servers, just install Watcher on a single server. In single-server mode, all cameras are connected to a single server, where Flussonic Watcher, Flussonic Media Server and the database are installed, the web interfaces works, streams are ingested, and the archive is written.

The cluster requires at least two servers:

  • The managing server (endpoint). It has the web interface to Watcher, Flussonic Media Server, the business logic, and the PostgreSQL database engine. Watcher works the managing server only.

  • Streaming servers (streamers). A streamer is a server machine that has Flussonic Media Server installed. It stores DVR archives and handles camera streams. You can add from 1 to 100 streaming servers.

All servers must have public IP addresses and the same cluster key (specified in the Flussonic settings). In addition, the host name of the management server must resolve to the IP address.

The following picture shows the parts of cluster and the flow of video streams:

Watcher cluster

Installation main steps

To install Watcher:

  1. Install Flussonic Watcher on the managing server. PostgreSQL and Flussonic Media Server are installed automatically together with Watcher.

  2. Specify the path to PostgreSQL in the administrator UI of Flussonic Media Server.

  3. Create a user with Watcher administrator privileges by using the Watcher's administrator UI.

That's all for a single-server Watcher.

If you plan to create a cluster, after you've done steps 1-3 continue the installation with the following steps:

  1. Install Flussonic Media Server on all streaming servers.

  2. Create a cluster and register streamers in Watcher by using the Watcher's administrator UI.

All the steps are described later on this page.

On how to update Watcher, see the section Updating Flussonic Watcher.

Installing Flussonic Watcher Anchor Anchor x2

  1. On the server where you plan to run Watcher execute the command:

    curl -sSf https://flussonic.com/raw/install_watcher.sh | sh
    

    After successful installation, the system advises you to start PostgreSQL and suggests the command to do so. Do not start PostgreSQL yet, go to the next step - user creation.

  2. Create the user and the database. First, create the user vsaas by typing this command:

    sudo -u postgres -i createuser -P vsaas
    

    The system will prompt you to enter the password that will be used for the user vsaas:

    Enter password for new role: (come up with and enter Watcher super admin password)
    

    Type the password again for confirmation:

    Enter it again: (re-enter Watcher super admin password)
    
  3. Create the database vsaas_production with the created user vsaas as the owner:

    sudo -u postgres -i createdb -O vsaas -e -E UTF8 -T template0 vsaas_production
    

    The system's response if the database was created successfully:

    CREATE DATABASE vsaas_production OWNER vsaas ENCODING 'UTF8' TEMPLATE template0;

  4. In the Flussonic's web UI (http://flussonic:8080/admin), go to IP cameras and specify the path to the database in the Database path box.

    Important. Replace VSAAS_PASSWORD with the real password of the vsaas user that you created in previous steps.

    Path to Watcher database

  5. For cluster only: Add the mode cluster option in the configuration file /etc/flussonic/flussonic.conf:

    vsaas {
      database postgresql://vsaas:vsaas_password@localhost/vsaas_production;
      endpoint enabled;
      mode cluster;
    }
    

    After editing the file restart Flussonic Media Server with the command:

    service flussonic restart
    
  6. Finally, go to the the Flussonic UI in the browser.

    Now if you go to the main page of the Flussonic UI http://FLUSSONIC:8080, the Watcher's web interface will open instead of Flussonic's.

    To return to the Flussonic Media Server UI, go to http://FLUSSONIC:8080/admin.

Now it's time to create the Watcher main administrator.

Creating the Watcher administrator Anchor Anchor x2

Go to http://FLUSSONIC:8080 and the administrator control panel opens (we also call it the Watcher web UI). On the very first launch, the system will ask you to enter the login and come up with the password to create the first Watcher's administrator account.

Installing Watcher - create the admin

The installation for single-server mode is now complete.

If you want to create a cluster, you will need to prepare streamers and set up Watcher to work as part of a cluster (see next steps).

(For cluster mode only) Installing Flussonic Media Server on streamers Anchor Anchor x2

Flussonic Media Server is installed on all streaming servers.

Run the command:

curl -sSf https://flussonic.com/raw/install.sh | sh

Now start Flussonic Media Server:

/etc/init.d/flussonic start

Learn more about installation of Flussonic Media Server in the Flussonic documentation:

On each streamer set up HTTPS and specify the cluster key in Flussonic's settings – see Create a cluster below.

(For cluster mode only) Creating a cluster (multiple server mode) Anchor Anchor x2

Creating a cluster means to add streamers (streaming servers) in the settings of Flussonic Watcher. It is necessary to add at least one streamer on which IP cameras are added to configuration. This will allow you to start taking video from cameras in cluster mode.

The UI page Settings > Streamers is essential for the cluster.

Pre-conditions

  1. For each streamer, install Flussonic Media Server on a separate server, which will act as a streamer. In other words, besides the server with Flussonic Watcher, you must have at least one other server with a public IP address and Flussonic Media Server installed.

  2. After you install Flussonic on a streamer, immediately change the administrator's login and password on each streamer.

  3. Configure HTTPS on each streamer. It is enough to set the port for HTTPS, and Flussonic will use self-signed SSL certificates.

  4. Set identical date and time on the managing server and on each streamer.

  5. In each streamer settings (on the managing server), specify cluster_key (the key must be the same as the cluster key for Flussonic Watcher). Learn more.

  6. Configure the DNS zone for the managing server.

For cluster only: For Watcher to work correctly in a cluster, you need to add the A record in the DNS zone settings for your domain, where you specify the host name. This hostname must also be registered in the operating system on the server with Flussonic Watcher (the managing server). This is necessary for streamers to access the managing server.

To check that the hostname resolves, run on the managing server the command hostname — it must return the correct hostname specified in the DNS settings, for example, example.com.

When the server intended to stream video from cameras is ready for work, you need to add it in the settings of Flussonic Watcher.

Adding streamers to Watcher

  1. Log in to Flussonic Watcher as the administrator.
  2. Go to Settings > Streamers and click the "+" icon to add a streamer:
    • Hostname – the domain name of the streaming server. Example: streamer2.example.com
    • Cluster key – the cluster key used in the cluster (the cluster_key option in the configuration file). If the streamer’s and Watcher's cluster keys are identical, there is no need to fill this field.
    • DVR path – the path to the archive. This field is required for the archive to be recorded. For example: /dvr. Multiple paths are possible (separate the paths with spaces): /dvr1 /dvr2.
  3. When you have added a number of streamers, you must select the default one. Click the streamer in the list and then click Default. All new cameras will be added to the default stream server.

Important!

  • In the UI section Streamers you don’t need to add the host where Flussonic Watcher itself is deployed.
  • On all servers in a cluster identical date and time must be set.

For each streamer, you can enable the automatic use of redundant (backup) servers for streams ingest in case this streamer fails (see Failover).

Updating Flussonic Watcher Anchor Anchor x2

To update Watcher:

apt-get update
apt-get -y install flussonic-watcher
/etc/init.d/flussonic restart

During its update, Watcher automatically migrates the database to work with the new version. In rare cases it might be necessary to migrate the database manually. Watcher will show the message about that in the UI.

We strongly recommend that you back up your database every day and before you update Watcher.