Updates to our upgrade process
Originally posted on Jan 24, 2018.
This winter like many other institutions we applied the latest CU to enable the crocodoc to box transition.
The upgrades worked well as we were able to update and adjust the implementation plans we had spent a lot of time on last year.
Changes undone by new CUs.
Cumulative Updates use the full installation procedure and will usually undo changes to configuration files that have been made previously to resolve known issues. This means that when applying a CU or performing a new upgrade that one should verify whether the installer has undone changes and redo them. This became immediately clear to us this winter. This blog post covers what we did to make the experience less painful.
Last summer we had already started documenting the fixes we had made separately so that they were not lost and forgotten in old implementation plans, so we had a nice list of fixes to check. Now when applying a new CU we have to check whether those fixes have been undone. Here are the changes we made to our procedures to deal with this.
1. Analyse whether changes have been made to key files.
Before the upgrade we copy all the files to which we make changes to a separate directory outside of Blackboard.
mkdir /home/bbuser/original_filescp /usr/local/blackboard/config/bb-config.properties /home/bbuser/original_files/ cp /usr/local/blackboard/config/bb-config.properties.template /home/bbuser/original_files/ cp /usr/local/blackboard/config/tomcat/conf/wrapper.conf /home/bbuser/original_files/ cp /usr/local/blackboard/config/tomcat/conf/wrapper.conf.bb /home/bbuser/original_files/ cp /usr/local/blackboard/config/tomcat/conf/server.xml.bb /home/bbuser/original_files/ cp /usr/local/blackboard/config/internal/http-cacheable-extensions.txt /home/bbuser/original_files/ cp /usr/local/blackboard/config/internal/xythos-indexing-filter.txt /home/bbuser/original_files/ cp /usr/local/blackboard/config/tomcat/classes/Search.properties.bb /home/bbuser/original_files/ cp /usr/local/blackboard/config/tomcat/classes/Search.properties /home/bbuser/original_files/ cp /usr/local/blackboard/config/service-config.properties /home/bbuser/original_files/ cp /usr/local/blackboard/config/internal/nautilus-config.properties /home/bbuser/original_files/
Then after the upgrade we make copy those files again to a different directory.
mkdir /home/bbuser/post_upgrade_files
cp /usr/local/blackboard/config/internal/http-cacheable-extensions.txt /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/internal/xythos-indexing-filter.txt /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/tomcat/conf/server.xml.bb /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/internal/nautilus-config.properties /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/service-config.properties /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/tomcat/conf/wrapper.conf /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/tomcat/conf/wrapper.conf.bb /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/bb-config.properties /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/bb-config.properties.template /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/tomcat/classes/Search.properties.bb /home/bbuser/post_upgrade_files/
cp /usr/local/blackboard/config/tomcat/classes/Search.properties /home/bbuser/post_upgrade_files/
We then use diff to analyse whether the files have changed.
diff /home/bbuser/original_files/bb-config.properties /home/bbuser/post_upgrade_files/bb-config.propertiesdiff /home/bbuser/original_files/bb-config.properties.template /home/bbuser/post_upgrade_files/bb-config.properties.templatediff /home/bbuser/original_files/http-cacheable-extensions.txt /home/bbuser/post_upgrade_files/http-cacheable-extensions.txtdiff /home/bbuser/original_files/nautilus-config.properties /home/bbuser/post_upgrade_files/nautilus-config.propertiesdiff /home/bbuser/original_files/Search.properties /home/bbuser/post_upgrade_files/Search.propertiesdiff /home/bbuser/original_files/Search.properties.bb /home/bbuser/post_upgrade_files/Search.properties.bbdiff /home/bbuser/original_files/server.xml.bb /home/bbuser/post_upgrade_files/server.xml.bbdiff /home/bbuser/original_files/service-config.properties /home/bbuser/post_upgrade_files/service-config.propertiesdiff /home/bbuser/original_files/wrapper.conf /home/bbuser/post_upgrade_files/wrapper.confdiff /home/bbuser/original_files/wrapper.conf.bb /home/bbuser/post_upgrade_files/wrapper.conf.bbdiff /home/bbuser/original_files/xythos-indexing-filter.txt /home/bbuser/post_upgrade_files/xythos-indexing-filter.txt
This tells us not only if our fixes have been undone by the installer, but also whether additional changes have been made to the file concerned. If no other changes have been made we can copy the old file back rather than edit it within the Blackboard directory, saving typing time.
2. Produce verification scripts to verify whether the changes we have made have been done successfully.
Previously, we made individual test to verify whether a change had been correctly made. For example:
grep 'eot\|ttf\|woff' /usr/local/blackboard/config/internal/http-cacheable-extensions.txt | wc -l >> Result must equal 3.
The number of these grew during the project and so to save time and make it simpler we developed a pair of scripts that would perform the checks and report back in red or green text whether the verifications had passed or failed and what the result of the test was. We broke these down into two separate scripts, one checking the bb-config.properties file where most of our changes are, and the other checking changes to any other files.
The scripts also check the hostname to be sure whether settings that should be only set on the tasks node are set on the tasks node, e.g. the “backend.processor” setting.
Here are example screenshots showing the output of the scripts.
And here is the code for one of the scripts as an example.
#!/bin/bash# Checking script for Blackboard 2016 Q4 CU6 Upgrade - bb.config.properties checks# Set coloursred=$'\e[1;31m'grn=$'\e[1;32m'end=$'\e[0m'# Set variables# Hostnamehostname=$(hostname)# Details for SCORM fixScormFixinbbcptemplate=$(cat /usr/local/blackboard/config/bb-config.properties.template | grep "ancestors=self'")ScormFixinbbcp=$(cat /usr/local/blackboard/config/bb-config.properties | grep "ancestors=self'")# Details for tomcat settingsbbconfigjvmoptionsextratomcat=$(cat /usr/local/blackboard/config/bb-config.properties | grep "bbconfig.jvm.options.extra.tomcat")bbconfigjvmoptionsgc=$(cat /usr/local/blackboard/config/bb-config.properties | grep "bbconfig.jvm.options.gc")# DMARC settingbbconfigemaildmarc=$(cat /usr/local/blackboard/config/bb-config.properties | grep "bbconfig.email.use.dmarc.from.override=")# Backend processor setting (note different on tasks/web nodes)backendproc=$(cat /usr/local/blackboard/config/bb-config.properties | grep "bbconfig.server.backend.processor")# HTTP compression settinghttpcomp=$(cat /usr/local/blackboard/config/bb-config.properties |grep bbconfig.appserver.http.compression)# Clear the screenclear# Report resultsecho "bb.config.properties checks on $hostname"echo ""echo ""echo "Test 1 - Scorm Fix in bbcp-template"echo ""if [ "$ScormFixinbbcptemplate" = "bbconfig.headers.CSP.frame-ancestors=self' https://*.soton.ac.uk 'soton.ac.uk" ]; thenprintf "%s\n" "${grn}TEST PASSED${end}: value returned is $ScormFixinbbcptemplate"elseprintf "%s\n" "${red}TEST FAILED${end}: value returned is $ScormFixinbbcptemplate"fiecho ""echo ""echo ""echo "Test 2 - Scorm Fix in bbcp"echo ""if [ "$ScormFixinbbcp" = "bbconfig.headers.CSP.frame-ancestors=self' https://*.soton.ac.uk 'soton.ac.uk" ]; thenprintf "%s\n" "${grn}TEST PASSED${end}: value returned is $ScormFixinbbcp"elseprintf "%s\n" "${red}TEST FAILED${end}: value returned is $ScormFixinbbcp"fiecho ""echo ""echo""echo "Test 3 - bbconfig.jvm.options.extra.tomcat"echo ""if [ "$bbconfigjvmoptionsextratomcat" = "bbconfig.jvm.options.extra.tomcat=-XX:NewSize=2048m -XX:MaxNewSize=2048m -XX:+UseTLAB -XX:SurvivorRatio=4 -XX:+UseCompressedOops -Xss512k -XX:+PrintVMOptions -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintGCTaskTimeStamps -XX:+PrintCommandLineFlags -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+AlwaysPreTouch -XX:+DoEscapeAnalysis -Xverify:none -Djava.util.prefs.systemRoot=/home/bbuser/.java/" ]; thenprintf "%s\n" "${grn}TEST PASSED${end}: value returned is $bbconfigjvmoptionsextratomcat"elseprintf "%s\n" "${red}TEST FAILED${end}: value returned is $bbconfigjvmoptionsextratomcat"fiecho ""echo ""echo ""echo "Test 4 - bbconfig.jvm.options.gc"echo ""if [ "$bbconfigjvmoptionsgc" = "bbconfig.jvm.options.gc=-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:InitiatingHeapOccupancyPercent=45 -XX:+UseStringDeduplication" ]; thenprintf "%s\n" "${grn}TEST PASSED${end}: value returned is $bbconfigjvmoptionsgc"elseprintf "%s\n" "${red}TEST FAILED${end}: value returned is $bbconfigjvmoptionsgc"fiecho ""echo ""echo ""echo "Test 5 - bbconfig.email.use.dmarc.from.override"echo ""if [ "$bbconfigemaildmarc" = "bbconfig.email.use.dmarc.from.override=false" ]; thenprintf "%s\n" "${grn}TEST PASSED${end}: value returned is $bbconfigemaildmarc"elseprintf "%s\n" "${red}TEST FAILED${end}: value returned is $bbconfigemaildmarc"fiecho ""echo ""echo ""# Note that a different result is expected depending on whether we are on the tasks node or a web nodeecho "Test 6 - backend processor setting"echo ""if [[ "$backendproc" = "bbconfig.server.backend.processor=true" && "$hostname" = "removed" ]] || \[[ "$backendproc" = "bbconfig.server.backend.processor=false" && "$hostname" != "removed" ]]; thenprintf "%s\n" "${grn}TEST PASSED${end}: Hostname is $hostname and value returned is $backendproc"elseprintf "%s\n" "${red}TEST FAILED${end}: Hostname is $hostname and value returned is $backendproc"fiecho ""echo ""echo ""echo "Test 7 - http.compression"echo ""if [ "$httpcomp" = "bbconfig.appserver.http.compression=off" ]; thenprintf "%s\n" "${grn}TEST PASSED${end}: value returned is $httpcomp"elseprintf "%s\n" "${red}TEST FAILED${end}: value returned is $httpcomp"fiecho ""echo ""
Final thoughts
Although it is really annoying to have to spend time to reimplement config changes and fixes just to install a CU we are slowly developing our practice to streamline the process as much as we can. I would be very interested to hear from other Blackboard admins about how they deal with this aspect of upgrades.
Addendum
On the community site Ashley Fisher wrote an interesting reply. In case it is not transferred to the new community site I'm pasting it below.
I haven't done anything with checking the bb-config.properties yet, thanks for the inspiration.
I did write a 'post-installation' script which I run straight after a new CU/SP, this reapplies some fixes for issues that have given me some grief.
Environment Spec:
RHEL6, Oracle RAC, Bb Learn v3100.0.6
The fixes applied:
Tomcat Bug #60035:
ActiveMQ Does not Start on Oracle RAC Environments:
Logspam While Attempting to Lock File:
Xythos Cross-Server Communication Fails:
#!/bin/bash(HEADER/DESCRIPTION REMOVED)# Remove Temporary Install Dirif [ -d /app/tmpupgrade/ ]then echo " Check Result: Temporary installer directory exists, removing."rm -R /app/tmpupgrade/elseecho " Check Result: Temporary installer directory did not exist."ficp ../backup/$(hostname)/tnsnames.ora* /usr/local/blackboard/apps/oracle-client/network/admin/cp ../backup/$(hostname)/tnsnames.ora* /usr/local/blackboard/config/oracle/network/admin/cp ../backup/$(hostname)/tnsnames.ora* /usr/local/blackboard/config/oracle-client/# Create Rollback Directoriesecho "INFO: Checking and creating backup location."if [ -d ../backup ]then echo " Check Result: Backup folder exists."elseecho " Check Result: Backup folder does not exist, creating."mkdir ../backup/fiif [ -d ../backup/$(hostname) ]then echo " Check Result: Host folder exists."elseecho " Check Result: Host folder does not exist, creating."mkdir ../backup/$(hostname)fi# ActiveMQ## Take Backupecho "INFO: ActiveMQ Broker configuration."if [ ! -f ../backup/$(hostname)/wrapper.conf.bb ]thenecho " Backup of wrapper.conf.bb does not exist. Backing up."cp /usr/local/blackboard/apps/activemq-broker/conf/wrapper.conf.bb ../backup/$(hostname)/elseecho " Backup of wrapper.conf.bb already exists."fiif [ ! -f ../backup/$(hostname)/message-queue-service-config.xml.bb ]thenecho " Backup of message-queue-service-config.xml.bb does not exist. Backing up."cp /usr/local/blackboard/config/message-queue-service-config.xml.bb ../backup/$(hostname)/elseecho " Backup of message-queue-service-config.xml.bb already exists."fi## Move Filesif [ $(diff ./repository/wrapper.conf.bb /usr/local/blackboard/apps/activemq-broker/conf/wrapper.conf.bb | wc -l) -gt "0" ]thenecho " New file and old file are different, replacing with updated wrapper.conf file."cp ./repository/wrapper.conf.bb /usr/local/blackboard/apps/activemq-broker/conf/wrapper.conf.bbelseecho " wrapper.conf.bb already fixed."fiif [ $(diff ./repository/message-queue-service-config.xml.bb /usr/local/blackboard/config/message-queue-service-config.xml.bb | wc -l) -gt "0" ]thenecho " New file and old file are different, replacing with updated message-queue-service-config file."cp ./repository/message-queue-service-config.xml.bb /usr/local/blackboard/config/message-queue-service-config.xml.bbelseecho " message-queue-service-config.xml.bb already fixed."fi## CheckchkAMQLib=$(cat /usr/local/blackboard/apps/activemq-broker/conf/wrapper.conf.bb | grep 'oracle-client/lib64' | wc -l)if [ "$chkAMQLib" -eq "1" ]thenecho " ActiveMQ Wrapper Configuration Updated Successfully."elseecho "ERROR: ActiveMQ Wrapper Configuration Not Updated!."fi# Java File Pref. Lockecho "INFO: Checking for Java systemPrefs lock directory."if [ ! -d /home/bbuser/.java/.systemPrefs ]thenecho " systemPrefs lock directory does not exist, creating."mkdir /home/bbuser/.java/.systemPrefschown bbuser:bbgroup -R /home/bbuser/.java/.systemPrefselseecho " systemPrefs lock directory already exists."fichown -R bbuser /etc/.java/.systemPrefs# Cross-Server Security Fixecho "INFO: Cross-Server security fix check."if [ $(diff /usr/local/blackboard/config/tomcat/conf/server.xml.bb ./repository/server.xml.bb | wc -l) -gt "0" ]thenecho " Cross-Server security fix has not been applied."if [ ! -f ../backup/$(hostname)/server.xml.bb ]thenecho " Backup does not exist. Taking Backup."cp /usr/local/blackboard/config/tomcat/conf/server.xml.bb ../backup/$(hostname)/fiecho " Applying change for cross-server security."cp ./repository/server.xml.bb /usr/local/blackboard/config/tomcat/conf/server.xml.bbelseecho " Cross-Server security fix has previously been applied."fi# Tomcat Bug 60035echo "INFO: Tomcat Bug #60035 Check."if [ $(diff ./repository/tomcat-util.jar /usr/local/blackboard/apps/tomcat/lib/tomcat-util.jar | wc -l) -gt "0" ]thenecho " Tomcat fix has not been applied. Taking Backup."cp /usr/local/blackboard/apps/tomcat/lib/tomcat-util.jar ../backup/$(hostname)/cp /usr/local/blackboard/apps/tomcat/lib/tomcat-coyote.jar ../backup/$(hostname)/echo " Applying Tomcat Fix."cp ./repository/tomcat-util.jar /usr/local/blackboard/apps/tomcat/lib/tomcat-util.jarcp ./repository/tomcat-coyote.jar /usr/local/blackboard/apps/tomcat/lib/tomcat-coyote.jarelseecho " Tomcat fix has been previously applied."fiecho "INFO: Cascading bbuser permissions over the /usr/local/blackboard folder."chown -R bbuser:bbgroup /usr/local/blackboardecho " Permissions successfully applied to /usr/local/blackboard folder."echo ""echo "------------------------------------------------------------------------------------------------------------------------"echo " WARN: You now need to run PushConfigUpdates.sh to apply these changes. This will restart Blackboard on this host. "echo "------------------------------------------------------------------------------------------------------------------------"echo "Would you like to PushConfigUpdates now? (yes/NO): "read pushConfigif [ $pushConfig == "yes" ]thenecho "INFO: PushConfigUpdates.sh is now running for you."/usr/local/blackboard/tools/admin/PushConfigUpdates.shelseecho "INFO: You have selected to manually run PushConfigUpdates."fiecho ""
Comments
Post a Comment