Applies To
- Zenoss 4.2.4, SP 336 or later; or, Zenoss 4.2.5 or later
- ZenDS 5.5.36 or later
Summary
By default, the Zenoss event server daemon, zeneventserver, optimizes a set of important tables in the event database every 12 hours using the SQL OPTIMIZE TABLE statement. Each table is locked while it is being optimized, which can delay event processing. This is a particular issue for the event_summary table as it can become very large and therefore take a long time to optimize.
The pt-online-schema-change script, part of the Percona Toolkit for MySQL from percona.com, can optimize tables without locking them. The zeneventserver daemon has built-in support for the use of this tool. This article describes how to install and enable the use of pt-online-schema-change for optimization of the event_summary table by zeneventserver.
Critical Note
To prevent possible database corruption, once the Percona Toolkit is enabled for zeneventserver, you must use the --enterprise-tools option when backing up the Zenoss databases with zenbackup. Additionally, you cannot use the mysqldump command on the event database (zenoss_zep) or any of its tables. Note that you can make the --enterprise-tools option the default for zenbackup by following the directions in the Update and Test zenbackup's Configuration section below.
Procedure
Determine the Host Name of Your Database Server
To determine the host name of your ZenDS server, examine the value of the zodb-host option in $ZENHOME/etc/global.conf on the Resource Manager host (sometimes referred to as the Zenoss master server).
Run the following command as the zenoss user to display the ZenDS server's host name:
$ awk '/^zodb-host/{print $2}' $ZENHOME/etc/global.conf
Determine Your Resource Manager and ZenDS Versions
- Run the following command as zenoss on the Resource Manager host (sometimes referred to as the Zenoss master server):
$ zenup statusProduct: zenoss-resmgr-4.2.5 (id = zenoss-resmgr-4.2.5) Home: /opt/zenoss Revision: 80 Updated On: Mon Apr 28 15:33:51 2014
- Consult the output and verify the following:
- The product (zenoss-resmgr) version is 4.2.5 or greater
- OR, the product (zenoss-resmgr) version 4.2.4, and the revision number is 336 or greater
- Run the following command as zenoss on the ZenDS database host:
$ zends -V/opt/zends/bin/.mysql Ver 14.14 Distrib 5.5.36, for linux2.6 (x86_64) using EditLine wrapper
- Verify that the version number following “Distrib” is 5.5.36 or greater.
If your Zenoss instance does not meet both of these requirements, or if the zenup command was not found, do not proceed with this article and contact Zenoss support for assistance.
Install the Percona Toolkit
- Download the latest version of the Percona Toolkit to the Resource Manager host from
https://www.percona.com/downloads/percona-toolkit/LATEST/ - Install the toolkit as the root user on the Resource Manager host:
# yum -y install percona-toolkit-*.noarch.rpm - Switch to the zenoss user:
# su - zenoss - Verify the toolkit was successfully installed:
$ which pt-online-schema-change/usr/bin/pt-online-schema-change
Update the Configuration for ZenEventServer
- Login to the Resource Manager host as the zenoss user.
- Edit $ZENHOME/etc/zeneventserver.conf
- Update the zep.database.optimize_use_external_tool option line to read:
zep.database.optimize_use_external_tool=trueBe sure to remove the leading pound sign (#) from the line.
- Save the file.
- Update the zep.database.optimize_use_external_tool option line to read:
- Restart the zeneventserver daemon:
$ zeneventserver restart
Update the PATH and Prepare SSH access for the zenoss User on a Remote ZenDS Host
Follow the instructions in this section only if ZenDS is run on a host other than the Resource Manager host.
- Login to the ZenDS host as the root user.
- Set a password for for the zenoss user:
$ passwdThe password command will prompt you for the new password (twice).
- Switch to the zenoss user:
# su - zenoss - Add the following line to ~/.bashrc:
export PATH="${ZENDSHOME}/bin:${PATH}"
- Prepare SSH access for the zenoss user:
- Create the SSH configuration directory:
$ mkdir -p ~/.ssh - Set the directory access permissions:
$ chmod 700 ~/.ssh - Create a placeholder authorized keys file:
$ touch ~/.ssh/authorized_keys - Set the file access permissions:
chmod 600 ~/.ssh/authorized_keys
- Create the SSH configuration directory:
- Log into the Resource Manager host as the zenoss user.
- Copy the zenoss user's public key to the ZenDS host.
- Run the following command, and substitute the fully-qualified host name of the ZenDS host for zends-host:
ssh zends-host "cat >> ~/.ssh/authorized_keys" < ~/.ssh/id_rsa.pub
- Enter yes when prompted for confirmation by ssh.
The ssh command adds the ZenDS host to the known hosts file of the zenoss user on the Resource Manager host.
- Enter the password for the zenoss user on the ZenDS host when prompted by ssh.
The ssh command appends the public key of the zenoss user on the Resource Manager host to the zenoss user's authorized keys file on the ZenDS host.
- Test the connection to the ZenDS host using the following command. Substitute the fully-qualified host name of the ZenDS host for zends-host:
ssh zends-host hostname
The host name of the ZenDS host should be displayed without any prompting.
Update and Test the Configuration for ZenBackup
- As the zenoss user on the Resource Manager host, add the following line to $ZENHOME/etc/zenbackup.conf:
enterprise-tools True
- Run the zenbackup command to test the new configuration:
$ zenbackup
If the zenbackup command does not complete successfully, contact Zenoss support for assistance.
Is there more current information about using the Percona toolkit? Some of the instructions in this article no longer apply to RM 5.3.3, for example.