<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.rivendellaudio.org/index.php?action=history&amp;feed=atom&amp;title=Aman_Debian_Wheezy_Install</id>
		<title>Aman Debian Wheezy Install - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.rivendellaudio.org/index.php?action=history&amp;feed=atom&amp;title=Aman_Debian_Wheezy_Install"/>
		<link rel="alternate" type="text/html" href="http://wiki.rivendellaudio.org/index.php?title=Aman_Debian_Wheezy_Install&amp;action=history"/>
		<updated>2026-05-01T21:15:24Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.4</generator>

	<entry>
		<id>http://wiki.rivendellaudio.org/index.php?title=Aman_Debian_Wheezy_Install&amp;diff=267&amp;oldid=prev</id>
		<title>Higgles: Created page with &quot;'''What is Aman?'''  Aman is used as a server monitoring tool for the Rivendell database and the /var/snd Audio directory.  The idea being you can use this tool to automate sw...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.rivendellaudio.org/index.php?title=Aman_Debian_Wheezy_Install&amp;diff=267&amp;oldid=prev"/>
				<updated>2018-03-13T15:37:07Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;What is Aman?&amp;#039;&amp;#039;&amp;#039;  Aman is used as a server monitoring tool for the Rivendell database and the /var/snd Audio directory.  The idea being you can use this tool to automate sw...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''What is Aman?'''&lt;br /&gt;
&lt;br /&gt;
Aman is used as a server monitoring tool for the Rivendell database and the /var/snd Audio directory.  The idea being you can use this tool to automate swapping between master and slave server as opposed to manually configuring your own rsync and MySQL replication scripts.&lt;br /&gt;
&lt;br /&gt;
If you just want to use Rivendell stand alone or on a single server then you don't need to know about aman however if you would like to have a server you can use in case of a failure keep reading.&lt;br /&gt;
&lt;br /&gt;
This guide walks through installing Aman from source for Debian Wheezy on a bare bones install (no GUI for the most part).  The guide assumes you're comfortable with the command line although feel free to substitute all talk of editing config files via nano with your editor (graphical or otherwise) of choice.&lt;br /&gt;
&lt;br /&gt;
All of this information is extrapolated from the INSTALL file that you can download with aman from github.  Special thanks to Thomas Golding on the Riv mailing list for the mysql vs mysqld detective work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Getting down to the nuts and bolts...'''&lt;br /&gt;
&lt;br /&gt;
You will need:&lt;br /&gt;
* 2 Servers&lt;br /&gt;
* A static IP you can use for each public address (static on your network, not the Internet)&lt;br /&gt;
* Each server needs 2 network cards&lt;br /&gt;
* A Crossover cable&lt;br /&gt;
* Debian 7 mini live iso (burned to CD or converted to a USB pen)&lt;br /&gt;
&lt;br /&gt;
'''NB:''' These servers work in virtualisation really well as it is only a file store with a MySQL database but you'll need to test for production use if you're doing anything fancy.&lt;br /&gt;
&lt;br /&gt;
'''NB2:''' I'm not going to talk through the normal Rivendell installation process or exporting NFS shares etc as this should be something you've done before (and there are plenty of other guides covering that).&lt;br /&gt;
&lt;br /&gt;
'''NB3:''' Aman makes a lot of assumptions that it can run as root and requires root access via ssh.  I tried making a sudo user but things just didn't work properly.  Just make sure your root password is good and even better make these machines independent from the rest of your network.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Getting all the pre-requisites installed'''&lt;br /&gt;
&lt;br /&gt;
After the usual Debian install login as your freshly minted root user and lets get going.  Anything prefixed with # will be the root shell from here on in.&lt;br /&gt;
&lt;br /&gt;
 # apt-get update&lt;br /&gt;
&lt;br /&gt;
* Install MySQL:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
'''NB:''' Make a note of your root MySQL password&lt;br /&gt;
&lt;br /&gt;
* Install perl modules that aman requires:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install libterm-readkey-perl libclass-dbi-mysql-perl&lt;br /&gt;
&lt;br /&gt;
* Install QT4, the QT4 MySQL driver and other build tools:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install qt4-dev-tools libqt4-sql-mysql build-essential libtool autoconf automake usermode&lt;br /&gt;
&lt;br /&gt;
* Install NTP to keep the server time in sync (if you have an internal NTP server remember to point this server to that rather than using debian ntp mirror bandwidth):&lt;br /&gt;
&lt;br /&gt;
 # apt-get install ntp&lt;br /&gt;
