Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
On Fri, Apr 18, 2008 at 11:24:23AM +0200, Leroy van Logchem wrote:
>
>> faced with the issue of needing to replace the current hard-drives
>> with much larger ones and need to do this while keeping the MySQL
>> instance available.
>
> To avoid:
> - mixing up the partitions
hm?
> - tricky filesystem growing
ok, if you cannot online-grow, that would be a problem.
but otherwise, say you are on recent and prepared ext3,
or on xfs anyways, where is the "trickyness"?
> - running out of time during the migration
why do you see a problem there?
> You could:
>
> 1) Make sure the secondary node does not reconnect by:
> -- Changing /etc/drbd.conf ip and/or port numbers to none existing ones
> -- Disable automatic starting of drbd and heartbeat etc
> 2) Replace the disks and configure the partitions for drbd usage
> -- Perhaps setup seperate metadata
> 3) Manually get drbd running
> -- Force to primary
> -- Create the filesystem(s)
> -- Mount it
> 4) Copy the currently running MySQL to your new setup
> -- By means of rsync and mysqlhotcopy
> -- Change the bind-address so you can test
>
> When it's running fine again then re-enable the service startup and
> prepare the final fail-over:
>
> 1) Stop everything on the new setup and get back to the original
> configuration files
> 2) After a final hotcopy, pull the plug on the old primary
> 3) Let the new setup start as primary
>
> (this should be scripted to have the smallest gap possible)
>
> Now the server with the smaller disks can be upgraded. Only redo the
> partitioning steps, so skip the mkfs. During the long initial sync you
> might want to limit the bandwidth ( force changing speeds by
> disconnect/reconnect and drbdadm adjust all etc.. verify by watching
> /proc/drbd ).
perfectly fine recipe.
however, I would
stop heartbeat and drbd on secondary.
disable their initscripts (e.g. chmod -x)
[segno]
preferably find a way to attach both new and old disks to this box
dd_rescue /dev/old/lower-level /dev/new/lower-level
dd_rescue /dev/old/meta-data /dev/new/meta-data
disconnect the old devices
reconfigure drbd to use the new storage
drbdadm attach
should come up as Secondary/Unknown Consistent/DUnknown,
or Secondary/Unknown UpToDate/DUnknown,
depending on your configuration
drbdadm adjust
wait for the (incremental) sync
re-enable init scripts, start heartbeat on upgraded node
[coda]
do a switchover
dal segno al coda for other now secondary node
drbdadm resize (on both boxes).
wait for sync of new data area
online-grow file system on primary box.
start a low-bandwidth verify from the secondary.
--
: Lars Ellenberg http://www.linbit.com :
: DRBD/HA support and consulting sales at linbit.com :
: LINBIT Information Technologies GmbH Tel +43-1-8178292-0 :
: Vivenotgasse 48, A-1120 Vienna/Europe Fax +43-1-8178292-82 :
__
please don't Cc me, but send to list -- I'm subscribed