Upgrade guide

From ZENBU documentation wiki
Jump to: navigation, search

This section of the Installation guide will cover upgrading a ZENBU server to a new version of the application code. The ZENBU system is designed to use the same databases and directories with different versions of the ZENBU application code.

When upgrading the ZENBU application, most of the steps of the installation process have already been done. All the library dependancies have been installed, and apache and mysql are setup and running. You can use the same mysql databases for the user accounts and collaborations. Plus, you can use the same data and user directories and thus all the previously uploaded files. You just need to compile the new application code and install an updated version of the html and javascript for the website. Please follow the steps below.

Compiling new version of ZENBU application code

Unpack your new ZENBU source code into the /zenbu/src directory with the version number of the ZENBU you have downloaded. For example you may have previously installed ZENBU_2.8.2 but are now installing ZENBU_2.9.0

cd /zenbu/src/
tar -Pxzf ZENBU_2.9.0.tar.gz

The source packages are made with absolute paths so it should unpack into /zenbu/src/ZENBU_2.9.0. After unpacking the source code, please follow these steps to compile.

cd /zenbu/src/ZENBU_2.9.0/c++

Installing ZENBU web-site, cgi and tools

The ZENBU website is located in the source code in the subdirectory www/zenbu. To make setup easier we recommend using the /zenbu/www directory for different versions of the web-site code and then symbolic link from the apache html directory to the appropriate zenbu version.

cp -rp /zenbu/src/ZENBU_2.9.0/www/zenbu /zenbu/www/zenbu_2.9.0
rm /zenbu/www/zenbu     #this will remove the old sym-link to your previous version 
ln -s /zenbu/www/zenbu_2.9.0  /zenbu/www/zenbu  #the most recent version

The next step is to install the commandline and background processing tools. These get installed into the /zenbu/bin directory

cd /zenbu/src/ZENBU_2.0.0/c++/tools
make install
#will copy the commandline tools into /zenbu/bin

Next compile and copy the ZENBU cgi programs into the zenbu website cgi directory

cd /zenbu/src/ZENBU_2.9.0/c++/cgi
cp -f *cgi /zenbu/www/zenbu_2.9.0/cgi/

Finally, depending on where your linux keeps the apache html pages, link the current website version into that directory

rm /var/www/html/zenbu #unlink old version
ln -s /zenbu/www/zenbu_2.9.0  /var/www/html/zenbu

Server configuration

In general the same configuration file used with your previous ZENBU version will work with your new ZENBU version. But please check the release notes with the new version of the ZENBU code to see if there are any specific changes or patches which need to be applied.

If you made any changes to your /zenbu/www/zenbu_x.x.x/jscript/eedb_variables.js file, you should diff and edit accordingly

diff /zenbu/www/zenbu_2.8.2/jscript/eedb_variables.js /zenbu/www/zenbu_2.9.0/jscript/eedb_variables.js
#edit as needed

If there are no system changes mentioned in the release notes, you can use the previous /zenbu/server_config/active_config.xml and there is no need to do anything more for this section.

if you need to patch the configuration file

Simply copy the previous server configuration to a new version number. Make backup of your old configuration with the previous version number also, if you had not previously done this.

#check if you have a previous backup and symlink
#if not
cp /zenbu/server_config/active_config.xml  /zenbu/server_config/zenbu_2.8.2_config_bck.xml

#copy to new version so you can edit
cp /zenbu/server_config/active_config.xml  /zenbu/server_config/zenbu_2.9.0_config.xml
rm /zenbu/server_config/active_config.xml
ln -s /zenbu/server_config/zenbu_2.9.0_config.xml /zenbu/server_config/active_config.xml

Next you will need to edit the file related to your specific server setup and any patches. Follow the previous guide Installation_guide:_configuration#Server_configuration. Remember to change the <eedb_root> to the new directory location.


Restart Apache

Finally restart/reload your apache to make sure all the web services are now running the latest code

sudo /etc/init.d/httpd restart
sudo /etc/init.d/apache2 restart

Running background processing agents

The background processes are constantly being launched so there should be no need to do anything here. But just make sure that the agent launcher is still running and restart if needed. Open another terminal window and run this command as root or sudo. This should run in the background at all times.

 ps aux | grep zenbu_agent
 root     14701  0.0  0.0   9000  1308 pts/6    S    Dec04   0:30 /bin/bash /zenbu/bin/zenbu_agent_launcher_gb.sh

if it is not running simple start one in the background.

 sudo /zenbu/bin/zenbu_agent_launcher.sh &

Do not run this script in a cron job. It internally performs a periodic launch of the required agents every 10 seconds. The code of the agent launcher is a very simple infinite loop, and can be modified depending on your server hardware. You can decrease the sleep frequency to reduce latency for job pickup. Or increase the -loadlimit if you want more of your CPU cycles devoted to background track-building compared to web-server responsiveness.

while [ 1==1 ]; do  
echo -n "launch zenbu agents :: "  
/zenbu/bin/zenbu_track_builder -build -buildtime 583 -loadlimit 0.5&
/zenbu/bin/zenbu_job_runner -run&
sleep 10;