How to configure two backends?

For discussion of topics specific to MythTV on linux
Post Reply
KennyB
Junior
Posts: 50
Joined: Fri Sep 25, 2015 3:56 am
United States of America

How to configure two backends?

Post by KennyB »

I have a server with an Intel C2D 8400 that I would like to use to record and transcode shows, BUT it only has room for two drives. I currently use mythfrontend to watch and listen to media spanning 4 harddrives on a box with a AMD Phenom 9950, as well as recordings, but would like to offload all the recording to the Intel machine while still using the AMD machine for viewing/listening.

Well how can I get the Intel to handle the recording and transcoding and record to a local drive, but still run mythfrontend on the AMD machine and have access to both my media and music as well as the recordings on the Intel machine?

Should I simply create NFS shares on the Intel machine, then confinure it as a single backend, and allow it to map my media and music as if it were local?

Or should I set up a slave backend on the AMD, add my drives as storage directories for music and video, while having a primary backend on the Intel with storage directories for recordingsome mapped?
KennyB
Junior
Posts: 50
Joined: Fri Sep 25, 2015 3:56 am
United States of America

Re: How to configure two backends?

Post by KennyB »

Still trying to figure this one out. I installed a backend on the Intel machine, mounted my drives via NFS and tried to scan them, but the media scanner just stayed there forever doing nothing seemingly.

I really don't understand the documentation for this.
Example 2
For the situation where a remote backend has no storage and you use NFS or Samba, you may have all your storage on the master backend or some NAS or whatever. If so, just list all the directories in the Storage Group definition on the master backend and other hosts will use the same list of directories. Since all recording is done to "local" file systems, the remote file systems must be mounted at the same absolute path on all hosts.

If you want the TV directories NFS mounted on each MythTV system, you can, but you need to choose an appropriate Storage Group Disk Scheduler. If you also mount the TV directories at the same absolute path on the frontend systems, then recordings will be played back directly via NFS--rather than having the backend read the recording via NFS and then stream the recording to the frontend (therefore requiring only one trip across the network instead of two).

There's no need for any backend to have access to any file system other than the file systems to which that backend records TV. All MythTV recordings access (recording, playback, etc.) is performed through the recording host's mythbackend. The only exception is when you enable the setting in General Setup:

Master Backend Override
If enabled, the master backend will stream and delete files if it finds them in the storage group. Useful if you are using a central storage location, like a NFS share, and your remote backend isn't running.

This is only meant to be used when you have a single file server containing all file systems and you want to be able to stream/playback recordings from remote backends even when the remote backends are shut down or when *all* of your storage exists on the master backend and remote backends record to it over the network--so without this setting, streaming from the recording backend would mean the recording backend reads a recording over NFS and then sends it across the network to the frontend. Instead, enabling the override allows the master backend to read it from local storage and send it across the network to the frontend (so, only one trip across the network).

