Oct 272009
 

It just occurred to me that there’s a somewhat different way of finding the latest and hottest new websites out there – just take a look in CPAN (Perl’s third-party library repository) or the equivalent for other languages for modules that match “WebService”.

If someone has gone to the trouble of writing a module for communicating with a site, it probably is at least worth looking at.

Oct 272009
 

Whether you are using ufs filesystems or zfs storage pools, Solaris has a rather nifty way of migrating storage from one SAN to another wih no (or little) downtime. Or various other reasons involving moving from one disk to another. The key advantage to the following method is to reducing or eliminating downtime. Even if your users can take the hit, not having to slowly watch a multiterabyte filesystem copying from one disk to another is reason enough to use this technique.

Basically it is by using mirroring. Using mirroring to copy a disk might seem a little odd to begin with, but once you’ve seen it work you’ll be a fan.

For UFS (and SVM) Filesystems

This section assumes that the source disk device (cXXXXX) is set in the variable ${sourcedisk} and the destination is in ${destdisk}.

For UFS filesystems, the first step (which does require an outage) is to :-

  1. Stop the application that uses the filesystem being migrated.
  2. Unmount the filesystem.
  3. Encapsulate the existing filesystem device into a SVM metadevice: metainit d1001 1 1 ${sourcedisk}
  4. Create a mirror device with the new metadevice as a submirror: metainit d1000 -m d1001
  5. Change the references in /etc/vfstab to the old device name (${sourcedisk}) to the new mirror (not sub-mirror!) device – d1000
  6. Remount the filesystem and restart the application.

This should take no more than 10 minutes and is the only outage involved. There are two remaining sets of steps :-

  1. Create a new metadevice using the new disk: metainit d1002 1 1 ${destdisk}
  2. Attach the new metadevice to the mirror as an additional sub-mirror: metattach d1000 d1002

At this point, the mirror will start resilvering. It may take some time to complete, but the time it takes to do so does not really matter. In particular the resilvering process should not cause a performance problem to your application – the application I/O takes priority.

When the resilvering is complete :-

  1. Remove the metadevice containing the old SAN disk: metadetach d1000 d1001
  2. Remove the metadevice that is no longer required: metaclear d1001
  3. Attach “nothing” to the mirror metadevice (this is to ensure that the mirror grows to the size of the new submirror): metattach d1000
  4. Finally, ignore the warning on the manual page (which is outdated) and grow the filesystem: growfs -M /mount/point /dev/md/rdsk/d1000

You will see that I have used the metadevice names d1000 (for the mirror), d1001 (for the old sub-mirror), and d1002 (for the new submirror). Whatever device names you use, it is worth trying to be consistent – it helps a lot when you have dozens of filesystems to process.

ZFS Storage Pools

This is even simpler. If you have a storage pool called ${pool} which contains a single device called ${sourcedisk}, you simply :-

  1. Attach the new device: zpool attach ${pool} ${sourcedisk} ${destdisk}
  2. Wait for the resilvering to finish.
  3. Dettach the old device: zpool detach ${pool} ${sourcedisk}

Of course be aware of anything you read on the Internet! I have not actually tested the above; I’m merely regurgitating memory that has recently been exercised – I’m doing a SAN migration at work right now.

Oct 172009
 

If you are old enough to remember a time when if you were really lucky you might have access to a computer over a 9600 baud serial line connecting with a terminal, you may well have encountered the Compose key on DEC serial terminals (or in many other places). If you aren’t, I’ll have to explain what they are …

Imagine you have a US or UK keyboard, and suddenly have a need to enter an accented character (such as ü) – perhaps in a place name or perhaps you simply want to spell “café” properly for once. If you look at your keyboard you’ll find that the relevant characters do not appear anywhere. One of the solutions to this are the “dead letters” where certain symbols (such as “) work by putting the mark on the key over the next letter you type.

This apparently works well enough for those who enter such letters every other word or so, but I’m a monolingual Englishman who does not need them so often and I would rather have my quote key left alone thank you very much.

Now imagine a special key on the keyboard. Let us call it “Compose” for the want of any other name. You press it, and a fourth LED on your keyboard lights up. You can then enter any suitable two character sequence to generate accented characters or other symbols (½, «, ¡, ♯, ə, þ, etc.). Perhaps it might stretch your memory a bit remembering all the sequences, but you soon get used to much of it … it doesn’t take much memory capacity to remember that compose, u, ” becomes a ü, and that if you want anything with an umlaut on it, just use compose, whatever needs an umlaut, and “.

Back when I got started in IT, we had a bewildering variety of different types of keyboards with different layouts (and many of which were better by far for typing than most modern crud). For better or worse the IBM keyboard layout effectively won (the Macintosh keyboard is an IBM one with a few extra function keys and some of the modifiers relabelled). One of the big losses was the lack of a Compose key.

Let’s have it back!

Oh! And if you are going to have an “Alt GR” key to function as a “shift” key to enter funky symbols, please engrave the symbols on the front of the keys. You will notice that where the Shift key produces a different symbol, the different symbol is shown on the key – see the 1 key with ! shown.

Oct 102009
 

I have recently heard “push” email referred to as “gold-standard” mail by someone who should have known better. I disagree, although in many senses of the word, my own mail has been setup as “push” for many years now – far longer than “push” mail has been supported! Before kicking the idea of “push mail” being the cure for all ills into the grass, lets have a little review of what email is and the difference between “push” and “pull”.

Electronic mail is the computer version of those postcards you drop into letter boxes telling everyone (including the postman) what a great time you are having on holiday. It is not particularly private and is not necessarily very fast. We have gotten used to email normally arriving quickly – within minutes or even seconds, but that is not always the case. In common with the ordinary postal service (I am excluding special services such as recorded delivery), there is not even a guarantee of delivery – it is done on a best efforts basis.

Conventionally the majority of people “pulled” their email from their ISPs email server. When you wanted to read your email, you would start an email client (or commonly these days visit a webmail page and login) and it would pull your email into your email client. When connecting to your email server over a slow connection, the process of pulling in all the email could be quite slow.

To combat this problem, a few proprietary solutions appeared which ensured that the messages were pushed down to the device (as it happens a mobile phone) so that they were always ready when you wanted to read them. Essentially it was a trick – a neat trick, but a trick none the less that made the phone appear to be much faster at reading emails than other phones relying on the “pull” method.

Of course there’s a cost to all this pushing. The phone has to wake up every so often to allow the server(s) to push any available messages, which might not take much power but given the frequency with which it happens can have a big effect on how long your battery lasts.

And do we need the immediacy of push email (or other kinds of messages) ? Personally I think it is better to read (and respond) to messages when it is convenient to us to do so. Responding when the messages become available means being constantly interrupted.

At work I have seen those who have their machines configured to popup little messages whenever they get a message. I am amazed that people can get work done with these constant interruptions. Perhaps those who insist on push email are somewhat shallow, and have little need to concentrate on a task.

Oct 032009
 

Yesterday I went through the process of creating a ZFS storage pool with a single device :-

zpool create zt1 cXXXXX

Next adding an additional device to mirror the first :-

zpool attach zt1 cXXXXX cYYYYY

Watched it resilver, and then detached the first replica reducing the number of replicas to one :-

zpool detach zt1 cXXXXX

This is one of the nicest ways possible to migrate a large dataset from one set of devices to another (say replacing a SAN). However the documentation on Sun’s manual page for zpool is just a little vague in the relevant area and does not explicitly say that a single replica is a perfectly valid configuration.

This might all seem a little obvious, but removing a replica to reduce a storage pool to an pool without a mirror (no redundancy) is something that some volume managers don’t allow.