Kodi Community Forum

Full Version: Migration to dedicated server with MySQL 5.5.42
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've now built my dedicated Kodi Server. It's running an I5-8400 @ 3.20ghz with 8GB 2400Mhz DDR4. The boot, MySQL and Kodi applications and data are on a Samsung 960 EVO 250 GB with a Seagate 1TB drive for backups and other miscellaneous stuff. The connection to the network is wired Ethernet 1gbps Cat6E. IP=192.168.1.200

The Kodi server is located beside my Windows 2012R2 server, which hosts all the actual content. They are connected via a Netgear GS108T-V2 smart switch. IP = 192.168.1.1

I have the Kodi PC configured to run a couple of programs, including Kodi, at log on. I've installed the library Auto Updater with a update interval of 4 hours (Since Kodi will only update at start up, and the recommendation is that the PC is left on 24/7; thereby meaning new content would never be added to the library unless it was manually updated). However, I can't run the PCs 24/7

The Win2012 server powers up by BIOS @10:55am.
The Kodi PC powers up by BIOS @ 11:00am.
Both servers shutdown @ 2:00am

I have several questions

1. The Wiki says that MariaDB is supported, but doesn't specify a version. Given that v18 is rumored to be going to use MariaDB I was going to use that, but as it didn't specify a version I ended up using MySQL 5.5.42. Does anyone know for sure what version of MariaDB is stable and supported?

2. I am now experiencing buffering from the Kodi PC viewing content. Aside from the MySQL database, the configuration is the same as the test PC I was using with the SQLLite DB. I would have thought an I5-8400 w/8gb 2400mhz RAM would be plenty beefy enough. CPU usage is minimal, and RAM usage is 18%. All the posts I can find relating to this all refer to streaming over the internet. I am streaming from a server on the same network that is 3m of cable from the content server. Thoughts/suggestions?

3. Kodi does not possess an option to "Quit" at a SPECIFIC time. As a server sitting in a corner it will rarely if ever get used. It's basically started to update the library and MySQL serves the content to the clients. Sure I can use taskkill via a scheduled task to terminate Kodi, but that is probably not a good idea. Is there a way to tell Kodi to quit cleanly and safely at a specific time?

4. Is there a way to automate exports? I have Macrium installed to back up the MySQL and Kodi installs and data, but the gist has been that exports are the best form of backup.

5. I'm a bit confused as to how to set up the clients. I understand the advancedsettings.xml contents for the MySQL server, and the Kodi MySQL wiki says nothing that I can see about how to install and configure Kodi on the clients... This is the section for setting up the clients...

5 Adding new Kodi devices to the MySQL setup

Since the database has now been set up on the MySQL server, all you need to do for any additional devices is add the advancedsettings.xml file. You don't need to do any of the other steps, such as rescanning or reimporting. If it works on one device then it should work on all of them, as they are basically sharing the same "brain".

I'll do some experimenting tomorrow and see what works. But if anyone can point me to some more detailed information about Kodi/MySQL client set ups I'd appreciate it.

thank you.
(2018-04-23, 13:02)Yanta Wrote: [ -> ]5 Adding new Kodi devices to the MySQL setup
I've extended that text section a bit. Please have a look and mention the part(s) that need more clarification.
(2018-04-23, 13:02)Yanta Wrote: [ -> ]2. I am now experiencing buffering from the Kodi PC viewing content.
Buffering has absolutely nothing to do with the MySQL database, which only contains metadata for videos and/or music. Buffering happens with your media data throughput is being hampered for some reason. Start checking the kodi.log file for possible explanations.
(2018-04-23, 13:50)Klojum Wrote: [ -> ]
(2018-04-23, 13:02)Yanta Wrote: [ -> ]2. I am now experiencing buffering from the Kodi PC viewing content.
Buffering has absolutely nothing to do with the MySQL database, which only contains metadata for videos and/or music. Buffering happens with your media data throughput is being hampered for some reason. Start checking the kodi.log file for possible explanations.  

Fair enough. One of the first questions people ask when something like this happens is "What did you change?". I was trying to be proactive.

