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.
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.
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
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.
- Edit /etc/passwd and change the /sbin/nologin to /bin/bash for the apache account.
- Change to the apache user home directory. For example, on RHEL the home directory is /var/www.
- Make an .ssh directory.
mkdir .ssh;chown apache:apache .ssh
Making an ssh key pair and copying the .ssh directory
- Switch to the apache account.
su - apache
- Make an ssh key pair using the command ssh-keygen. Use defaults for everything.
- Change to the .ssh directory.
- Copy the id_rsa.pub file to the authorized_keys file.
cat id_rsa.pub > authorized_keys
- Exit the su - apache command.
- Use scp to copy the .ssh folder to the new system.
scp -rp .ssh newsystem:/var/www
- Test the ssh command.
ssh newsystem hostname
If prompted, accept the host key.