File under Golden

So I had a bit of a brainstorm the other day. I've got two servers: Here and There. There's some stuff Here that needs to move There. The problem is that the server Here is in use a fair bit, and part of that use involves INSERTing things in MySQL and then SELECTing them back again. It's a pain to shut down things Here altogether in preparation for moving There, particularly as the move is liable to take, oh, twenty-four hours or so. The database needs to be consistent between the two, but the length of the move makes that impractical unless Special Measures are taken.

Dark server room. Midnight. We see THE SUPERVISOR talking to THE SYSADMIN.

SUPERVISOR: That database needs to be consistent, dammit!

SYSADMIN: (tightly) I can't do that without taking...special measures.

SUPERVISOR grimaces.

SUPERVISOR: Whatever it takes, dammit. I don't want to know.

SYSADMIN: All right, then. I'll do your dirty work.

SYSADMIN turns slowly and walks out the door.

SUPERVISOR: Dammit!

I will conced that's a little dramatic. But what else would you call MILITARY-GRADE ENCRYPTION, i.e. SSH tunnels from Here to There? (It must be military grade; it's developed in Canada.) Okay, so it's not that big a deal for you people what think all the time. But it was pretty clever, I thought, and would ensure that the everything was, like, cool and stuff because -- this is the good part, see -- we would tunnel the MySQL connection from Here to There over SSH! Brilliant! It only needs a short break in the service from Here, then all the database updates that might come from Here go There! Yeah! So I began trying that out today. It's was a bit of a pain to set up. I had to do some funky firewall-fu There to get SSH in in the first place. Then I had to figure out the right syntax for netmasks for hosts.allow (for the record, it's 255.255.255.0, not /24). Then I had to figure out how to get the MySQL client to connect to an arbitrary port. That took a while. I offer you this hard-won piece of knowledge in the spirit of Free Knowledge:

When using the MySQL client, do not confuse the-Hoption (output in HTML, please) with the-hoption (connect to the specified host, please). That's a silly mistake to make.

However, what's not a silly mistake is expecting -h localhost to do the right thing and connect. This is either an omission in the otherwise-excellent MySQL, or else a case of our nameserver not having a record for localhost. I strongly suspect the latter.

That said, it appears to be working: I can now be refused a connection to the MySQL server There from Here. Truly, I am a golden god.

Except maybe when it comes to backups or SCSI or something. I ran into some problems with AMANDA's backups last night. I saw these rather frightening messages this morning in dmesg. After sticking my tongue cutely out the side of my mouth to indicate fierce concentration and colouring in some printed log files in different flourescent colours, I was left with this series of messages:

Aug 23 23:46:57 localhost /kernel: (sa0:ahc0:0:3:0): SCB 0xe - timed out Aug 23 23:46:57 localhost /kernel: >>>>>>>>>>>>>>>>>> Dump Card State Begins < <<<<<<<<<<<<<<<< Aug 23 23:46:57 localhost /kernel: <<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>> Aug 23 23:46:58 localhost /kernel: (sa0:ahc0:0:3:0): Queuing a BDR SCB Aug 23 23:46:58 localhost /kernel: (sa0:ahc0:0:3:0): Bus Device Reset Message Sent Aug 23 23:46:59 localhost /kernel: (sa0:ahc0:0:3:0): SCB 0xe - timed out Aug 23 23:46:59 localhost /kernel: >>>>>>>>>>>>>>>>>> Dump Card State Begins < <<<<<<<<<<<<<<<< Aug 23 23:46:59 localhost /kernel: <<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>> Aug 23 23:46:59 localhost /kernel: (sa0:ahc0:0:3:0): no longer in timeout, status = 34b Aug 23 23:46:59 localhost /kernel: ahc0: Issued Channel A Bus Reset. 1 SCBs aborted Aug 23 23:46:59 localhost /kernel: (sa0:ahc0:0:3:0): failed to write terminating filemark(s) Aug 23 23:47:59 localhost /kernel: (sa0:ahc0:0:3:0): SCB 0xe - timed out Aug 23 23:47:59 localhost /kernel: >>>>>>>>>>>>>>>>>> Dump Card State Begins < <<<<<<<<<<<<<<<<

...and on it goes.

Saint Google asserts that this is probably a case of SCSI cables not being terminated properly, or getting too close to the power supply. Sure enough, the latter may be a problem. I made what adjustments I could without taking down the server, and we'll see what happens tomorrow. Weird. I am having the strangest sense of deja vu right now looking at that log entry in vi. Huh.

What else? I'm typing this right now at a local coffee shop where I was able to pick up wireless service; unfortunately, the cheap bastards want money. I tried pinging various addresses for a while, thinking about setting up an IP-over-ICMP-or-possibly-over-DNS proxy from my home network, then gave up and turned off the wireless card. It's good to know that it works, and it's good to know that there are places left where you can hear both Lisa Stansfield and Rick Astley in the space of five minutes. And there was much rejoicing.

Cool bit of the day from the PHP docs:

<directory /var/www/html/mydatabase>
    php_value mysql.default_user fred
    php_value mysql.default_password secret
    php_value mysql.default_host server.example.com
</directory>

Graham Rule at ed dot ac dot uk, you rule.