Nothing in the log file that I can see (Not that 100% of it makes total sense to me anyway). I'll turn on debug logging and keep an eye on it.

All PCs used in the set up and testing are on the same LAN segment (switch), so nothing has changed there.
(2018-04-23, 13:47)Klojum Wrote: [ -> ]
(2018-04-23, 13:02)Yanta Wrote: [ -> ]5 Adding new Kodi devices to the MySQL setup
I've extended that text section a bit. Please have a look and mention the part(s) that need more clarification. 

You're a legend! Excellent update.

The confusion initially was I didn't know how far to take my install. Do I add sources? Where do I point those sources? There is no content on the MySQL server.. But the content server contains no database... Your update clarifies that perfectly.

I'm getting a connection error 10060 in the log file. At that Point Kodi hangs then crashes. It says it can't connect to myvideosXX.db

IIRC, I saw something on the wiki about a connection error 10030.. But expanding the troubleshooting tips just a tad might prove helpful.

My firewall on all three PCs allows traffic on port 3306. I am using IP addresses, not machine names.

I found another thread that mentioned a MySQL config option "set_external_locking", which I've commented out, but haven't tried yet. I will get to it later today.
OK, Solved the 10060 connect error. I was looking too deep in the advanced firewall options when the problem was the basic firewall configuration - MySQL was granted public but not private. Tick that box and I could then connect.

However, because I copied the sources and favorites.xml files the TV Doco source got copied over. But the new Parent Node, the rules and category configurations in the skin settings were not migrated. So I had to set that all up again. Perhaps a note on the wiki on how to migrate this, or if not, a note that this will have to be manually set up for each client.

Additionally, as I scroll through the movies, I find that hundreds of movies have no posters/cover art etc... I did copy the thumbnails folder as documented. Is there a quick fix or do I have to manually download the artwork one by one?

And lastly, one of the questions I had before the Wiki was updated was - Do I need to set the library to update at start up on the clients? Or is the server the only install that needs to be updated?

An observation - Accessing the library remotely is definitely much slower (despite the PCs being on the same LAN segment). As I said, I am now getting buffering, but I'm also noticing a much slower refresh of the library thumbnails and when I initially go into either Movies, TV Shows or TV Doco there is about a 5 second delay before anything is shown. The buffering in Twitch for example (which is perfect outside Kodi), is so bad that it stutters incessantly, and I lose audio completely. I did a speed test and I'm getting 70Mbps down
MySQL is installed / set up for local use only by default, as a security measure.

Movies with no cover: as long as the full source path does not change, the Kodi client should find the thumbs pretty quickly if you copied the Thumbnails folder AND the local database Textures13.db file. The MySQL database stores the internet URL for thumbs, the local database checks the thumbnail presence, and downloads its if necessary.

Slow library: either your database server HDDs are slow (I use an SSD for the MySQL database on a Linux machine) or there is some network congestion going on. The Kodi database only pumps out microscopic small amounts of data compared to full size video files. What sort of machine/OS is running your MySQL server?
(2018-04-24, 07:42)Klojum Wrote: [ -> ]MySQL is installed / set up for local use only by default, as a security measure.

Movies with no cover: as long as the full source path does not change, the Kodi client should find the thumbs pretty quickly if you copied the Thumbnails folder AND the local database Textures13.db file. The MySQL database stores the internet URL for thumbs, the local database checks the thumbnail presence, and downloads its if necessary.

Slow library: either your database server HDDs are slow (I use an SSD for the MySQL database on a Linux machine) or there is some network congestion going on. The Kodi database only pumps out microscopic small amounts of data compared to full size video files. What sort of machine/OS is running your MySQL server?

The sources.xml and mediasources.xml file were copied from the MySQL server as was textures13.db. I watched as many of the images slowly appeared, but hundreds of them remain blank. So is there a way to fix it without manually doing the "Choose Art" one by one?

