Skip to content

Instantly share code, notes, and snippets.

@rab
Created March 17, 2011 19:44
Show Gist options
  • Save rab/874985 to your computer and use it in GitHub Desktop.
Save rab/874985 to your computer and use it in GitHub Desktop.
Steps for getting the 500Gb drives into the old server
  • Receive the pair of 500Gb drives for the old server.
  • REMOTE
    • turn off all datafeeds (done)
    • StylePath is DOWN (Thu 18:45)
    • do a full backup [A] (done at Thu 19:41)
    • StylePath is UP (~1hr downtime) (Thu 19:52, actual down 1:07)
  • copy the backup to new server and to a USB drive
  • begin restore of backup [A] to the new server running 5.1 (Thu 20:08)
    • (time passes; expect ~9hrs)
    • finish restore of backup [A] to new server running 5.1 (Fri 16:25, 20:18 elapsed)
  • ONSITE
    • StylePath is DOWN (Fri 18:04)
    • limited backup of tables that are volatile [B] (Fri 18:30)
      • sessions
      • users
      • styles
      • style_items
      • gallery_styles
      • gallery_style_items
      • style_caches
      • style_cache_items
  • restore limited backup [B] to new server running 5.1
  • “unmount” the partition using the drive pair to be replaced
  • shutdown
  • swap the drives (73gb out; 500gb in)
  • restart (Fri 19:28)
  • configure the new drives with filesystem and LVM (logical volume manager),
    • 300gb for database (actually, 320Gb)
    • 100gb for datafeeds (actually, 96Gb)
    • ~100gb (remaining) unallocated reserve (actually, 49.25Gb free)
      • Gigabyte (gb; 109) v. Gibibyte (Gb; 230==1,073,741,824)
      • 500gb == 465.25Gb
  • get MySQL updated to 5.1
  • create the bare schema
  • start the restore of [A] onto old server (with a stacked command to page me when it completes) (Sat early AM)
  • reinstall mysql gem against 5.1 (not needed)
  • point the application to the MySQL running on the new server
  • trouble getting old server to connect to MySQL on new server (!)
  • Ah, Firewall rules (security sucks when it works even when you don’t want it to)
  • StylePath is UP (1-2hrs downtime) (Sat 11:08; 17 hours)
  • restore to big disks done (Sat 17:15)
  • REMOTE
    • StylePath is DOWN (Sat 22:47)
    • limited backup on new server of tables that are volatile © (Sun 00:01)
  • restore limited backup © to old server running 5.1 (Sun 00:04)
  • point the application to the MySQL running on the old server
  • StylePath is UP (~1hr downtime) (Sun 00:30; 1:43 down)

At this point the configurations would be:

  • Old Server (stylepath.com)
    • MySQL 5.1
    • 73Gb system disk pair
    • 500Gb database (60%) + datafeed (20%) disk pair; (20% reserve)
      • Of the 300Gb allocated to database, probably 40-70Gb will be initially be used.
  • New Server (interior-design-daily.com)
    • MySQL 5.1
    • 160Gb disk pair (system, wordpress, database)

TODO:

  • upgrade new server to MySQL 5.5
  • establish a staging environment on new server
  • upgrade old server to MySQL 5.5
  • move non-database datafeed processing to new server
    • canonical add, update, or delete feeds can be dropped on old server to be consumed by a single process

To summarize, the Memory storage engine is an order of magnitude faster then MyISAM or InnoDB, but all updates are lost when the server is restarted. Tables using this storage engine can be initialized from a data file. This makes updating these tables a bit more complicated because we have to put the updates on the data file. It’s a good fit for reference tables that rarely change or don’t change at all.

After scanning the schema, I think these tables are a good fit for the
Memory storage engine:

  • affiliate_networks
  • colors
  • galleries
  • gallery_categories
  • gallery_rooms
  • palettes
  • pages
  • tags

I think that wraps up the tasks we discussed last week. What do you think I should do next? I can start installing MySQL 5.5 on server2, but I’ll need sudo rights for that.

  • MyISAM:
    • cluster_traits
    • galleries
    • possible_categories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment