Automatically convert MySQL tables from MyISAM to InnoDB
Requirements Ubuntu or Debian (for the default debian-sys-maint user) MySQL 5.0 or more (information_schema table) Perl 5 (always in any Linux) libdbd-mysql-perl package (DBD::mysql on CPAN) It could...
View ArticleAuto generate a MySQL server-id with puppet for replication
How it works We take the IP address, hash it, and generate a file. This is a sort of unusual technique, as I prefer to push a PHP script in and generate the file, rather than use a Ruby ERB. This...
View ArticleAutomated MySQL backup to Amazon S3 with built-in expiration
How it works The script builds a tarball with the InnoDB backup tool by Percona called “xtrabackup”. It uploads it to S3. Depending on various rules, it chooses in which S3 directory to put it. Since...
View ArticleA puppet class to install Percona MySQL on Debian/Ubuntu
How it works: First add Percona Repository, then second, percona MySQL itself. I will include an “apt::percona” class in a “pkg::mysql-perlcona” class Requirements: Puppet a recent Debian or Ubuntu...
View ArticleWhen a Debian / Ubuntu repository does not work – Example with Percona
Today a weird thing happened: I launched a new instance with the Percona MySQL class, and it didn’t install properly. It was giving me some weird error messages: err: /Stage[main]/Apt::Percona/Exec[apt...
View ArticleSimple CRON wrapper to seamlessly execute scripts with stdout / stderr output
The best practice for CRON jobs is to set an admin email to receive the output, and only output something if there is an error. Now this is all good but it often needs some kind of adapting and you...
View ArticleAlways have a handy MySQL replication user/password on your server –...
How it works Connects with Debian/Ubuntu default credentials, in /etc/mysql/debian.cnf, updates the file and the replication, regardless of if they already exist of not. TODO: check if the user already...
View ArticleHow to force a directory to only contain puppet managed files
Sometimes, you want some directories to be completely managed by puppet, and depending on certain conditions, you will have one or another file. For example, if you deploy your apache config files with...
View ArticleResync a MySQL slave on Amazon EC2 from a backed up S3 archive
How it works From an archive produced in the previous article for automated MySQL backup ( click here to see it ), we can easily sync a slave. We download the file from S3, and automatically set it up....
View Articlehow to restrict to only allowed IP addresses with Apache and htaccess
This is a really basic thing, but for some reason I always forget the exact syntax/order of the parameters of this configuration, and end up looking it up each time I need it. I figured why not put it...
View Article
More Pages to Explore .....