The MySQL server is Windows 10 x64 with I5-8400 @ 3.20ghz. It has 8gb DDR-2400. The boot/data drive is a Samsung M.2 NVMe 960 EVO 250gb. These is a 1TB Seagate desktop drive, but I just use that for backups etc. The NIC is an Intel (None of this Killer LAN rubbish), and all infrastructure is CAT6E gigabit Ethernet. There is no wireless. The machines are all connected together via a Netgear GS108T-V2 smart switch. The content server, MySQL Server and the Test-PC are all on the same switch.

The Test-PC is a I7-6900X @ 4.20ghz with 16GB DDR4-3200, and has a 1TB Samsung NVMe M.2 960 Evo. Again, Windows 10 x64.

The Internet speed is 85Mbps down and 30Mbps up when connected to a VPN, and 93Mbps down/35Mbps up when not connected. Plenty fast enough.

I increased the memory size in advancedsettings.xml to 500mb but this did not help.

Task Manager shows no busy processes using CPU, except Kodi and that was only a few percent.

Connecting to twitch via Firefox outside Kodi there is no buffering.

There was no activity on the LAN or WAN at the time I was setting things up. During the day I'm home alone, so I have the Internet and Network all to myself Smile
I'm kinda running out of ideas. The problem could appear when doing your collection via a remote server and the VPN that you mentioned.
Other than that, I'm out.
(2018-04-25, 10:43)Klojum Wrote: [ -> ]I'm kinda running out of ideas. The problem could appear when doing your collection via a remote server and the VPN that you mentioned.
Other than that, I'm out.
 Even with the VPN connected, the speed is still way high enough to avoid buffering. But as I said, outside Kodi ON the VPN there is no buffering, it is only in Kodi - ON and OFF the VPN. I don't believe this is a VPN issue.

Not sure what you mean by "doing my collection via a remote server". All the PCs are on the same LAN segment.

EDIT: Ah I see where the confusion comes from... I said in an earlier post "When I access the server remotely".... Sorry, my bad. I didn't mean remote in the true sense of the word. I meant from a PC other than the Kodi/MySQL server.... As I said - everything is on the same LAN segment - nothing is being done "remotely"..

But I got bigger problems!!! This is just going from bad to worse!

I spent pretty much all day manually updating about 1,000 movies posters and artwork - One at a time. Extremely irritating.

Then I copied the textures13.db and thumbnail folder to one of the clients, fired up Kodi and found that NOT A SINGLE item had artwork - the artwork for all 5,000 movies, TV shows and documentaries - gone!!!! I am not going to sit here and manually set artwork for 5,000 items across 6 PCs. That's just insane!!

OMG!!! It shouldn't be this hard.

I tried restoring from backups etc. Nothing works. I cannot get any artwork back unless I manually download every poster etc one by one.
On that latter issue, maybe have a look at Milhouse's texture cache maintenance utility and see if it can resolve things?
There is the option of going for a fresh install. If a MySQL shared database works for one machine, it works for the other. That has been so for years. And caching thumbnails is either done by each Kodi device on its own, or you give it a push by already copying the Thumbnails folder as well as the Textures13.db to other Kodi clients. That part shouldn't be rocket science.
(2018-04-25, 14:43)Klojum Wrote: [ -> ]There is the option of going for a fresh install. If a MySQL shared database works for one machine, it works for the other. That has been so for years. And caching thumbnails is either done by each Kodi device on its own, or you give it a push by already copying the Thumbnails folder as well as the Textures13.db to other Kodi clients. That part shouldn't be rocket science.

Yes. I will be fresh installing again tomorrow. If I had a dollar for every fresh install I've done....

I also read on one post here that Kodi will not hit up the scraper sites in this situation because (To quote the post) "It would crash those sites hitting it with thousands of requests"...
(2018-04-25, 14:25)DarrenHill Wrote: [ -> ]On that latter issue, maybe have a look at Milhouse's texture cache maintenance utility and see if it can resolve things?
 I saw that. Looks beyond my pay grade.

I'll try the 1,000th fresh install and see what I get.
Keep double-checking your kodi.log file for the correct connection to your database(s).
Pages: 1 2