Seeking Advice - Hosting MariaDB via ContainerStation

Hey everyone…

I’m looking for any advice or guidance from any users who are hosting MariaDB via ContainerStation - either direct as a Docker Image, or indirectly, such as by hosting in on a ContainerStation image of e.g. ubuntu Server.

Today I’m running MariaDB natively on QTS - and it works extremely well. In fact, I have only one challenge, which is that the most recent QTS edition of MariaDB is 10.5.8… and I’m trying to use it with BookStack, which requires something a bit more recent.

I tried raising a Support Ticket to ask the QTS Developers if they had a roadmap for MariaDB on QTS, but if they do, they’re not willing to share it. That’s fair, I think, so I’m not complaining.

However, I think this leaves me with two options if I want to continue using all that lovely RAID-6 goodness and being hosted on a nice chunky UPS…

ContainerStation does list multiple MariaDB container images - dozens of them. Not having used ContainerStation for anything other than a very brief experiment with Zabbix a few years ago, I’m not sure which version to pick, especially as only one in the list of offered packages has a little green flag against it, which I guess means that it is the only “Official” image. Very interested in learning from anyone who has a MariaDB image deployed via Container Station as to how to do this correctly.

Also, one of the things I must be able to do is run backups of my databases. As I’m using the QTS instance at the moment, it was pretty easy to set this up - I wrote a simple shell script and I’ve added that to the QTS crontab system using QNAP’s recommended approach to edit that file. From what I read, I should be able to use Docker’s exec command to interact with MariaDB, but not sure how to schedule this to do things like run a “mysqldump” at e.g. 02:30 every morning. So I’m very interested in learning from anyone who has MariaDB in a container to discover their impressions and learn how they backup their data.

The second option is that, of course, I could run a full OS image. I see that there’s an ubuntu 22.04 LTS image available from Docker… which I’m familiar with and on which I can run a full MariaDB 12.x instance. I should be able to access the ubuntu Server via both SSH and VNC from it’s virtual IP and that would give me the ability to mount back to an NFS share on the native QTS so that I can access the MariaDB dump files to be able to export them to removable media for off-site storage.

But there are significant trade-offs here… Clearly a narrow Docker image for MariaDB will be less resource-hungry on my NAS (a QTS TVS-672XT with an i5 CPU and 32Gb RAM, running 6x WD Red 12Tb in RAID-6), but I have a fair bit of headroom. On the other hand, controlling, interacting with and backup up DBs may be harder to run in an automated fashion [Sure, I can access via e.g. PHPMyAdmin and save the DB interactively, but that’s not a reliable solution for me].

The obvious alternative is to deploy ubuntu - I’ll get all the features of the OS; the ability to set up cron jobs on that VM and to control the MariaDB instance more directly… but at the cost of increased resource consumption on the 672. Currently, the 672 consumption data is - CPU <5%; RAM 26%; network - next to nothing unless I’m streaming video content.

It feels like I’m at a point where I have a couple of viable options, either of which I can probably get to work. But there’s a lot of subtlety in the detail and I figure that I can save myself a lot of time and heartache by taking some good advice before I try to build out a solution.

Very keen to learn from anyone who has traveled this path before me - or anyone who is running either a MariaDB or ubuntu image in ContainerStation.

Thanks in advance.

If the service you want to use has a specific requirement for the MariaDB version, I would recommend using Container Station.

If you encounter any difficulties during this process, please open a support ticket for us, and we can provide assistance. Thanks!

Thank you, Steve, I appreciate the response.

After my post I continued to experiment and have had some success. I worked out how to pull in the official “mariadb-latest” container direct in to ContainerStation, via DockerHub, after confirming that it would give me 12.0.2, which is the most recent stable release. I hit a problem with my first attempt in that I failed to use the “Advanced” options during container creation and thus missed the opportunity to create custom environment variables which I need to set to pass the initial setup parameters to MariaDB. Fortunately, the error messages it throws are explicit and it’s a trivial task to clear out what I have and reperform the task, so, as you recommend, that is going to be my first preference.

When I got stuck with that, I turned to VirtualizationStation and had a go there. I found this a bit more tricky - just a lack of understanding on my part, coupled with the QNAP Official documentation looking a bit out of date - but last thing last night I got a VM up and running with the latest Linux Mint ISO that I pulled down for this task [I use Mint as my desktop so am a tiny bit more familiar with it]. This all went OK - I got the “Mint Installer” graphical desktop running beautifully via Virtualization Station in my browser, but then I hit the inevitable issue which is that the most recent version of MariaDB offered by Mint was only a couple of minor versions on from what I have on QTS natively.

That’s not insurmountable, of course - I can simply add the official MariaDB repos to my sources.list file and use apt to pull down the version I need.

In both cases I did what I’ll describe as a “quick and dirty” job - for example irrespective of solution I really need to allocate a static IP address to this DB instance [which I’ve done before when experimenting with Zabbix, but that was literally years ago - just need to remember what I did]. I also need to work out how to do things like schedule DB backups. If I take the VirtualizationStation route that’s simple - just use the native cron on my hosted OS and go from there… If I use ContainerStation then I’ll still be using cron, but instead I’ll be using the native QTS cron and interacting with the MariaDB commandline via I think the “docker exec” command… and of course I’ll also need to figure out, when I do that, how I address my public share on the NAS so that the output from a “myslqdump” command can be pushed out on to the NAS file system, where 1) it retains RAID6 protection; and 2) I can wrap it up in my HBS3 backup schedules. [That’s trivial with VirtualizationStation, since I can just run an NFS mount right out of the local /etc/fstab… ]

So I think I’m “on my way”. As you’ve recommended ContainerStation, I’ll focus there first, but I was very interested/pleased with what I saw from “VirtualisationStation” and I think that’s going to be worth a look, perhaps for this, definitely for other projects.

And I’m taking notes as I go, so I’ll be able to publish a how-to when I’m done.

Thanks

Clive

Hi Clive,

Great to hear you’ve found some direction!

If you don’t mind, we’d absolutely welcome you to share the results of your testing and research here on the community. We’re sure it would help others looking for similar applications. Thanks!

Hi Steve,

Just to let you know that tonight I successfully completed installation of MariaDB 12.0.2 [the most recent stable release], via ContainerStation. I was able to complete add a “non-root” local user and grant myself via that account the ability to access the server remotely, then simply add a second server configuration to my local “PHPMyAdmin” setup [running on a Raspberry Pi, not on my QNAP NAS] and successfully connect, create a database, add a table, and so on.

I do have a little bit more to do - specifically the most important thing… which is, of course, to firstly confirm that I can perform a sqldump of an active database, secondly to confirm that I can “send” that output to a folder on the NAS that is within the tree of my primary “Public” share… and finally that I can then integrate that command with the 672’s crontab function, so that I can automate the scheduling of backups to integrate them with my HBS3 backup setup.

The good news is that it’s actually all very simple, once you get the hang of a few simple “gotchas”.

I’ll be back with comprehensive documentation as soon as I get the last couple of bits ironed out.

1 Like