Difference between revisions of "Moving SME to new Hardware"
Line 10: | Line 10: | ||
Enable remote ssh access in the server-manager of <code>prodIP</code>.<br> | Enable remote ssh access in the server-manager of <code>prodIP</code>.<br> | ||
Log into the <code>prodIP</code> box and run an update<br> | Log into the <code>prodIP</code> box and run an update<br> | ||
− | + | ||
− | + | yum update | |
− | + | ||
If packages were updated signalling post-upgrade and reboot events is required. | If packages were updated signalling post-upgrade and reboot events is required. | ||
Line 42: | Line 42: | ||
=== Copying data === | === Copying data === | ||
Run the Affa job on the <code>newIP</code> box | Run the Affa job on the <code>newIP</code> box | ||
− | + | ||
− | + | affa --run prodserv | |
− | + | ||
Depending on the amount of data and the speed of hardware and network this first job run can take a really long time. | Depending on the amount of data and the speed of hardware and network this first job run can take a really long time. | ||
Now view the file <code>/var/affa/prodserv/rpms-missing.txt</code> | Now view the file <code>/var/affa/prodserv/rpms-missing.txt</code> | ||
− | + | ||
− | + | less /var/affa/prodserv/rpms-missing.txt | |
− | + | ||
You will find a list of RPMs which are installed on <code>prodIP</code> but not on this server (<code>newIP</code>) and also RPMs installed with different versions. Install or update the listed RPMs. To verify you can run the steps of this chapter again. Finally the rpms-missing.txt should not list any RPMs. | You will find a list of RPMs which are installed on <code>prodIP</code> but not on this server (<code>newIP</code>) and also RPMs installed with different versions. Install or update the listed RPMs. To verify you can run the steps of this chapter again. Finally the rpms-missing.txt should not list any RPMs. | ||
Line 56: | Line 56: | ||
Ask your users to log off.<br> | Ask your users to log off.<br> | ||
Log into the <code>prodIP</code> box and stop all services that can modify data. | Log into the <code>prodIP</code> box and stop all services that can modify data. | ||
− | + | ||
− | + | SVC='qpsmtpd sqpsmtpd crond imap pop3 imaps pop3s ftp httpd-e-smith atalk smb qmail' | |
− | + | for s in $SVC; do service $s stop; done | |
− | + | ||
'''''Note:''' Downtime of the production server starts here'' | '''''Note:''' Downtime of the production server starts here'' | ||
Log into the <code>newIP</code> box and run the Affa job again | Log into the <code>newIP</code> box and run the Affa job again | ||
− | + | ||
− | + | affa --run prodserv | |
− | + | ||
This run will complete very quickly as only differences since the the last run needs to be synchronsized. | This run will complete very quickly as only differences since the the last run needs to be synchronsized. | ||
=== Switch over to the new hardware === | === Switch over to the new hardware === | ||
Log into the <code>prodIP</code> box and power it off | Log into the <code>prodIP</code> box and power it off | ||
− | + | ||
− | + | poweroff | |
− | + | ||
Log into the <code>newIP</code> box and rise this server to your production server | Log into the <code>newIP</code> box and rise this server to your production server | ||
− | + | ||
− | + | affa --rise prodserv | |
− | + | ||
This action will complete very quickly as only hardlinks are used and no data is physically moved.<br> | This action will complete very quickly as only hardlinks are used and no data is physically moved.<br> | ||
Now do a reboot | Now do a reboot | ||
− | + | ||
− | + | reboot | |
'''''Note:''' Downtime of the production server ends here'' | '''''Note:''' Downtime of the production server ends here'' | ||
− | + | ||
You now have an identical copy of your old production server running on the new hardware. Your users can now log on. | You now have an identical copy of your old production server running on the new hardware. Your users can now log on. | ||
Line 88: | Line 88: | ||
=== Cleaning up === | === Cleaning up === | ||
Remove the Affa archives | Remove the Affa archives | ||
− | + | ||
− | + | /bin/rm -rf /var/affa | |
− | + | ||
Remove the Affa packages | Remove the Affa packages | ||
− | + | ||
− | + | yum remove smeserver-affa perl-Filesys-DiskFree | |
− | + | ||
=== Additional information === | === Additional information === | ||
Line 104: | Line 104: | ||
* You cannot use the RPM comparision, as SME 6 doesn't have yum installed and all packages would differ anyway. Skip <code>db affa setprop prodserv RPMCheck yes</code> | * You cannot use the RPM comparision, as SME 6 doesn't have yum installed and all packages would differ anyway. Skip <code>db affa setprop prodserv RPMCheck yes</code> | ||
* You must set rsync--inplace to no: | * You must set rsync--inplace to no: | ||
− | + | ||
− | + | db affa setprop prodserv rsync--inplace no | |
− | + | ||
* The command <code>affa --rise prodserv</code> will complain about old-style db paths. Ignore these errors. After reboot login as admin on the '''local''' console and set the new Network Interfaces manually. Reboot again. | * The command <code>affa --rise prodserv</code> will complain about old-style db paths. Ignore these errors. After reboot login as admin on the '''local''' console and set the new Network Interfaces manually. Reboot again. | ||
* You cannot work remotely. | * You cannot work remotely. | ||
[[Category: Howto]] | [[Category: Howto]] | ||
---- | ---- |
Revision as of 22:30, 10 March 2008
Introduction
There many ways to move a SME 7 Server installation to new hardware.
This document describes a method using the Affa contrib.
Affa makes it possible to move with a minimal downtime of the production server.
In the following it is assumed that prodIP
is the IP address of your production server and newIP
is the IP address of the new server hardware. Replace both placeholders by your real IP addresses.
Preparation
Production server
Enable remote ssh access in the server-manager of prodIP
.
Log into the prodIP
box and run an update
yum update
If packages were updated signalling post-upgrade and reboot events is required.
New hardware
Install SME Server from the latest CDROM/ISO. Assign an unused IP address (newIP
) and disable DHCP.
Enable remote ssh access in the server-manager on the newIP box.
Note: From now on all further steps can be done remotely via ssh login.
Log into the newIP
box and run an update
yum update
Signalling post-upgrade and reboot events is required.
Install the Affa RPM
/usr/bin/yum install --enablerepo=smecontribs smeserver-affa
Configure Affa
db affa set prodserv job db affa setprop prodserv remoteHostName prodIP db affa setprop prodserv RPMCheck yes
Generate DSA keys and send the public key to the prodIP
server
affa --send-key prodserv
Copying data
Run the Affa job on the newIP
box
affa --run prodserv
Depending on the amount of data and the speed of hardware and network this first job run can take a really long time.
Now view the file /var/affa/prodserv/rpms-missing.txt
less /var/affa/prodserv/rpms-missing.txt
You will find a list of RPMs which are installed on prodIP
but not on this server (newIP
) and also RPMs installed with different versions. Install or update the listed RPMs. To verify you can run the steps of this chapter again. Finally the rpms-missing.txt should not list any RPMs.
Final data synchronization
Ask your users to log off.
Log into the prodIP
box and stop all services that can modify data.
SVC='qpsmtpd sqpsmtpd crond imap pop3 imaps pop3s ftp httpd-e-smith atalk smb qmail' for s in $SVC; do service $s stop; done
Note: Downtime of the production server starts here
Log into the newIP
box and run the Affa job again
affa --run prodserv
This run will complete very quickly as only differences since the the last run needs to be synchronsized.
Switch over to the new hardware
Log into the prodIP
box and power it off
poweroff
Log into the newIP
box and rise this server to your production server
affa --rise prodserv
This action will complete very quickly as only hardlinks are used and no data is physically moved.
Now do a reboot
reboot
Note: Downtime of the production server ends here
You now have an identical copy of your old production server running on the new hardware. Your users can now log on.
Cleaning up
Remove the Affa archives
/bin/rm -rf /var/affa
Remove the Affa packages
yum remove smeserver-affa perl-Filesys-DiskFree
Additional information
Performance
With this method you should be able to move a typical 50 Gbyte sized server to new hardware with downtime less than 20 minutes. The final sync and the rise time does not really depend on the total files size, but on the number of files and directories.
SME 6 Server
Although Affa was designed for SME 7, you can move a SME 6 server to a hardware with SME 7 installed. But there are a few restrictions:
- You cannot yum update the SME 6
- You cannot use the RPM comparision, as SME 6 doesn't have yum installed and all packages would differ anyway. Skip
db affa setprop prodserv RPMCheck yes
- You must set rsync--inplace to no:
db affa setprop prodserv rsync--inplace no
- The command
affa --rise prodserv
will complain about old-style db paths. Ignore these errors. After reboot login as admin on the local console and set the new Network Interfaces manually. Reboot again. - You cannot work remotely.