Unable to setup slave backend

For discussion of topics specific to MythTV on linux
Post Reply
hedgehog52
Junior
Posts: 79
Joined: Fri Sep 04, 2015 6:08 pm
United States of America

Unable to setup slave backend

Post by hedgehog52 »

I have been trying literally for almost a year to get this !@#$ slave-backend setup, and I am having no luck. The situation is that I have two debian buster machines. One is a rather large one with 5 drives on it, 11TB of which are devoted to mythtv. It has been working for ages. Now I am trying to setup a slave backend. It is also debian buster. The primary symptom is that when I connect the slave backend, neither system seems able to have a useful connection to the database long enough to actually do anything. Even when I try to run mythfrontend on the master machine, it comes up with no connection. Then it will sit and sit and then finally say "connected to database server" or something like that. Then a few seconds later, it's not able to talk to the database again.

I have had a slave machine working before, back on jessie and stretch and earlier versions. I was away from mythtv on a boat for 4 years, and now this. Is it just that mariadb is simply not up to acting as the database server for a small system with only two myth frontends and two myth backends (one master, one slave)? Should I be trying to install mysql instead of wrestling futilely with mariadb?

Bob
Last edited by hedgehog52 on Sat Oct 30, 2021 8:06 pm, edited 2 times in total.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Unable to setup slave backend

Post by paulh »

MariaDB works fine and is the mysql version of choice at the moment.

My first thought is that you have both machines using the same IP which is causing a conflict? Or maybe both machines are starting up as a master backend?
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Unable to setup slave backend

Post by pgbennett »

Maybe both have the same hostname or the same LocalHostName in config.xml ?
hedgehog52
Junior
Posts: 79
Joined: Fri Sep 04, 2015 6:08 pm
United States of America

Re: Unable to setup slave backend

Post by hedgehog52 »

And just like that, it starts working and I'm not sure what exactly happened. I had been doing a lot of changes, adding grants for the same user on different systems in the master database. And then I rebooted both machines. And then, I'm not sure whether the specific grants per IP made the difference, or if it was unchecking the box in mythfrontend->Setup->General->Database Configuration->"Use custom identifier for frontend preferences". Anyway, I unchecked the box and then tried running mythfrontend on the master and it worked, even though the slave system was running. Then I started mythfrontend on the slave and that works now, as well. I do get a couple of deadlock messages when I start the frontend, but then it comes up all the way and that's it.

So, I dunno what I did to make it work. It could have been that I installed mysql V5.7 on the master server and created grants on localhost, musem.local, musem, 192.168.1.137 (master) and 192.168.1.142 (slave). It could have been that there was something stuck in the database and disabling the "custom identifier" helped unstick it. I'm just at a total loss. My worry is that as soon as I carry the slave machine out to the living room where it belongs and hook it up, it'll all go to hell again.

So, next is to move the slave and hookup the HPDVR and see if that works.

Bob
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Unable to setup slave backend

Post by pgbennett »

The custom identifier sets the LocalHostName in config.xml as I mentioned earlier. So if two had the same custom identifier that could have been the problem.
hedgehog52
Junior
Posts: 79
Joined: Fri Sep 04, 2015 6:08 pm
United States of America

Re: Unable to setup slave backend

Post by hedgehog52 »

OK, I've finally figured it out. In mythtv-setup general->Host Address Backend Setup there is a box labeled "Allow Connections from all Subnets". I allowed the warning "Use this only if you have secure IPV4 and IPV6 firewalls" to scare me into turning it off. It needs to be ON so that any other machines, such as your slave backend and second mythfrontend can connect. Since the error message was related to a database deadlock I didn't catch on that it was a connectivity problem. I've seen a number of other reports of this problem, and I have to wonder if those guys did the same thing.

In any case, both frontends work, both backends work, and both recorders work.
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: [Solved] Unable to setup slave backend

Post by pgbennett »

