OneFreeVoice

July 15, 2008

Creating an Intermediate Replication Layer

Filed under: Code, MySQL — Tags: , , — Gregory Haase @ 1:52 pm

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…)

March 8, 2008

Using information_schema to write code for you

Filed under: Code, MySQL — Tags: , — Gregory Haase @ 9:15 pm

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…)

December 29, 2006

I need a new name convention

Filed under: Code, Personal — Gregory Haase @ 11:11 pm

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…)

December 23, 2006

One Man’s Junk

Filed under: Code, Personal — Gregory Haase @ 10:12 pm

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

Filed under: Code, Personal — Gregory Haase @ 8:41 pm

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…)

« Newer PostsOlder Posts »

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.