<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1750598411512857410</id><updated>2012-02-16T08:41:20.194-08:00</updated><title type='text'>Server Synchronisation Blog</title><subtitle type='html'>This blog is written to help others use rsync to successfully synchronize servers running CentOS Linux, DSpace, LAMS, Mahara and Moodle. It covers synchronization between servers with identical hardware architectures and different hardware architectures. It is also a guide to using rsync to create a mirrored hot backup server.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://synchronisationbromley.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1750598411512857410/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://synchronisationbromley.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>clive</name><uri>http://www.blogger.com/profile/04834932543873462481</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_q1s98Hsu7OI/SuLawcqhM5I/AAAAAAAAAAM/mv6_N0TRJtU/S220/f2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1750598411512857410.post-264304827391190389</id><published>2009-06-25T04:21:00.001-07:00</published><updated>2010-03-28T04:50:16.036-07:00</updated><title type='text'>DSpace, LAMS, Mahara and OpenSim install on CentOS</title><content type='html'>There are five blogs in this series.&lt;br /&gt;&lt;br /&gt;Please select the link below as required:-&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dspacebromley.blogspot.com/"&gt;DSpace Install Blog&lt;/a&gt;   &lt;br /&gt;&lt;br /&gt;&lt;a href="http://lamsbromley.blogspot.com/"&gt;LAMS Install Blog&lt;/a&gt;   &lt;br /&gt;&lt;br /&gt;&lt;a href="http://maharabromley.blogspot.com/"&gt;Mahara Install Blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://opensimbromley.blogspot.com/"&gt;OpenSim Install Blog&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://synchronisationbromley.blogspot.com/"&gt;Server Syncronisation Blog&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1750598411512857410-264304827391190389?l=synchronisationbromley.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://synchronisationbromley.blogspot.com/feeds/264304827391190389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://synchronisationbromley.blogspot.com/2009/06/dspace-lams-and-mahara-install-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1750598411512857410/posts/default/264304827391190389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1750598411512857410/posts/default/264304827391190389'/><link rel='alternate' type='text/html' href='http://synchronisationbromley.blogspot.com/2009/06/dspace-lams-and-mahara-install-on.html' title='DSpace, LAMS, Mahara and OpenSim install on CentOS'/><author><name>clive</name><uri>http://www.blogger.com/profile/04834932543873462481</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_q1s98Hsu7OI/SuLawcqhM5I/AAAAAAAAAAM/mv6_N0TRJtU/S220/f2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1750598411512857410.post-6396622317619259479</id><published>2009-06-10T22:26:00.001-07:00</published><updated>2009-08-24T00:48:23.618-07:00</updated><title type='text'>Mirroring non identical servers using rsync</title><content type='html'>I wrote this blog after spending some time learning how to synchronise the software build between two servers with different hardware architectures (including different drive partitioning) but both running the same version of CentOS Linux. &lt;br /&gt;&lt;br /&gt;As part of upgrading our VLE servers found a need to mirror software builds on servers. These servers run CentOS 5, DSpace, LAMS, Mahara and Moodle. &lt;br /&gt;&lt;br /&gt;Looking on the Web for rsync scripts with lists of files to exclude the main message I got was "Don't do it, it can't be done". This blog explains how it can be done very successfully;)&lt;br /&gt;&lt;br /&gt;We had two servers standbyvle and vle and I wanted to create a copy of the software build on standbyvle onto vle. In this case it was not just a hot backup exercise as the hostname and hardware configuraton of each server was different.&lt;br /&gt;&lt;br /&gt;The standbyvle server was already running DSpace, LAMS, Mahara and Moodle. I wanted to save myself the trouble of re-installing these applications and their associated data on the new server.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;General Synchronisation Issues&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The first step was to perform a complete install of CentOS 5.3 on the vle server and get it up and running. After this is I ran yum update on both servers to make sure the OS software builds were as similar as possible. Both servers had "everything" installed on their package list. To be on the safe side I made sure both servers were booting from the same version of the kernel.&lt;br /&gt;&lt;br /&gt;It was now a case of setting up the rsync server on the destination machine (vle). I edited /etc/rsyncd.conf on vle and used the following settings:&lt;br /&gt;&lt;br /&gt;max connections = 10&lt;br /&gt;log file = /var/log/rsync.log&lt;br /&gt;timeout = 300&lt;br /&gt;[root]&lt;br /&gt;       comment = Welcome to rsync on the vle server...&lt;br /&gt;       path = /&lt;br /&gt;       read only = no&lt;br /&gt;       list = yes&lt;br /&gt;       uid = root&lt;br /&gt;       gid = root&lt;br /&gt;       hosts allow = 10.100.0.22&lt;br /&gt;&lt;br /&gt;Where 10.100.0.22 is the internal IP address of the standbyvle server&lt;br /&gt;&lt;br /&gt;I then started the rsync process on vle as follows:&lt;br /&gt;&lt;br /&gt;rsync --daemon&lt;br /&gt;&lt;br /&gt;It was now a question of getting the rsync command on the source machine (standbyvle) right. The command line that worked for me was:&lt;br /&gt;&lt;br /&gt;rsync -av --delete --exclude-from=/root/bin/excluded_standbyvle_vle / 10.100.0.20::root&lt;br /&gt;&lt;br /&gt;Where 10.100.0.20 is the internal IP address of the vle server&lt;br /&gt;&lt;br /&gt;The file /root/bin/excluded_standbyvle_vle contains the "magic" list of files to be excluded. These are largely machine specific (hardware/IP address/FQDN) and we do not want them copied over. &lt;br /&gt;&lt;br /&gt;[root@standbyvle bin]# cat excluded_standbyvle_vle&lt;br /&gt;/boot/&lt;br /&gt;/dev/&lt;br /&gt;/etc/cups/&lt;br /&gt;/etc/fstab&lt;br /&gt;/etc/hosts&lt;br /&gt;/etc/ld.so.conf.d/&lt;br /&gt;/etc/mail/sendmail.cf&lt;br /&gt;/etc/modprobe.conf&lt;br /&gt;/etc/modules.conf&lt;br /&gt;/etc/mtab&lt;br /&gt;/etc/ssh/&lt;br /&gt;/etc/sysconfig/&lt;br /&gt;/etc/X11/xorg.conf&lt;br /&gt;/etc/xen/&lt;br /&gt;/home/clive/.bashrc&lt;br /&gt;/home/clive/.ssh/&lt;br /&gt;/home/mysqlbackup/&lt;br /&gt;/home/server_a/&lt;br /&gt;/home/vleinternal/&lt;br /&gt;/home/vletransfer/&lt;br /&gt;/lib/modules/&lt;br /&gt;/lost+found/&lt;br /&gt;/media/&lt;br /&gt;/mnt/&lt;br /&gt;/proc/&lt;br /&gt;/root/.bashrc&lt;br /&gt;/root/.ssh/&lt;br /&gt;/root/bin/backup&lt;br /&gt;/sys/&lt;br /&gt;/usr/src/kernels/&lt;br /&gt;/var/cache/&lt;br /&gt;/var/lib/ntp/&lt;br /&gt;/var/lib/xen/&lt;br /&gt;/var/lib/xenstored/&lt;br /&gt;/var/lock/&lt;br /&gt;/var/log/&lt;br /&gt;/var/named/chroot/proc/&lt;br /&gt;/var/run/&lt;br /&gt;/var/spool/&lt;br /&gt;/tmp/&lt;br /&gt;&lt;br /&gt;On rebooting vle after synchronisation was complete it successfully came back up with the complete software build of standbyvle on it :D&lt;br /&gt;&lt;br /&gt;The the root and dspace crontabs in /var/spool/cron were not copied over. These had to be copied over manually.&lt;br /&gt;&lt;br /&gt;It was also necessary to configure sendmail to listen on port 25 of the vle servers IP address.&lt;br /&gt;&lt;br /&gt;Note: To date (August 2009) I have temporarily disabled automatic kernel updates on the vle server as on a previous "test" run between a different pair of servers a yum kernel update broke the destination server boot process. I am going to use yum to manually update the kernel later in the year (College holidays!) and see if the server will still boot.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Getting Moodle Working&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In order to get Moodle working on the new server it was necessary to edit moodle's config.php script and change the wwwroot directive to reflect the change in FQDN.&lt;br /&gt;&lt;br /&gt;cd /home/vle0910user/moodle&lt;br /&gt;nano config.php&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Getting DSpace Working&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In order to get DSpace working on the new server it was necessary to change every occurence of the old FQDN with the new FQDN in dspace.cfg (Next time I'll use sed as a search and replace tool as I missed several ocurrences first time round!)&lt;br /&gt;&lt;br /&gt;nano /home/dspace/config/dspace.cfg&lt;br /&gt; &lt;br /&gt;DSpace was then rebuilt and restarted as follows:&lt;br /&gt; &lt;br /&gt;cd /home/dspace/dspace-1.5.2-src-release/dspace&lt;br /&gt;mvn package&lt;br /&gt;cd /home/dspace/dspace-1.5.2-src-release/dspace/target/dspace-1.5.2-build.dir&lt;br /&gt;ant -Dconfig=/home/dspace/config/dspace.cfg update&lt;br /&gt; &lt;br /&gt;su - root&lt;br /&gt;service tomcat stop&lt;br /&gt;service tomcat start&lt;br /&gt;&lt;br /&gt;For some reason it was also necessary to restart tomcat and postgresql manually before all was well.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Gettings LAMS Working&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;As LAMS was already installed any subsequent configuration changes were made from an Admin login by following the following sequence of menus:&lt;br /&gt;&lt;br /&gt;Sys Admin &gt;  Edit Configuration Settings &gt; System Configuration &lt;br /&gt;&lt;br /&gt;The Server URL parameter was changed to reflect the new FQDN and the changes saved. The firewire server running on 127.0.0.1 did not require any changes to its configuration settings.&lt;br /&gt;&lt;br /&gt;It was also necessary to go to Sys Admin &gt; Maintain Integrated Servers and create an entry for Moodle on the standbyvle server.&lt;br /&gt;&lt;br /&gt;After saving the changes Moodle needed to be configured. From the Administration &gt; Modules &gt; Activities &gt; LAMSv2 page the revised settings for the parameters server_url, server_id, server_key and request_source were entered. The connection with LAMS was then validated. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Getting Mahara Working&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Moodle refused to integrate with Mahara due to the change in server URL but still keeping the old public key for Mahara, which is server specific. It is possible to tell Moodle to generate a new public key, but this is more difficult with Mahara. The only way of getting Mahara to generate a new key was to delete the openssl fields in the database, at which point Mahara then generates the new key.&lt;br /&gt;&lt;br /&gt;I used phpPgAdmin to edit the Mahara database directly and deleted all records in the mahconfig table containing the following fields:&lt;br /&gt;&lt;br /&gt;openssl_generations &lt;br /&gt;openssl_history &lt;br /&gt;openssl_keypair&lt;br /&gt;openssl_keypair_expires&lt;br /&gt;&lt;br /&gt;Mahara then automatically generated the ssl key and repopulated the table.&lt;br /&gt;&lt;br /&gt;It was then just a matter of following the mahoodle documentation and the installation of Moodle on vle worked just fine with the installation of Mahara on vle :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Setting up a Hot Backup Server&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We have also moved our hot backup server (testvle) ino the DMZ and rebuilt it with CentOS 5. This machine has identical hardware to the vle server and can be brought up in an emergency as vle in the time it takes to reboot the machine.&lt;br /&gt;&lt;br /&gt;The original process which this was based on can be found at the following blog:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.linuxtraining.org.uk/blogger.html#twelve"&gt;http://www.linuxtraining.org.uk/blogger.html#twelve&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The latest version of the backup script is shown below:&lt;br /&gt;&lt;br /&gt;[root@vle bin]# cat backup&lt;br /&gt;echo "Dspace anti-virus scan"&lt;br /&gt;/usr/local/bin/clamscan --infected -r /home/dspace/assetstore&lt;br /&gt;echo " "&lt;br /&gt;service mysqld stop&lt;br /&gt;service postgresql stop&lt;br /&gt;rsync -av --delete --exclude-from=/root/bin/excluded_vle_testvle / 10.100.0.21::backup&lt;br /&gt;rsync -av --delete /var/log/freshclam.log 10.100.0.21::backup/var/log&lt;br /&gt;if test $(date | cut -c-3) = Sun&lt;br /&gt;then&lt;br /&gt;echo "Weekly backup"&lt;br /&gt;service httpd stop&lt;br /&gt;service tomcat stop&lt;br /&gt;service handle stop&lt;br /&gt;rsync -av --delete /home/dspace /home/backup/weekly&lt;br /&gt;rsync -av --delete /home/vle0910 /home/backup/weekly&lt;br /&gt;rsync -av --delete /home/vle0910user /home/backup/weekly&lt;br /&gt;rsync -av --delete /var/lib/mysql/vle0910 /home/backup/weekly/mysql&lt;br /&gt;rsync -av --delete /var/lib/pgsql/data /home/backup/weekly/pgsql&lt;br /&gt;sleep 30&lt;br /&gt;service httpd start&lt;br /&gt;service tomcat start&lt;br /&gt;service handle start&lt;br /&gt;fi&lt;br /&gt;if test $(date | cut -c9-10) = 28&lt;br /&gt;then&lt;br /&gt;echo "Monthly backup"&lt;br /&gt;sleep 30&lt;br /&gt;service httpd stop&lt;br /&gt;service tomcat stop&lt;br /&gt;service handle stop&lt;br /&gt;rsync -av --delete /home/dspace /home/backup/monthly&lt;br /&gt;rsync -av --delete /home/vle0910 /home/backup/monthly&lt;br /&gt;rsync -av --delete /home/vle0910user /home/backup/monthly&lt;br /&gt;rsync -av --delete /var/lib/mysql/vle0910 /home/backup/monthly/mysql&lt;br /&gt;rsync -av --delete /var/lib/pgsql/data /home/backup/monthly/pgsql&lt;br /&gt;sleep 30&lt;br /&gt;service httpd start&lt;br /&gt;service tomcat start&lt;br /&gt;service handle start&lt;br /&gt;fi&lt;br /&gt;service postgresql start&lt;br /&gt;service mysqld start&lt;br /&gt;&lt;br /&gt;The excluded file list is shown below:&lt;br /&gt;&lt;br /&gt;[root@vle bin]# cat excluded_vle_testvle&lt;br /&gt;/dev/pts/&lt;br /&gt;/dev/.udev/&lt;br /&gt;/etc/cron.hourly/virusscan&lt;br /&gt;/etc/cron.weekly/dspace&lt;br /&gt;/etc/cups/&lt;br /&gt;/etc/hosts&lt;br /&gt;/etc/mail/sendmail.cf&lt;br /&gt;/etc/rc.d/rc.local&lt;br /&gt;/etc/rsyncd.conf&lt;br /&gt;/etc/sysconfig/network&lt;br /&gt;/etc/sysconfig/network-scripts/&lt;br /&gt;/home/backup/&lt;br /&gt;/home/clive/.bashrc&lt;br /&gt;/media/&lt;br /&gt;/proc/&lt;br /&gt;/root/.bashrc&lt;br /&gt;/root/bin/backup&lt;br /&gt;/selinux/&lt;br /&gt;/sys/&lt;br /&gt;/var/lib/mrtg/mrtg.ok&lt;br /&gt;/var/lib/ntp/&lt;br /&gt;/var/lib/slocate/&lt;br /&gt;/var/lib/slocate/slocate.db&lt;br /&gt;/var/lock/&lt;br /&gt;/var/log/&lt;br /&gt;/var/named/chroot/proc/&lt;br /&gt;/var/run/&lt;br /&gt;/var/spool/clientmqueue/&lt;br /&gt;/var/spool/cron/dspace&lt;br /&gt;/var/spool/cron/root&lt;br /&gt;/var/spool/mail/&lt;br /&gt;/var/spool/mqueue/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1750598411512857410-6396622317619259479?l=synchronisationbromley.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://synchronisationbromley.blogspot.com/feeds/6396622317619259479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://synchronisationbromley.blogspot.com/2009/06/test-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1750598411512857410/posts/default/6396622317619259479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1750598411512857410/posts/default/6396622317619259479'/><link rel='alternate' type='text/html' href='http://synchronisationbromley.blogspot.com/2009/06/test-post.html' title='Mirroring non identical servers using rsync'/><author><name>clive</name><uri>http://www.blogger.com/profile/04834932543873462481</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_q1s98Hsu7OI/SuLawcqhM5I/AAAAAAAAAAM/mv6_N0TRJtU/S220/f2.jpg'/></author><thr:total>0</thr:total></entry></feed>
