Creating an Intermediate Replication Layer

Tuesday, July 15th, 2008

A few weeks ago, I discussed how to keep binlogs in sync in a tree or pyramid replication scheme. That thread discussed how to re-distribute load in case of failure in one of the intermediate slaves. Today we will look at how to create those intermediate replication slaves. We start with a traditional flat replication scheme and promote several servers into the intermediate layer. (more…)

Using information_schema to write code for you

Saturday, March 8th, 2008

Back when I was doing a lot of work with Oracle, I learned to lean heavily on the SYSTEM views - Oracle’s equivalent to the INFORMATION_SCHEMA database. These views can really help you when it comes to writing dynamic SQL in stored procedures, or just taking quick shortcuts while you’re writing code. Or, if you’re like me, using the information schema can really help you limit the number of types you make.

Let’s take a simple case. You want to insert a row into a table that has multiple columns. You can hand type all those columns, but for me, that’s takes time and by the time I’m done debugging all the typos, it takes a really long time. Instead I just fire up a separate mysql client in silent mode and run a simple query:

SELECT concat(column_name,', ') 
  FROM information_schema COLUMNS 
 WHERE table_schema = "myschema" 
   AND table_name = "mytable";

(more…)

I need a new name convention

Friday, December 29th, 2006

I’m slowly adding computers to my network now, and I’m discovering that not setting up a proper name convention when I only had 2 or 3 PCs is going to now be a problem. I want to think of a standard now while I’m in the process of moving things around and refining the network - before things really get out of hand. (more…)

One Man’s Junk

Saturday, December 23rd, 2006

It’s true - one man’s junk is another man’s treasure. I know this to be true because I was the recent recipient of such a fortune. Back in October, I was talking to an old friend of mine over instant messenger, and I had mentioned that I was working with some old UltraSparc1 machines (thank you Ed Corrado). My friend thought I was wasting my time, and mentioned that he was about to throw away 4 old Dell workstations and an ancient Dell server. A quick arrangement was made, and I set a date to drive up to Manhattan and pick them up. (more…)

Don’t forget your log files

Saturday, December 23rd, 2006

I was originally going to title this post “The Reaon I’m a Terrible Systems Administrator”, but on further reflection I changed it to “The Primary Reason… ” and finally to “One of the Many Reasons…” before I decided to give up and put the title more in context. For now I’ll just thank my lucky stars that my current gig has me doing heavy PL/SQL development instead.

I’ve wasted a lot of hours the last two weeks trying to troubleshoot issues with my network at home. In two specific cases, I could have avoided a lot of frustration and grief if I had only checked the log files immediately, instead of pounding google and attempting a hodge-podge of fixes that didn’t work (more…)