This may apply to more than just FreeBSD, but it’s been tested and working on FreeBSD. I wanted to keep the syslogd locked down while letting HAProxy still log. All the example configurations I could find use a network interface to syslogd, which I have completely disabled. So this details using a local socket (which isn’t all that much different).
Continue reading
Monthly Archives: July 2010
How to use an Amazon EC2 instance as a VPN server
One day I was doing some testing and I wanted to be sure it wasn’t my DNS/Routes that were causing the response time issues. A co-worker suggested using an EC2 instance as a VPN server. I thought that would be perfect!
Continue reading
How to keep a passive-master MySQL database warm
When you have a passive master (in a master-master setup), there is usually no queries going to it. If there are no queries it will not have its buffers/caches at least semi-ready for a production workload. Maatkit (love this toolkit) has a nice little tool to help do this, mk-query-digest. Now this is only 1 of many uses for this tool. So visit the mk-query-digest doc to find out the rest of its many uses.
Continue reading
Taking a hot backup of a MySQL database with XtraBackup
A hot backup means you don’t have to take the database offline or stop sending traffic to it. This is especially useful for creating new replication slaves. A hot backup takes minutes vs the hours a dump/import would take. Ideally, all the tables in the database need to be InnoDB; however, Percona has adapted a script (innobackupex) to also backup MyISAM tables (if there are MyISAM tables then you probably should stop sending traffic to it as those require table locks). What makes XtraBackup so nice (besides being free) is that it logs C_UD statements to applied during restoration and it can do incremental backups as well.
Continue reading
Using mydumper to parallel dump/import from/to MySQL
I originally attempted to use mk-parallel-[dump/restore] but I kept running into issues when restoring the data. mydumper (written by Domas Mituzas) has been tested to be faster so I thought I would give it a try.
Continue reading
FreeBSD Hardware RAID Information
When trying to develop plans to repurpose machines and not being the sys admin that setup the machines is a difficult task. Part of the plan is to audit the hardware and their current configuration.
Memory, CPU, partitions, etc are easy parameters to determine in FreeBSD; hardware RAID on the other is not so simple.
Continue reading
Verifying replication slave data
I read about this wonderful toolkit called Maatkit in an equally wonderful book High Performance MySQL. I highly recommend both to anyone having to deal with MySQL. I’ll definitely do more posts about Maatkit and its tools as I use them.
I’m going to be up-front now, this is not the best method to run this. In the mk-table-checksum documentation it details the use of the faster/more accurate FNV1A_64 hash UDF; I would recommend using it over MD5 or SHA1. Also, if all your slaves are accessible from the machine running mk-table-checksum then I also recommend the –replicate-check flag instead of manually running the SQL.
Continue reading
Setting up a FreeBSD time server
It is a very simple process, however it does take a bit of patience. The NTP standard is quite complex and large, so I know I only scratched the surface.
Continue reading
Recovering from catastrophic failure of the replication master
This applies to a replication architecture like the one detailed here Improving Replication Performance.
My situation was Master2 (which runs the blackhole engine) ran out of disk space and the current binlog was lost. After freeing up disk space on Master2 and restarting its replication it was now missing hours worth of binlog that its slaves are expecting to find. So to remedy this, I pointed the slaves directly back to Master1 to slurp up the missing binlog and then switch them back to Master2 once they were caught up.