&lt;br /&gt;
* Install git for getting the source code:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install git&lt;br /&gt;
&lt;br /&gt;
* Install xinetd which is used to spawn rsync as required by aman:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install xinetd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Getting and compiling the source code'''&lt;br /&gt;
&lt;br /&gt;
With all that out of the way we can actually compile and install aman&lt;br /&gt;
&lt;br /&gt;
 # cd ~&lt;br /&gt;
 # git clone https://github.com/ElvishArtisan/aman&lt;br /&gt;
 # cd aman&lt;br /&gt;
&lt;br /&gt;
Create the configure scripts etc:&lt;br /&gt;
&lt;br /&gt;
 # ./autogen.sh&lt;br /&gt;
&lt;br /&gt;
If there are any errors here then it usually relates to missing pre-requisites.  Google the errors and you should be able to figure out what packages you are missing.&lt;br /&gt;
&lt;br /&gt;
Now we need to tell the compiler where QT4 lives on Debian so that you won't get errors about missing QT.&lt;br /&gt;
&lt;br /&gt;
 # export CPPFLAGS=-I/usr/include/qt4&lt;br /&gt;
&lt;br /&gt;
And before we install we need to create a few missing directories that aman requires:&lt;br /&gt;
&lt;br /&gt;
 # mkdir -p /etc/security/console.apps/&lt;br /&gt;
 # mkdir -p /var/aman/snapshots/&lt;br /&gt;
&lt;br /&gt;
Finally we can configure, compile and then install the tool:&lt;br /&gt;
&lt;br /&gt;
 # ./configure&lt;br /&gt;
 # make&lt;br /&gt;
 # make install&lt;br /&gt;
&lt;br /&gt;
Make usually takes about 30 seconds on any relatively modern machine.  Its a lot quicker than the Rivendell compile time if you've ever done that in a past life.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Correcting Debian idiosyncrasies'''&lt;br /&gt;
&lt;br /&gt;
Debian uses dash as a sh substitute which makes the amand service fail to start.  It also calls the MySQL service msyql as opposed to mysqld which aman assumes.  So lets fix that:&lt;br /&gt;
&lt;br /&gt;
 # dpkg-reconfigure dash&lt;br /&gt;
&lt;br /&gt;
Answer no when it asks to use dash as the default shell for sh.  This defaults sh to bash which works fine.&lt;br /&gt;
&lt;br /&gt;
 # ln -s /etc/init.d/mysql /etc/init.d/mysqld&lt;br /&gt;
&lt;br /&gt;
That takes care of the start up scripts so lets move on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Creating SSH keys for passwordless login'''&lt;br /&gt;
&lt;br /&gt;
Aman makes use of ssh for rsyncing and possibly other things so we need to create some ssh keys so that root is not prompted for a password between the two servers.&lt;br /&gt;
&lt;br /&gt;
 # ssh-keygen&lt;br /&gt;
&lt;br /&gt;
Hit enter on all the options to create a key with no password.  Now copy this key to your secondary server:&lt;br /&gt;
&lt;br /&gt;
 # ssh-copy-id root@other_server&lt;br /&gt;
 # For example on my server (main is 192.168.1.21 and secondary is 192.168.1.22):&lt;br /&gt;
 # ssh-copy-id root@192.168.1.22&lt;br /&gt;
&lt;br /&gt;
Make sure you test this on both the public and private addresses e.g. :&lt;br /&gt;
&lt;br /&gt;
 # ssh root@other_server_public_address&lt;br /&gt;
 # ssh root@other_server_private_address&lt;br /&gt;
&lt;br /&gt;
You should not be asked for a password when you login like this.&lt;br /&gt;
&lt;br /&gt;
'''NB:''' If you haven't set up your network as static yet, just edit /etc/network/interfaces and set up both eth0 (public) and eth1 (private via crossover cable) then repeat the ssh-copy-id steps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Amending the aman config file'''&lt;br /&gt;
&lt;br /&gt;
 # cp ~/aman/conf/aman.conf.sample /etc/aman.conf&lt;br /&gt;
 # nano /etc/aman.conf&lt;br /&gt;
&lt;br /&gt;
Change the alertaddress and fromaddress as required.  After this all you need to do is change the names and passwords in the [SystemA] and [SystemB] so that they match your setup.  For example:&lt;br /&gt;
&lt;br /&gt;
 [SystemA]&lt;br /&gt;
 Hostname=mainserver&lt;br /&gt;
 MysqlUsername=repl&lt;br /&gt;
 MysqlPassword=letmein&lt;br /&gt;
 PublicAddress=192.168.1.21&lt;br /&gt;
 PrivateAddress=192.168.10.21&lt;br /&gt;
&lt;br /&gt;
Finally we need to change where the ssh keys are located so change that line to:&lt;br /&gt;
&lt;br /&gt;
 SecureShellIdentity=/root/.ssh/id_rsa&lt;br /&gt;
 &lt;br /&gt;
