Upgrading Zenoss

From Zenoss Wiki
Jump to: navigation, search

Upgrading ZenOSS 3.2+ -> ZenOSS 4.1+


  • This can be hit and miss depending on the consistency of your ZODB, though, no where near as much as upgrading version 2 to to 3.
  • It's important to note that converting the Events database from Zenoss v3.x to the v4.x format is unsupported. It's not impossible, but I'm not going to cover it.
  • Do not skip the backup. If you do, that's on you. You must back it up.
  • Installations covering dedicated mysql database servers and remote collectors is not covered.
  • This doesn't cover stack installations or installations moving from a 32-bit install.
  • Zenfixit.py can be found on the forums. DO NOT use zenfixit.py after upgrading to version 4+

1) Backup the current instance, minimizing the disk space used. You can adjust the tar command exclusions if you'd like to backup more.

On ZenOSS master as zenoss user

  zeopack.py -h localhost -p 8100

Change user to root

  cd /opt
  tar czvf ZenOSS.v3.Backup.{DATE}.tar.gz zenoss/ --exclude=*.rrd --exclude=*.old --exclude=*.bak --exclude=*.example --exclude=*.tar --excude=*.gz --exclude=*.tgz --exclude=*.zip --exclude=*.log*

where {DATE} is the date in YYYY-MM-DD format. Please put a date, it's especially handy if you frequently backup.

At this point you'll have a nice big tar.gz with a complete backup of your ZenOSS with the notable exclusion of the Events database and RRD files.

2) Determine what packs you're using. If you have packs you are not using, remove them. Each zenpack installed raises the possibility of failure during cataloging and zenmigration. Zenpacks should be removed as the zenoss user on the ZenOSS master via the console. Please do not remove zenpacks via the webUI as trace back data may not be visable and pack uninstallation failures will need to be addressed before upgrading.

On the ZenOSS master as the zenoss user

  zenpack --remove ZenPacks.Node2.Node3

3) Cleanup Zope. Zope can become full of trash and the degree of trash can vary based on the Administrator, packs utilized, dimensions of the instance, development of packs on production devices, upgrade history, etc.

The quickest way to clean up Zope is to run `zenfixit.py`. ZenFixIt has sort of a checked history. It can indeed fix many things, however, it can unfix certain items as well. In most cases ZenFixIt will not cause damage but infact fix problems which raise new problems. All of these issues need to be dealt with before upgrading to v4.x+.

4) Now that our Zope is squeaky clean and we've removed all unnecessary ZenPacks we can proceed to install some of the dependencies for the new ZenOSS. As the root user

  service zenoss stop
  service mysqld stop
  rpm -e mysql-server* --nodeps


  Download MySQL
     wget http://wiki.zenoss.org/download/core/mysql/MySQL-client-5.5.28-1.linux2.6.x86_64.rpm
     wget http://wiki.zenoss.org/download/core/mysql/MySQL-server-5.5.28-1.linux2.6.x86_64.rpm
     wget http://wiki.zenoss.org/download/core/mysql/MySQL-shared-5.5.28-1.linux2.6.x86_64.rpm
     wget http://wiki.zenoss.org/download/core/mysql/MySQL-shared-compat-5.5.28-1.linux2.6.x86_64.rpm

  Install MySQL
     yum localinstall MySQL-* --nogpg


  Please install zends 5.5.25a or the latest supported reccomended version.

Download and install EPEL

  Download EPEL from http://fedoraproject.org/wiki/EPEL
  yum localinstall {epel-repo-rpm-filename} --nogpg

Download and install RPMForge

  Download RPMForge from http://wiki.centos.org/AdditionalResources/Repositories/RPMForge
  yum localinstall {rpmforce-rpm-filename} --nogpg

Install Memcached

  yum install memcached

Download RabbitMQ-Server

  wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.7/rabbitmq-server-2.8.7-1.noarch.rpm

Install RabbitMQ-Server

  yum localinstall rabbitmq-server-2.8.7-1.noarch.rpm --nogpg

Download and install Java

   Remove OpenJDK. OpenJDK is not supported.
   Download JRE or JDK 1.6. Java 1.7 is not supported. 
   Install Java and verify using java -version

Start it all up and Turn it on

  service memcached start
  service rabbitmq-server start
  service {mysql or zends} start
  chkconfig {mysql or zends} on
  chkconfig zenoss on
  chkconfig memcached on
  chkconfig rabbitmq-server on

5) Now it's time to install ZenOSS. Before we install there's a number of potential conflicts aloof that we should go ahead and work around right now. On the ZenOSS master as the zenoss user rename $ZENHOME/lib to $ZENHOME/lib.V3, $ZENHOME/include to $ZENHOME/include.V3 and so on for the lib, include, Products, and share. These are all folders that can potentially cause code conflicts. Once complete, as the root user on the ZenOSS master

  rpm -Uvh {zenoss4.Xcore}.rpm

where {zenoss4.Xcore} is the name of the 4.X RPM

  rpm -Uvh {zenoss4.XcorePacks}.rpm --noscripts

where {zenoss4.XcorePacks} is the name of the 4.X Core Packs RPM

6) Now we're ready to start up the freshly upgraded ZenOSS. As the root user on the ZenOSS master

  service zenoss start

During the first `zenoss start` post upgrade the ZenOSS startup script runs the $ZENHOME/bin/zenoss_pre_upgrade and $ZENHOME/bin/zenoss_post_upgrade scripts.

$ZENHOME/bin/zenoss_pre_upgrade confirms and upgrades a number of files, migrates the ZODB and transaction history to relStorage and runs zenmigrate. Watch these steps as they progress.

*** If the parsing of the Zope.conf, migration of the ZODB or Zenmigrate returns any traceback or appears to have failed, you'll need to address the problem and then stop and start ZenOSS.
* Do not use the restart option of the ZenOSS startup script as it does not run the preliminary scripts.
* This can take substantial amounts of time for jumbo installations but is relatively fast for small and medium instances. 
* If efforts to fix the issues cannot be bypassed, you may need to consider restoring the backup and removing all ZenPacks before retrying. (Recursive ZenPack removal)

7) At this point we can go ahead and upgrade our ZenPacks. On the ZenOSS master as the zenoss user

  cd $ZENHOME/packs
  zenpack --install {filename}

where the filename represents the packs you currently have installed in ZenOSS. You can get this list via

  zenpack --list

You must upgrade all your currently installed packs to the newer versions.

8) Almost there! After restarting ZenOSS on the ZenOSS master a final time, check the webUI and functionality. If everything appears in order push the new configuration to your collectors on the collectors page and consider deleting all .V3 folders from earlier.