Synchronizing RRD files using rsync

RRD files contain most of the RTM graphical database. Use rsync to synchronize RTM binaries.

To remotely synchronize the RTM binaries using rsync, open a shell on both systems as the apache user, and set up a secure shell (ssh) trusted key pair.

Perform the following tasks:
  1. Clearing out old RRD files

Clearing out old RRD files

Before you run rsync, clear out old RRD files from the /opt/IBM/cacti/rra directory. RTM does not automatically clear RRD files.

Important: Perform these steps on both the old and the new RTM system.

The following command removes RRD files that have not been updated for at least 5 days:

cd /opt/IBM/cacti/rra
find . -name \*.rrd -mtime +5 -exec /bin/rm -f {} \;

Set up ssh key pairs and run the rsync command:

cd /opt/IBM/cacti
rsync –rp rra newsystem:/opt/IBM/cacti
Remember: With RTM 9.1.2 and later, the installation directory for the Cacti code changed from /opt/cacti to /opt/IBM/cacti.

When the migration is complete, make sure that you remove the secure shell access and the .ssh directories for the apache account.

Run rsync as many times as required until the system is migrated successfully. This includes having a clog that is 100% green.

  1. Edit /etc/passwd and change the /sbin/nologin to /bin/bash for the apache account.
  2. Change to the apache user home directory. For example, on RHEL the home directory is /var/www.
  3. Make an .ssh directory.
    mkdir .ssh;chown apache:apache .ssh

Making an ssh key pair and copying the .ssh directory

Note: Perform these steps on only one of the RTM systems.
  1. Switch to the apache account.
    su - apache
  2. Make an ssh key pair using the command ssh-keygen. Use defaults for everything.
  3. Change to the .ssh directory.
  4. Copy the id_rsa.pub file to the authorized_keys file.
    cat id_rsa.pub > authorized_keys
  5. Exit the su - apache command.
  6. Use scp to copy the .ssh folder to the new system.
    scp -rp .ssh newsystem:/var/www
  7. Test the ssh command.
    ssh newsystem hostname

    If prompted, accept the host key.