Obviously do the same in the SystemB section but change the IP addresses.&lt;br /&gt;
&lt;br /&gt;
With that done we can copy this file to the secondary server:&lt;br /&gt;
&lt;br /&gt;
 # scp /etc/aman.conf root@secondary_server:/etc/aman.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Amending the MySQL config'''&lt;br /&gt;
&lt;br /&gt;
Aman has a sample MySQL config that tunes a lot of variables that probably make MySQL faster for Rivendell use.  To be honest I think you could leave these as the defaults but lets do it anyway.&lt;br /&gt;
&lt;br /&gt;
We'll make a new file under /etc/mysql/conf.d/ so that our user changes will never be overwritten by Debian updates in the future.  If you look in ~/aman/conf/my.cnf-SystemA-sample you'll see all the Riv options, I'm only changing the values that are different to the defaults.&lt;br /&gt;
&lt;br /&gt;
Note I didn't use the log-error directive as it causes issues with the flush logs command under Debian.&lt;br /&gt;
&lt;br /&gt;
 # nano /etc/mysql/conf.d/rivendell.cnf&lt;br /&gt;
 [mysqld]&lt;br /&gt;
  &lt;br /&gt;
 #network&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
&lt;br /&gt;
 #tuning&lt;br /&gt;
 max_connections=250&lt;br /&gt;
 key_buffer_size=128M #Do not use more than 25% system memory here&lt;br /&gt;
 max_allowed_packet=1M &lt;br /&gt;
 table_open_cache=512&lt;br /&gt;
 read_buffer_size=2M&lt;br /&gt;
 read_rnd_buffer_size=8M&lt;br /&gt;
 myisam_sort_buffer_size=64M&lt;br /&gt;
 query_cache_size=32M&lt;br /&gt;
&lt;br /&gt;
 #replication&lt;br /&gt;
 server-id=1&lt;br /&gt;
 log-bin=mysql-binA&lt;br /&gt;
 binlog-do-db=Rivendell&lt;br /&gt;
 log_slave_udpates&lt;br /&gt;
&lt;br /&gt;
For more information on all of these options check out the MySQL manual http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html&lt;br /&gt;
&lt;br /&gt;
Now copy this to the secondary server and edit it:&lt;br /&gt;
&lt;br /&gt;
 # scp /etc/mysql/conf.d/rivendell.cnf root@192.168.1.22:/etc/mysql/conf.d/rivendell.cnf&lt;br /&gt;
 # ssh root@192.168.1.22&lt;br /&gt;
 # nano /etc/mysql/conf.d/rivendell.cnf&lt;br /&gt;
&lt;br /&gt;
Change:&lt;br /&gt;
&lt;br /&gt;
 server-id=2&lt;br /&gt;
 log-bin=mysql-binB&lt;br /&gt;
&lt;br /&gt;
Now save and quit then exit ssh back to the main server&lt;br /&gt;
&lt;br /&gt;
 # exit&lt;br /&gt;
&lt;br /&gt;
'''NB:''' At this point you will need to create a Rivendell database and import a backup of your DB (or install Rivendell from scratch and run rdadmin to create a new DB).  This needs to happen on both servers!&lt;br /&gt;
&lt;br /&gt;
Again on both servers restart mysql:&lt;br /&gt;
&lt;br /&gt;
 # service mysql restart&lt;br /&gt;
&lt;br /&gt;
If there are any errors check your rivendell.cnf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Getting audio synchronisation working'''&lt;br /&gt;
&lt;br /&gt;
On both servers we need to add a few system users and then add this info to the Rivendell database.  We'll add rduser but won't give it the ability to login (the -M)&lt;br /&gt;
&lt;br /&gt;
 # useradd -M rduser&lt;br /&gt;
 # addgroup rivendell&lt;br /&gt;
 # adduser rduser rivendell&lt;br /&gt;
&lt;br /&gt;
Next up we need to create /var/snd and set the appropriate permissions:&lt;br /&gt;
&lt;br /&gt;
 # mkdir -p /var/snd&lt;br /&gt;
 # chown rduser:rivendell /var/snd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Rsyncd'''&lt;br /&gt;
&lt;br /&gt;
Rsyncd is a daemon version of rsync that is used by aman to keep the synchronisation of /var/snd up to date.&lt;br /&gt;
&lt;br /&gt;
We use aman to designate which is the master server and rsync overwrites the slave with the info from the master.  First we need to enable rsyncd and tell it what directory we'll be syncing.&lt;br /&gt;
&lt;br /&gt;
There is a config sample in ~/aman/conf/rsyncd-sample.conf that we will use to do this.  On both servers:&lt;br /&gt;
&lt;br /&gt;
 # cp ~/aman/conf/rsyncd-sample.conf /etc/rsyncd.conf&lt;br /&gt;
 # nano /etc/default/rsync&lt;br /&gt;
 Change the line RSYNC_ENABLE=false to RSYNC_ENABLE=true&lt;br /&gt;
 # service rsync start&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Xinetd'''&lt;br /&gt;
