Flussonic Watcher Documentation

Installing and Updating 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 uses the PostgreSQL database engine.

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

On this page:

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

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

    curl -sSf https://flussonic.com/public/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. Launching the flussonic service:

    service flussonic start
    
  5. In the Flussonic's web UI (http://flussonic:80/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

  6. For local streamer of the Watcher need specify cluster_key.

  7. 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
    
  8. Finally, go to the the Flussonic UI in the browser.

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

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

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

Creating the Watcher administrator

Go to http://FLUSSONIC:80 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 only) Creating a cluster (multiple server mode)

Creating a cluster means to add streamers (streaming servers) in the settings of Flussonic Watcher. Streamers (streaming servers) are servers intended to stream video from IP cameras. You must add at least one streamer on which IP cameras are added to configuration. This will allow you to start receiving video from cameras in cluster mode.

The Watcher 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. Open the web interface and specify the port for HTTPS in Config > SSL-tunneled protocols, for example, 443. Other ways to configure HTTPS

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

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

  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 streaming server 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.
  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).

(For cluster only) Installing Flussonic Media Server on streamers

Flussonic Media Server is installed on all streaming servers.

Run the command:

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

Now start Flussonic Media Server:

service 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.

Updating Flussonic Watcher

To update Watcher:

apt-get update
apt-get -y install flussonic-watcher
service 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.

To update Rolling release

How to install a rolling update

Remove the currently installed version of Flussonic Watcher and its dependencies:

apt remove flussonic-watcher

Change the repository to the one with rolling updates and install Flussonic Watcher:

rm -f /etc/apt/sources.list.d/erlyvideo.list;
rm -f /etc/apt/sources.list.d/flussonic.list;
echo "deb http://apt.flussonic.com/repo master/" > /etc/apt/sources.list.d/flussonic.list;
apt update;
apt install flussonic-watcher;
service flussonic restart

How to return to the major release

Remove the currently installed version of Flussonic Watcher and its dependencies.

apt remove flussonic-watcher

Change the repository to the one with official releases and install Flussonic Watcher:

rm -f /etc/apt/sources.list.d/flussonic.list;
echo "deb http://apt.flussonic.com binary/" > /etc/apt/sources.list.d/flussonic.list;
apt update;
apt install flussonic-watcher;
service flussonic restart
We strongly recommend that you back up your database every day and before you update Watcher.

Rollback to the previous version of Flussonic Watcher

To rollback to the previous version of Watcher, follow these steps:

  1. Create a backup copy of the database so that if necessary you can quickly restore the service:

    /opt/flussonic/contrib/watcher db backup
    
  2. Determine dependencies:

    apt-cache show flussonic-watcher=20.06 | egrep 'Depends|Suggests:'
    Depends: flussonic (>= 19.12), flussonic-python (=20.05.1), postgresql (>= 9.6)
    
  3. Be sure to rollback the DB version to the corresponding Watcher version:

    /opt/flussonic/contrib/watcher db history
    
    Use DB variable from flussonic config (postgresql://vsaas:demopass@localhost/vsaas_production)
    Use CLUSTER variable from flussonic config (mysql://admin:demopass@127.0.0.1:14406/cluster)
    73890c17e7b4 -> a1ecd76da5e8 (head), camera_vision_alg
    0c650872aea1 -> 73890c17e7b4, add_locale
    dad763f2dc9a -> 0c650872aea1, Add external id to person
    v20.07 -> dad763f2dc9a, user_readonly_field
    9955e21bb2e6 -> v20.07, v20.07
    0f72327f2dc8 -> 9955e21bb2e6, create faces and persons
    v20.06 -> 0f72327f2dc8, add_folder_maps
    v20.05 -> v20.06, v20.06
    772e49544a48 -> v20.05, v20.05
    

    If you do not know exactly the required version of the database, then contact technical support at support@flussonic.com. An incorrect version will cause the service to malfunction.

    Watcher v20.06 corresponds to v20.06 of the database. Roll back the database:

    /opt/flussonic/contrib/watcher db downgrade v20.06
    
  4. Install the required version and its corresponding dependencies:

    apt install flussonic-python=20.05.1 flussonic-watcher=20.06
    
  5. Restart the service:

    service flussonic restart