HA setup

Need help? Post your questions here.
morten
Posts: 7
Joined: 01 Sep 2014, 10:02
Has thanked: 6 times
Been thanked: 1 time

HA setup

Unread post by morten »

I'm trying to do HA setup of Madsonic:
The media data storage is on CephFS but could just as well have been on a NFS HA setup.
Madsonic is running as Docker instances (alpinelinux version is awesome).
I would like 2 or 3 Madsonic instances runnning but my main concern is the Madsonic data file integrity. I suspect it will be corrupted if I point multiple instances to the same dir+files and they both start a scan task at the same time.
I'm guessing that the corruption would not happen if only one instance write to the Madsonic data file but then i'd have to point all write tasks like playlist mangling to just one instance in the haproxy doing the load balancing.
Can I use a galera cluster for these media data instead somehow or how would one go about this?

I thought of keeping the data files separated and simply let only one instance do the scan tasks, then copy data from that to the other(s). But I'd like to avoid making haproxy pointing to the "read/write" instance. If I don't my playlists and stuff like that will get overwritten.
a7medo778
Posts: 28
Joined: 21 Jul 2015, 11:49
Has thanked: 0
Been thanked: 11 times

Re: HA setup

Unread post by a7medo778 »

actually, i have a similar question, i been trying this with ampache with no avail
I am trying to scale the server to accommodate 1000+ users, so how can we scale the installation without sacrificing latency of the api's ?

my current attempt is separating the db into its own node, mount the drive to all front ends, and add a lb
but the latency to download a track has resin to 9+ sec, and indexing to 4+ sec which is too high
Saklasklas222
Posts: 6
Joined: 02 Jun 2013, 16:31
Has thanked: 1 time
Been thanked: 4 times

Re: HA setup

Unread post by Saklasklas222 »

morten wrote:I'm trying to do HA setup of Madsonic:
The media data storage is on CephFS but could just as well have been on a NFS HA setup.
Madsonic is running as Docker instances (alpinelinux version is awesome).
I would like 2 or 3 Madsonic instances runnning but my main concern is the Madsonic data file integrity. I suspect it will be corrupted if I point multiple instances to the same dir+files and they both start a scan task at the same time.
I'm guessing that the corruption would not happen if only one instance write to the Madsonic data file but then i'd have to point all write tasks like playlist mangling to just one instance in the haproxy doing the load balancing.
Can I use a galera cluster for these media data instead somehow or how would one go about this?

I thought of keeping the data files separated and simply let only one instance do the scan tasks, then copy data from that to the other(s). But I'd like to avoid making haproxy pointing to the "read/write" instance. If I don't my playlists and stuff like that will get overwritten.

For HA setup you will need concurrent write access to madsonic DB...which means, this must be build into madsonic code. Then you can setup few instances of Tomcat with nginx or apache as reverse HA proxy, which give you even possibility to have single ssl certificate to all instances if you have users all over internet.

For 1000+ users, you should have rather some seriuos powerfull HW. Musics on dedicated raid with SAS-10000rpm minimum or SSDs. 16 core Xeon CPU at least on 2,4 GHz, 64-128GB ram dedicated only for madsonic. Forget CEPH or docker. Everything should be without containers or network storages(if you have 4-8GB/s fibre channel or 10GB/s network storage link with server, then its ok) and raw as possible if you want performace.
morten
Posts: 7
Joined: 01 Sep 2014, 10:02
Has thanked: 6 times
Been thanked: 1 time

Re: HA setup

Unread post by morten »

Saklasklas222 wrote: Forget CEPH or docker. Everything should be without containers or network storages(if you have 4-8GB/s fibre channel or 10GB/s network storage link with server, then its ok) and raw as possible if you want performace.
No way! Ceph is awesome! Just ask CERN about their 30PB Ceph cluster: https://indico.cern.ch/event/542464/con ... ay-dan.pdf

The setup is only for like 10-20 concurrent users which gives more the incentive of making it HA than to do a performance comparison of containerized Madsonic vs regular virtualized. Heck, I actually run the madsonic-alpine container without performance tuning it at all :-)
So, my problem with the database persists. I'd just love to be able to store the media data and playlists etc. in the Galera cluster instead of the locale .db file. Or just any real database service that scales.
Post Reply