Installation

This describes how to set up a local server from scratch. You may be able to install the components on an existing system, but this is currently not supported.

Install Debian

To begin, boot into the Debian “stable” installer, either from USB, CD-ROM or from netboot. Note that the boot priority in the BIOS of the UNO-3272 has options for both USB CDROM and normal IDE CDROM so make sure you pick whichever one you are using.

Set up keyboard, timezone, and other settings as normal.

When you get to the partitioning screen, set up partitions as follows: First hard drive (sda):

  1. Primary, filesystem ext3, size 200MB, bootable flag, mount as /boot
  2. Primary, LVM, size 1TB

Second hard drive (sdb):

  1. Primary, LVM, size 1TB

Now choose “Write changes to disk and configure LVM.” Set up LVM as follows:

Physical volumes: sda2 and sdb1

Volume group: call it main, and set it to use all of both physical volumes.

Logical volumes:

  1. Name: root, size 80GB
  2. Name: swap, size 3GB
  3. Name: media, size 2TB

Save the changes, and go back to the partitioning screen. Set up the logical volumes to be mounted as follows:

  1. root: filesystem ext3, mount point /
  2. swap: use as swap
  3. media: filesystem ext3, mount point /var/isuma

Now choose to continue and the volumes will be formatted. Formatting the media partition takes about a half hour and looks like it’s stuck at 33% completed for that entire time, so go have a coffee.

Set up root and normal users.

Next, choose a local Debian mirror. On the software selection screen, select the “standard system” and “Web server” software collections.

Install local server software

In /etc/apt/sources.list add:

deb http://debian.koumbit.net/debian stable main

Then run:

apt-get update
apt-get install koumbit-archive-keyring

You will see this warning:

W: GPG error: http://debian.koumbit.net stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0x6DC388D8B7C0A70A

It is normal, you need to bootstrap the trust to the repository. Optionnally, you can also download the key directly from the web of trust and verify the signatures to check its authenticity.

Then run:

apt-get install isuma-local-servers isuma-autossh

Optionally, if you want to setup kiosk mode, run:

apt-get install isuma-kiosk

Configure Local Server

Create the config.inc file in the /usr/share/isuma-local-servers/sync/. Configure the unique username/password to access cs.isuma.tv in the form: username:password@cs.isuma.tv.

Make sure file is properly formed with opening <?php and no closing ?>

The username refers to a user that is created within the drupal at cs.isuma.tv.

SSH upload account configuration

There is configuration required to setup the rsync between the media player and the main isuma.tv website.

Copy the cachingserver@isuma.tv private key to /var/isuma/.id_rsa on the media player. The key can be found on the isuma.tv server at /home/cachingserver/.ssh/id_rsa. Be sure that it is readeable by and only by www-data (chown www-data /var/isuma/.id_rsa; chmod 600 /var/isuma/.id_rsa).

Then run:

su www-data -c "ssh cachingserver@isuma.tv -i /var/isuma/.id_rsa"

NB: I didn’t do that for v25n11 as there is no caching server and couldn’t find the specified files.

Important: Save the fingerprint by entering “yes”

SSH tunnels configuration

The SSH tunnels allow Isuma administrators to login remotely on the media players, from the central server. They work with a package called “autossh” that tries its best to keep an SSH connection to the central server open. That connection is then used to create a tunnel back to the SSH server running on the media player.

The isuma-autossh package should automatically prompt you for the relevant information. You need to provide it with the public key of the isuma central server, which is:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdr5vyuwKikrW0Vg+mlsRTkG1Jp3wUt4JmLopspln5sWsbAsMDtnUe7T0NW6s6W2tYvlav9m987HrNvAXCWbBeOwIuabbtcUK39QRdEUrAcd1yConPxmnsk7+sN2p7NC76lYIXYQM7hT2pWa3rXpdZQT2leSrrWFW0j/PEvwsEvb+4vmm2POX2L9GJDeb/czdT6/3NNRVlDiSh4rORbtXgDq7cj2qKZ0xnzDOcOpSjXig2eLl6759qLV3p76iNmMoHjWwo3bRypkwtiZ3zmwBPtGlctezgHqukaUKwcbDRNoZgv99QYLzAYqjx7ZqwWBCaNixaXgZhNkKhmlVSRXZB root@ip-10-122-35-248

(!) If that file is changed, you can use the dpkg-reconfigure isuma-autossh command to copy and paste the proper key back into place.

Then the isuma-autossh package generates a public key in /root/.ssh/id_rsa.pub, which needs to be manually copied at the end of the /home/tunnel/.ssh/authorized_keys file on the central server.

First file sync

(From #7744.)

Here’s the resyncing process for the file queue. Note that we actually inject the files in the download queue to make sure we haven’t missed anything, but the files could also be injected straight into the File queue.

On the central server, list the queues for the media player:

mysql> SELECT csc.uid, csc.caching_server_queue, ns.title, ns.sqid FROM caching_server_config csc JOIN nodequeue_subqueue ns ON ns.qid = csc.caching_server_queue WHERE csc.uid=91;
+-----+----------------------+-----------+------+
| uid | caching_server_queue | title     | sqid |
+-----+----------------------+-----------+------+
|  91 |                   86 | download  |  307 |
|  91 |                   86 | upload    |  308 |
|  91 |                   86 | file      |  309 |
|  91 |                   86 | transcode |  310 |
+-----+----------------------+-----------+------+
4 rows in set (0.00 sec)

This is an easy way to list the subqueue identifiers for the given media player. In this example, this is media player #6 (uid 91). From this we get the queue id (86) and the subqueue id (307) for the download queue.

Then we need to do the same for a reference MP, we take the isuma office one even though we know that it is missing some files:

mysql> SELECT csc.uid, csc.caching_server_queue, ns.title, ns.sqid FROM caching_server_config csc JOIN nodequeue_subqueue ns ON ns.qid = csc.caching_server_queue WHERE csc.uid=63;
+-----+----------------------+-----------+------+
| uid | caching_server_queue | title     | sqid |
+-----+----------------------+-----------+------+
|  63 |                   62 | download  |  214 |
|  63 |                   62 | upload    |  215 |
|  63 |                   62 | file      |  216 |
|  63 |                   62 | transcode |  217 |
+-----+----------------------+-----------+------+
4 rows in set (1.75 sec)

Then we make the crazy request to inject all files from the reference player into the poor little media player:

mysql> INSERT INTO nodequeue_nodes (SELECT 86,307,nid,position,NOW() FROM nodequeue_nodes WHERE sqid = 216);
Query OK, 69566 rows affected, 65535 warnings (3.47 sec)
Records: 69566  Duplicates: 0  Warnings: 69566

This may unfortunately introduce duplicates in the file table, but that’s better than an empty table!

Then do clear up the download queue, you need to hit the central server for every single file in there:

su www-data -c "while true; do /usr/share/isuma-local-servers/sync/download.php; done"