NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

MySQL InnoDB engine

Hi everyone,

I am using MySQL on Linux RT cRIO-s to store my acquired data. I am trying to create robust system that works 24/7.

Currently I have problems with table corruption after power loss. Until now I have used MyISAM storage engine in MySQL server downloaded from Angstrom repository.

After investigating my problem I have found many articles on web that actually claim that MyISAM storage engine is not very robust and MyInnoDB is recommended as more robust engine that should be used.

I have noticed that InnoDB engine is not available at all in MySQL downloaded from Angstrom repository.

Since InnoDB is MySQL default storage engine, I am wondering is there some specific reason related to cRIOs why is it removed from compilation on Angstrom repository?

Thanks for you help,

Regards

Franjo Tonković

Veski

0 Kudos
Message 1 of 15
(4,175 Views)

Hello Franjo,

The Angstrom repos are not managed by National Instruments. This means that whosoever manages those repos decides their content. What version of the OS are you using (as reported by MAX, or alternately post the result of running uname -a)

0 Kudos
Message 2 of 15
(3,983 Views)

Hi Franjo,

It might be worth asking yourself if you're using the right thing for the job. MySQL is a large industrial standard database that has a lot of complexity built in to handle record locking, multiple clients etc etc. It's designed to be hosted on a reliable system, with UPS protection to prevent power-outs, rather than being inherently resilient. A better solution may be to host the database on a different computer (with good power protection) and to sync your system to it, or perhaps a simpler database like SQLite that only needs to worry about table locking and single clients.

A scheme we use is to poll (ping) a remote database and if it doesn't respond store the data locally, then queue it up when a connection is made again.

Hope this helps

Steve

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

0 Kudos
Message 3 of 15
(3,983 Views)

Hi Brad,

Thanks for advice, I will try to find some other repository that might contain MySQL InnoDB (hopefully there is a good KB about it 🙂 ).

And to answer your question, I am still using Linux RT cRIOs with LV 2014 RT.

Regards

Franjo

0 Kudos
Message 4 of 15
(3,983 Views)

Hi Steve,

I originally did logs onto cRIO in files, but MySQL is more convinient as it provides me ability to keep same methods for data acessing for both cRIO and servers and it is much easier to maintain just one code for data access.

I actually have solution for stable data logging on cRIO in MySQL based on power loss detection but it increases price of my cabinet for 500€ and I would like to avoid it. In my preliminary tests ( I tested it on cRIO-9082 with Win OS), MyInnoDB  proves to be more robust than MyISAM, but I still have to evaluate how much work is to get InnoDB on linux RT.

Regards

Franjo

0 Kudos
Message 5 of 15
(3,983 Views)

Hi Franjo,

In 2014, the NI Linux RT image was preconfigured with NI's own repository, download.ni.com/nilrt. What this means is that OpenEmbedded, the system used to build the distribution as well as the extra packages that are in the feeds, did not configure MySQL to have InnoDB as a backend option.

At this point, you have one of a couple options, depending on your distribution needs. You can install the tools needed to build packages, download the MySQL incarnation of your choice's source, the -dev version of dependent packages, and configure and build MySQL locally (be sure to remove the MySQL packages from your target that you'd installed through opkg).

This is fine for one-off needs and prototyping, but obviously it does not scale well. At this point, you have another couple of options: setup an OpenEmbedded build system (which is described in the notes here: https://github.com/ni/nilrt/tree/nilrt/14.0), make the needed changes to the MySQL recipe to configure the resulting build (and package) to include InnoDB support, and distribute that package to the targets you need this support on. Alternately, you can take the results of building it on the target *or* updating the OE recipe and wrap that in a *.CDF file for installation through MAX (or SysAPI)

0 Kudos
Message 6 of 15
(3,983 Views)

Hi Franjo,

As I am looking for a way to keep on using my present MySQL database setup (hosted on my local PC) on a Linux RT (cRIO), I was wondering if you got the InnoDB engine to work on your Linux RT system.

Best regards,

Marcus

______________________________________________

Marcus Törndahl (System Architect)
0 Kudos
Message 7 of 15
(3,513 Views)

Hi Marcus,

 

What version of the base OS are you using (as reported by MAX)? I'm not 100% sure that it will make a difference, but it would at least point us to a package to examine and the nilrt build branch in case you'd need to rebuild the package to enable support.

0 Kudos
Message 8 of 15
(3,506 Views)

Hi BradM,

According to MAX the OS is "NI Linux Real-Time x64 4.1.15-rt17-4.0.0f0". 

Are you using an ODBC-connector to connect to the MySQL database?

Best regards,

Marcus

______________________________________________

Marcus Törndahl (System Architect)
0 Kudos
Message 9 of 15
(3,503 Views)

Marcus,

 

I'm not using anything to connect to anything, I'm just doing some legwork to see what's available in the feeds that you're using 🙂

 

4.1.15 is 2016, and the 2016 feeds contain mariadb, and the server package includes the innodb plugin. Now the question becomes, what exactly is the aim of what you want to do? You're asking if there's InnoDB support on NI LinuxRT, but as InnoDB is a storage plugin, unless you intend on making the actual DB files available on the NI LinuxRT target, you'd probably be more interested in some of the client connectivity aspects (like ODBC, which you noted).

0 Kudos
Message 10 of 15
(3,493 Views)