2.2.5. Use "rsync" to sync local storage on RAC nodes
The next step in this example is to use the UNIX "rsync" utility to copy the files located in the /usr/dbvisit directory (The DBVISIT_BASE) from the "preferred node" which is the node where Dbvisit Standby normally is set to run, which in this example is "kiwi81". It will be set to copy the files from this location to the secondary node kiwi82 in this example. From kiwi82 there will be no Dbvisit Standby processes running as the Virtual IP (dbv-vip) will be running on kiwi1.
You will only start the Dbvisit Processes on kiwi2 if the Virtual IP cluster resource (kiwi812-vip) has been switched over - (re-allocated or failed over) to run on kiwi82. For more detail on the configuration of the VIP and the Action Scripts for Dbvnet and Dbvagent please see here - Oracle RAC Configurations#OracleRACConfigurations-5.Example2:AddDbvnetandDbvagentasClusterResources
Note: The /usr/dbvisit directory (The Dbvisit Base) location must exist on both Primary RAC nodes and that the permission of this folder is set to have the "oracle" Unix account (the user that runs your database software) as the owner. At this stage, the folder on the secondary server (kiwi82) will be empty as we have not synced the files yet.
Step 1: Create a "rsync" script
The first step now is to create a script that will be used to copy the files from node 1 (kiwi1 in this example) to node 2 (kiwi2).
Sample "rsync-dbvisit" script
Note - this script can be copied into a folder /home/oracle/bin and enabled via a UNIX CRON schedule to run on a regular basis.
Once you have created this script, make sure that it has sufficient permissions and that the owner "oracle" user, in this case, have a execute permission (example "chmod +x oracle rsync-dbvisit" ). For more detail please see the "chmod" command man pages or online help for your UNIX distribution.
The above script is making use of the UNIX "rsync" command. For more details on the use of this command and all parameters please see the UNIX man pages or online documentation.
Once you have created the script you can run it manually the first time to ensure the directories are kept in sync.
oracle@kiwi81[/home/oracle]: cd bin
Then review the log file in /tmp/dbvisit-rsync.log as well as the /usr/dbvisit directory on the secondary server (kiwi2 in this example)
Step 2: Schedule the Script
In this example, we will schedule the script to run every 10 minutes. This should be sufficient for most configurations.
The schedule can be adjusted if required based on your configuration and environment.
# CRON: Synchronize the Dbvisit Base folder between kiwi81 and kiwi82
*/10 * * * * cd /home/oracle/bin; ./rsync-dbvisit >>/dev/null 2>&1
Step 3: Monitor
Have Dbvisit Standby run either via a schedule or via the Daemon process for a period and then monitor the /usr/dbvisit folder on the standby server.
You should see files being updated in the secondary server following a run of the above schedule.