&lt;br /&gt;
Xinetd is meant to be a way for things to start/stop daemons as required.  For us this should mean that rsync is only turned on when aman needs to use it and is otherwise off (I'm not sure whether the way I've set up rsync above effectively means this is not needed).&lt;br /&gt;
&lt;br /&gt;
Again there is a xinetd config file we can use.  On both servers again:&lt;br /&gt;
&lt;br /&gt;
 # cp ~/aman/conf/rsyncd.xinetd-sample /etc/xinetd.d/rsync&lt;br /&gt;
 # nano /etc/xinetd.d/rsync&lt;br /&gt;
 Change flags = IPv6 to IPv4 (unless you use IPv6)&lt;br /&gt;
&lt;br /&gt;
Now all we need to do is start the rsync daemon and set up the mysql replication users.&lt;br /&gt;
&lt;br /&gt;
 # service rsync start&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Adding the MySQL replication users'''&lt;br /&gt;
&lt;br /&gt;
Once again we have some helpful scripts we can use.  Most of the settings here are the defaults, all you will have to do is type in your MySQL root password (that you noted down earlier).  So lets add the rivendell database users and then the replication users:&lt;br /&gt;
&lt;br /&gt;
 # ~/aman/scripts/aman_add_rivendell_user.pl&lt;br /&gt;
 MySQL Admin User [root]: *hit enter*&lt;br /&gt;
 MySQL Admin Password: your_root_password_goes_here&lt;br /&gt;
 Rivendell User [rduser]: *hit enter*&lt;br /&gt;
 Rivendell Password [letmein]: *hit enter*&lt;br /&gt;
 Host to Add [%]: *hit enter*&lt;br /&gt;
&lt;br /&gt;
Obviously change any users/passwords as needed.&lt;br /&gt;
&lt;br /&gt;
 # ~/aman/scripts/aman_add_replication_users.pl&lt;br /&gt;
 MySQL Admin User [root]: *hit enter*&lt;br /&gt;
 MySQL Admin Password: your_root_password_goes_here&lt;br /&gt;
 Replication User [repl]: *hit enter*&lt;br /&gt;
 Replication Password [letmein]: *hit enter*&lt;br /&gt;
 System A Public Address [192.168.1.21]: *hit enter*&lt;br /&gt;
 System A Private Address [192.168.10.21]: *hit enter*&lt;br /&gt;
 System B Public Address [192.168.1.22]: *hit enter*&lt;br /&gt;
 System B Private Address [192.168.10.22]: *hit enter*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Starting the Aman service'''&lt;br /&gt;
&lt;br /&gt;
We're basically done.  All you need to do is start the amand service and then load the aman gui tool to set everything up:&lt;br /&gt;
&lt;br /&gt;
 # service amand start&lt;br /&gt;
&lt;br /&gt;
If you get an error saying libaman.so is not found, reboot and it should be fine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''But I don't have a GUI this is a server'''&lt;br /&gt;
[[File:001-aman-default.png|200px|thumb|Aman Default]]&lt;br /&gt;
As far as I can tell the aman gui should work from any machine as long as the /etc/aman.conf file is present and correct, however you can get an on demand GUI going on the server quite easily (if you then use X Forwarding you don't even have to sit in front of the thing to do it).&lt;br /&gt;
&lt;br /&gt;
We'll be installing lxde-core to keep things light weight:&lt;br /&gt;
&lt;br /&gt;
 # apt-get install x-window-system lxde-core&lt;br /&gt;
[[File:002-aman-master.png|200px|thumb|Aman System A Database Master]]&lt;br /&gt;
Once that lot is installed simply run startx and you'll get your GUI.&lt;br /&gt;
&lt;br /&gt;
 # startx&lt;br /&gt;
&lt;br /&gt;
Once in there open a terminal and run aman&lt;br /&gt;
&lt;br /&gt;
 # aman&lt;br /&gt;
[[File:003-aman-slave.png|200px|thumb|Aman System B Database Slave]]&lt;br /&gt;
We'll assume SystemA will be the master, to do this click Make Master under the Database Section, then Make slave for System B.&lt;br /&gt;
&lt;br /&gt;
When this is working hit start Slave for System B and everything should be working.&lt;br /&gt;
&lt;br /&gt;
You can check /var/log/syslog for any error messages.  If there are permission issues its usually the ssh-copy-id's not having been completed.  If you've tried to be clever and use sudo users instead of root you'll also get permission errors here.&lt;br /&gt;
&lt;br /&gt;
[[File:004-aman-audio.png|200px|thumb|Aman System B Audio Slave]]&lt;/div&gt;</summary>
		<author><name>Higgles</name></author>	</entry>

	</feed>