Quick Rules
Only set Storage Group directory lists on the master backend. (Never create Storage Group directory list overrides on the remote backends.)
Once properly configured (with no SG overrides on the remote backends), only manage Storage Groups using mythtv-setup on the master backend
Make the master backend's Storage Group directory list contain the union of all directories on all hosts--whether those directories exist on all hosts or not.
Directories in a Storage Group directory list need not exist on any host (those that don't exist on a particular host are simply ignored).
If you don't want a directory used on a particular host make sure that directory doesn't exist on that host.
Never put a mount point into a Storage Group directory list--always put some subdirectory under the mount point so MythTV will know to ignore the (non-existent) directory entry if the file system fails to mount properly.
If you think you need to override a SG directory list on a remote backend or remote frontend, you're making things more difficult than they need to be.
So I DO or DO NOT need to make NFS shares to read the media on the AMD computer from the Intel? If I DO NOT, then how does MythTV read the files? Some other media server platform it has that I'm unaware of?
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: How to configure two backends?

Post by pgbennett »

It looks like what you really need is the backend on one machine and the frontend on the other. All your recordings will be done on the backend on the Intel with its two drives, and the frontend can run on the AMD with its 4 drives. You do not need any NFS shares for this.

The second machine (the AMD) only needs to be a backend if it is doing recording or transcoding, and I don't think that is the case here.

The remote frontend can access recorded programs on the backend with MythTV's built in network support. The remote frontend can also access its local videos via MythTV videos. MythTV videos can access files through the local file system or through MythTV built in network support. So the remote frontend can access both its local videos and any that are stored on the remote backend, without needing any NFS shares.
KennyB
Junior
Posts: 50
Joined: Fri Sep 25, 2015 3:56 am
United States of America

Re: How to configure two backends?

Post by KennyB »

Okay, it's getting a little clearer.

I'm still a little unclear on one other facet though. If I have the backend on the Intel machine, but my media files are on the AMD machine, how do I tell the backend where to look, to in-turn tell the front-end on AMD where to look?

Do I just setup a video storage group on the backend that would be the same relative path as my media would be on the AMD?

So to be specific, I use a program called mhddfs to mount all 4 drives as if it were one large contiguous volume at /mnt/vraid/ and have with that various "movies" and "tv" subdirectories.

I would add these as "/mnt/vraid/tv/" or "/mnt/vraid/movies/" in my storage directories through the backend's mythtv-setup utility, and then when I loaded the front-end on the AMD machine, would it then look at /mnt/vraid/tv/ and /mnt/vraid/movies/ locally?

In the past I had setup a remote front-end on a Chromebook, with a backend on the AMD, but I had to mount the directories through NFS on the Chromebook to play them--or at least I thought I did. Was it in reality just streaming over MythTV that whole time?

Is there any way for the backend on Intel to be able to wake the AMD using wake-on-LAN when I attempted to play a video that's stored on the AMD? I noticed a lot of wake-up and shut-down command options, but it seems like that controls the backend itself.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: How to configure two backends?

Post by wesnewell »

All my media is on a separate drive on the backend.
wes@mythfe0:~$ ls /sdb
default lost+found music pictures recordings videos wes
In setup I point the directories to these. On any frontend, it will get recordings, music, pictures (images), videos from these directories over mythtv stream. Default gets other stuff, I use it for db backups. wes is where I backup my stuff. You can put them whereever you want as long as the backend has access to them, so will all frontends on any machine.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
KennyB
Junior
Posts: 50
Joined: Fri Sep 25, 2015 3:56 am
United States of America

Re: How to configure two backends?

Post by KennyB »

Okay, what about if I threw in another front-end into the mix? So there would be the AMD with its 4 drives with all my movies on it I want to watch with MythTV Videos, and then the Intel would have 2 drives in it for recordings. There is also an Android tablet I use Mythling on, so if I point it to the Intel backend, it would still know to stream the media from the AMD machine, to the Intel, and then to the tablet?

Right now I just have the /mnt/vraid/ directory on the AMD box mounted via NFS to the same relative path on the Intel box, with only two front-ends, the one on AMD and the one on my tablet.

I don't have a problem with NFS, and it seems to be working, I'm just wondering if there's a better way I could be doing it. Perhaps if I could be taking advantage of some of those wake-up and shutdown features.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: How to configure two backends?

Post by wesnewell »

I ran a slave backend/frontend about 10 years ago. The only reason was because I had more tuners than I could get in one box.IIRC, I setup nfs shares to the master backend, since myth didn't provide sharing back then. Today, with drives as big as they are, I really don't see the point of having a slave backend just for storage. I watch stuff and delete it. I never save a recording after watching it so that drive, even with some of by backups on it is still, well;
Machine Information
This machine's load average:

1 Minute: 0.55
5 Minutes: 0.31
15 Minutes: 0.55

Disk Usage Summary:

Total Disk Space:
Total Space: 2237481 MB
Space Used: 151670 MB
Space Free: 2085811 MB
Space Available After Auto-expire: 2085921 MB
Space Used by LiveTV: 110 MB
Space Used by Deleted Recordings: 0 MB
Space Used by Auto-expirable Recordings: 0 MB

Disk Usage Details:

MythTV Drive #1:
Directories: mythfe0:/sdb/default, mythfe0:/sdb/recordings
Total Space: 1877665 MB
Space Used: 114869 MB
Space Free: 1762796 MB
MythTV Drive #2:
Directory: mythfe0:/var/lib/mythtv/livetv
Total Space: 359816 MB
Space Used: 36801 MB
Space Free: 323014 MB
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: How to configure two backends?

Post by pgbennett »

KennyB wrote:
Fri Sep 14, 2018 10:49 pm
I'm still a little unclear on one other facet though. If I have the backend on the Intel machine, but my media files are on the AMD machine, how do I tell the backend where to look, to in-turn tell the front-end on AMD where to look?
You can set up a video storage group for videos to be played from the backend. For videos on the frontend you can specify on frinetnd Setup -> Media Settings -> Videos Settings -> General Settings, File paths that hold videos.
Okay, what about if I threw in another front-end into the mix? So there would be the AMD with its 4 drives with all my movies on it I want to watch with MythTV Videos, and then the Intel would have 2 drives in it for recordings. There is also an Android tablet I use Mythling on, so if I point it to the Intel backend, it would still know to stream the media from the AMD machine, to the Intel, and then to the tablet?
If you want to play videos on one frontend that exist on another frontend, you will have to use NFS to share them or install a second backend as you originally suggested. However, instralling a second backend solely for sharing videos seems overkill, I would just use NFS in that case.

If you use NFS, you can either mount the NFS share on your backend and add it to your video group, or mount it on the frontend and add it to the directory list in Media settings as described above.
KennyB
Junior
Posts: 50
Joined: Fri Sep 25, 2015 3:56 am
United States of America

Re: How to configure two backends?

Post by KennyB »

Okay great, that solves just about everything...

Except for why 0.29 was just hanging when trying to scan my video files. Should I make a new thread about that? I don't know how to enable more debug logging to see what's really going on.
User avatar
bill6502
Developer
Posts: 2299
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: How to configure two backends?

Post by bill6502 »

A new thread is a good idea, you're likely to get more eyes on it
or at least get folks that have stopped reading this thread.

I can help a bit with logging. Type: mythbackend -v help to see what's available.
Works with mythfrontend too, or almost any myth<someProgramName>.

To increase logging on the backend, while it's running, type: mythbackend --setverbose componant:loglevel
e.g. playback:debug,gui (the loglevel is optional.)
KennyB
Junior
Posts: 50
Joined: Fri Sep 25, 2015 3:56 am
United States of America

Re: How to configure two backends?

Post by KennyB »

bill6502 wrote:
Tue Sep 18, 2018 10:10 pm
A new thread is a good idea, you're likely to get more eyes on it
or at least get folks that have stopped reading this thread.

I can help a bit with logging. Type: mythbackend -v help to see what's available.
Works with mythfrontend too, or almost any myth<someProgramName>.

To increase logging on the backend, while it's running, type: mythbackend --setverbose componant:loglevel
e.g. playback:debug,gui (the loglevel is optional.)
Great thanks a lot, hopefully I can get it figured out with the logs first.
Post Reply