Redundant Airtime setup
  • Hi there,

    I'm new to Airtime and I have the requirement to run a redundant setup so that there are two machines streaming the same music. In case one of them crashes the other one should still be able to continue broadcasting the scheduled music.

    Are there any advices or best practices on how to achieve this?
    I found a master/slave setup on how to replicate the postgres-database ( but I wonder if this approach does work in practice since the data that gets written to the database by the slave will get overridden by the master. Will playback still work?
    Are there any other approaches to this?

    Thanks for your feedback.
  • 3 Comments sorted by
  • Read postgres documentation on Replication careful before you think about it,I think the wiki post is a bit outdated

    I think you could install airtime on two machine and utilize the watch folder senario.

    As far as I read you will lose your playlist setups on any database back up.I do not know if this is the case on database replication.

    Since Airtime is easily install on a client/server module,I do not see the benefit of using bandwith for replication.IMHO
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I presume the best option for this approach is a cluster for each instances (Liquidsoap, DB, Icecast, Airtime, etc.). Heartbeat will do its job then. - Bringing talents in life!
    + Action Radio School +
  • My solution was to have two Airtime hosts running independently. The primary storing music locally and accessing postgres from our VM infrastructure. The backup, is identical hardware with the data from the other host mounted and accessible where it uses rsync to make a clone of the music for a local copy. The directories match on both hosts. Then I used the following command to sync postgres to a database running locally on the backup. 

    export PGPASSWORD="airtime"
    /usr/bin/pg_dump -C -h ORIGINAL_PG_HOST -x --inserts -T cc_listener_count -T cc_timestamp -U airtime airtime_db | /usr/bin/psql -h localhost -U airtime airtime

    Note this requires the pg_hba to be configured on both database hosts. Seems to be running smoothly so far. Failover currently is to unplug the soundcard and plug into the other host where udev rules restart the airtime playout engine so no reboot is required.