Flussonic Watcher documentation

Installing Watcher Cluster

Flussonic Watcher can work in cluster (multi-server) mode as a service.

Comparing Watcher сluster with Watcher single

  • The cluster mode is suitable for medium and large projects with unlimited number of cameras (more than 500 cameras, their number is limited by hardware).

  • Watcher Cluster is a cluster of servers with the tools to ensure the fault-tolerance of stream ingest (failover).

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

Servers' configuration in a cluster

The cluster requires at least two servers with installed Flussonic Media Server:

  • The managing server (endpoint). It has Flussonic Media Server, the web interface to Watcher, 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 in a cluster:

  1. Install Flussonic Media Server on the managing server and on all streaming servers. Flussonic Watcher works only as part of Flussonic Media Server because its operation requires a powerful video streaming server.

  2. Install PostgreSQL on the managing server and specify the path to it in the administrator UI of Flussonic Media Server. Watcher works with the PostgreSQL database engine. It initializes the database on the first run.

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

  4. Create a cluster and add streamers by using the Watcher's administrator UI.

All these steps are described later on this page.

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

Installing Flussonic Media Server Anchor Anchor x2

Flussonic Media Server is installed on the server where you intend to install Watcher and, in case of a cluster, on all streaming servers.

Run the command:

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

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

Installing PostgreSQL Anchor Anchor x2

PostgreSQL is installed on the managing server.

Prerequisite: First, Flussonic Media Server must be installed on the managing server and on all the streamers.

  • To install PostgreSQL, with root access execute the command in the console:
apt install postgresql
  • Create the user and the database. Type these two commands in the console. First, create the user vsaas:
sudo -u postgres createuser -P vsaas

System's response: Enter password for new role: (enter super admin password)

System's response: Enter it again: (enter super admin password)

  • Create a database with the created user as the owner:
sudo -u postgres createdb -O vsaas -e -E UTF8 -T template0 vsaas_production

System's response: CREATE DATABASE vsaas_production OWNER vsaas ENCODING 'UTF8' TEMPLATE template0;

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

Inportant. Replace vsaas_password with the real password of the vsaas user that you created in previous steps.

Watcher Cluster in UI

  • 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;
}
  • Restart Flussonic Media Server with the command:
service flussonic restart

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.

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.

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

Creating the Watcher administrator Anchor Anchor x2

Go to http://FLUSSONIC:8080/admin 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 an email and come up with a password to create the first administrator account.

Installing Cluster

Next, set up Watcher to work as part of a cluster.

Create 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 > Edit is essential for 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. 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.

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

Adding streamers in Watcher settings

  1. Log in to Flussonic Watcher as the administrator.
  2. Go to Settings > Streamers > Edit and add a streamer in New 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.
    • The path to the archive – this field is required for the archive to be recorded. For example: /dvr, or for multiple paths (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 Set as 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, just update Flussonic Media Server, and you'll receive Watcher updates together with Flussonic's:

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