Maintaining Database
The following are the actions that you can take to maintain or optimize the database:
Set up record partitioning in the database
About this task
In a large database, removing old job records and other database maintenance tasks can have a significant effect on database performance. You can improve database performance by enabling record partitioning. Partitioning divides tables within the database into multiple, smaller tables.
Removing job records from smaller tables has less of an impact on the system performance of active tables than removing job records from larger tables.
You can set up partitioning for the following database tables that RTM monitors (all of the following tables are affected):
GRID_ARRAYS
GRID_JOB_DAILY_STATS
GRID_JOBS_FINISHED
GRID_JOBS_MEMPERF
GRID_JOBS_RUSAGE
Procedure
Results
The partitioned tables have a numerical suffix (_v000, _v001, … _vnnn). The newest table has the largest number.
Back up and restore the RTM system settings
RTM saves system and graph settings in the Cacti database. You can use the RTM Console to back up operations of the Cacti database so that you can restore the RTM system later. Having the backups means that if you changed the configuration in your RTM host that you would like to revert (for example, if you incorrectly imported a Cacti template and your graphs no longer update, or you accidentally removed a cluster from the RTM Console), you can use the RTM Console to restore the Cacti database, which restores the RTM system and graph settings and revert to your original, backed-up settings.
The RTM Console cannot restore all of the job performance data of the clusters that RTM monitors. Any such data still in RTM is likely out of date.
If you want to fully back up the entire database, you must use the mysqldump command. In addition, you cannot use the MyISAM table structure if you use the mysqldump command regularly. For more information, refer to your database documentation.
The following is a list of actions you can take to back up or restore the RTM system and graph settings through the RTM Console:
- lsfpollerd.conf: Database file that contains the credentials
- lsf.conf: The lsf.conf file that is associated with each cluster.
- ego.conf (for LSF 8.0 clusters only): The ego.conf file that is associated with each cluster.
- server.key and server.crt: These files are used as certification to httpd for advocate.
- GRID_ARRAYS
- GRID_ARRAYS_FINISHED
- GRID_JOB_DAILY_STATS
- GRID_JOB_INTERVAL_STATS
- GRID_JOBS
- GRID_JOBS_FINISHED
- GRID_JOBS_JOBHOSTS
- GRID_JOBS_JOBHOSTS_FINISHED
- GRID_JOBS_MEMPERF
- GRID_JOBS_PENDREASONS
- GRID_JOBS_PENDREASONS_FINISHED
- GRID_JOBS_REQHOSTS
- GRID_JOBS_REQHOSTS_FINISHED
- GRID_JOBS_RUSAGE
- LIC_DAILY_STATS
- LIC_FLEXLM_LOG
- LIC_INTERVAL_STATS
- LIC_LUM_EVENTS
- POLLER_OUTPUT
- POLLER_OUTPUT_BOOST
- SYSLOG
- SYSLOG_REMOVED
Back up the RTM system using the RTM Console
About this task
Before you upgrade to a newer version of RTM, you must first back up the existing Cacti database.
It is important to back up the Cacti database during scheduled server maintenance and you can revert to previous RTM system and graph settings.
Procedure
Enable automatic data archiving
About this task
Enable data archiving to save existing job and job-related data to an archive database during scheduled server maintenance.
Procedure
- Click the Console tab.
- Under the Configuration section of the Console menu bar, click Grid Settings.
- Click the Archiving tab.
- To enable data archiving of existing job and job-related data, select the Enable Data Archiving box and specify the data archiving settings.
- Click Save to save your data archiving settings.
Restore the RTM system using the RTM Console
About this task
After you complete any scheduled server maintenance, or finish upgrading your RTM version, you must restore the Cacti database that you previously backed up.
You can also restore the Cacti database to revert to a previous RTM system and graph setting.
Procedure
Manually back up or restore the database RTM
For later versions, all components are backed-up and packed into a .tgz file by the RTM Console. However, previous versions of RTM require that you manually back up your database. The following steps describe the manual backup and upgrade process:
Back up the website
cd /var/www/html
tar --exclude=*.rrd --exclude=*.log -cf cacti_backup.tar cacti
cd /var/www/html/plugins
tar -exclude=*.rrd -cf grid_backup.tar grid
Back up the database
- GRID_ARRAYS
- GRID_ARRAYS_FINISHED
- GRID_JOB_DAILY_STATS
- GRID_JOB_INTERVAL_STATS
- GRID_JOBS
- GRID_JOBS_FINISHED
- GRID_JOBS_JOBHOSTS
- GRID_JOBS_JOBHOSTS_FINISHED
- GRID_JOBS_MEMPERF
- GRID_JOBS_PENDREASONS
- GRID_JOBS_PENDREASONS_FINISHED
- GRID_JOBS_REQHOSTS
- GRID_JOBS_REQHOSTS_FINISHED
- GRID_JOBS_RUSAGE
- LIC_DAILY_STATS
- LIC_FLEXLM_LOG
- LIC_INTERVAL_STATS
- LIC_LUM_EVENTS
- POLLER_OUTPUT
- POLLER_OUTPUT_BOOST
- SYSLOG
- SYSLOG_REMOVED
SSH private key pair files for grid cluster control authentication are not backed up; the backup process backs up only the file path to the key file.
cd /var/www/html/cacti/plugins/grid
php -q database_backup.php
Running that utility creates three backup files: the database itself, the Cacti/RTM Schema, and Critical RTM Tables. These backup files can be used in the case of a disaster to restore full function to the system.
Back up the RTM poller
To support the ever growing list of features and to provide for bug fixes, the IBM Spectrum LSF RTM pollers must be upgraded from time to time. Therefore, before you upgrade IBM Spectrum LSF RTM, first make a backup copy of your IBM Spectrum LSF RTM pollers.
cd /opt/rtmtar -cf grid_poller_backup.tar bin lic lsf8 lsf91 lsf101
Upgrade the Cacti website and grid plug-in
- You must make a backup copy of your <path_to_cacti>/include/global.php file. This file is important as it contains your database connect string and your list of installed plug-ins.
- You must know whether you modified the default RTM poller scripts. If you modified them, you must make a separate backup of your <path_to_cacti>/scripts directory. If you added new scripts that are not a part of the standard RTM deployment, it is not necessary to back up this directory.
- If you modified default RTM Data Queries, you must back up your <path_to_cacti>/resource directories. Again, if you did not modify the default installation of RTM Data Queries, it is not necessary to proceed with this step.
After completing these steps, note the ownership of all files in RTM. The RTM installer prefers that the cacti user account own the Apache site, and that the Apache binaries be run by the same. If so, then all files in the /var/www/html/cacti directory and subdirectories are “cacti:cacti” regardless of file ownership, not the ownership, and permissions.
cp -rp <upgrade_path>/cacti /var/www/html
chown -R cacti:cacti /var/www/html
Verify that your config.php remains unchanged. Then, refresh your browser that is already pointed to the RTM website.
Upgrade the database
After you upgrade your Cacti Website and Grid Plug-in, you must run a Database Upgrade script. As RTM matures, several changes are made to the RTM tables to accommodate new features.
Larger tables such as the grid_jobs and grid_jobs_rusage do not typically undergo structural changes. If one of these larger tables were to require modification, you are informed up-front to advise you of the downtime that might be required to upgrade any of those tables.
cd /var/www/html/cacti/plugins/grid
php -q database_upgrade.php
Upgrade the RTM poller
- Verify the permissions on all file objects within the RTM poller
directory.
They are typically owned by “cacti:cacti”. If you chose another method, note those file permissions.
- Run the following commands to upgrade the pollers:
cp -rp <upgrade/_path>/poller /usr/local chown -R cacti:cacti /usr/local/grid