It only needs to be on if your frontend and slave backends are on a different subnet. Most people have only one home router and everything is on one subnet. If you have a more complex setup with multiple routers you need to enable this or customize your subnets.
hedgehog52
Junior
Posts: 79
Joined: Fri Sep 04, 2015 6:08 pm
United States of America

Re: [Solved] Unable to setup slave backend

Post by hedgehog52 »

pgbennett wrote:
Sat Oct 30, 2021 7:31 pm
It only needs to be on if your frontend and slave backends are on a different subnet. Most people have only one home router and everything is on one subnet. If you have a more complex setup with multiple routers you need to enable this or customize your subnets.
Well, in that case, I don't know. And to top it off, after running OK for awhile, I started getting the "string not returned" message (or something similar, didn't write it down) and the list of recordings was empty. Also, mythfrontend was back to alternating between being frozen and then saying "connected to database" and then immediately freezing again. So, I've just now removed mysql-community-server and reinstalled mariadb and testing now.

I'm removing the "[Solved]" marking. I'll report back whatever happens.
hedgehog52
Junior
Posts: 79
Joined: Fri Sep 04, 2015 6:08 pm
United States of America

Re: Unable to setup slave backend

Post by hedgehog52 »

!#$%@#$%@$%@#

So, I booted the slave backend machine and it only took a couple of minutes for the problems with connecting to the database to return. I got nothin'. I have no idea where to turn next other than shut the slave down so that things work for now.

ADDED:
I logged into the slave machine via ssh and shut it down. My primary mythfrontend is running on screen 2 of this machine. It immediately went from blank panels to a display of the thumbnails for the recorded programs.
hedgehog52
Junior
Posts: 79
Joined: Fri Sep 04, 2015 6:08 pm
United States of America

Re: Unable to setup slave backend

Post by hedgehog52 »

I found the following in the mythtv.org setup pages. This sounds like what's happening to me, but I can't see where I've setup config.xml incorrectly. I did change the IP addresses to DNS entries: musem.local (master) and strider.local (slave). I'll go back and change that to ip addresses to see if that affects things.

"Remote backends may run a local MySQL daemon for non MythTV purposes, however, the remote backend must access the same MySQL server that the master backend does. Failure to access the correct database will cause unexpected behavior such as empty "Watch Recordings" lists and a failure to locate the Video Sources defined on the master backend."
hedgehog52
Junior
Posts: 79
Joined: Fri Sep 04, 2015 6:08 pm
United States of America

Re: Unable to setup slave backend

Post by hedgehog52 »

Some more information in case it jogs a memory. When I have the slave server running on the other machine and try to watch recordings on the master machine, these are the messages I get from mythfrontend. Any and all suggestions would truly be appreciated!

2021-11-03 01:05:15.869211 E MythSocket(7f111c003200:77): ReadStringList: Error, timed out after 30000 ms.
2021-11-03 01:05:15.869282 E MythSocket(7f111c003200:-1): No response.
2021-11-03 01:05:15.869287 N MythCoreContext::SendReceiveStringList(): Connection to backend server lost
2021-11-03 01:05:15.869450 N MythCoreContext::connectionClosed(): Event socket closed. No connection to the backend.
2021-11-03 01:05:15.970581 I MythCoreContext::ConnectCommandSocket(): Connecting to backend server: 192.168.1.137:6543 (try 1 of 1)
2021-11-03 01:05:17.677594 E MythSocket(7f111c005280:34): WriteStringList: Error, invalid string list.
2021-11-03 01:05:17.677615 E MythSocket(7f111c005280:34): Failed to send command.
2021-11-03 01:05:17.677749 C MythCoreContext::SendReceiveStringList(): Reconnection to backend server failed
2021-11-03 01:05:17.806944 W PlaybackBox: SortedList is Empty
2021-11-03 01:05:17.925197 I MythCoreContext::ConnectCommandSocket(): Connecting to backend server: 192.168.1.137:6543 (try 1 of 1)
Post Reply