Synchronizing primary and secondary nodes
Install rsync
and inotify-tools
in the primary and
secondary nodes to synchronize changes between these two nodes.
Procedure
- Install
rsync
andinotify-tools
on both the nodes.yum install rsync
yum install inotify-tools
Note: Installation ofrsync
andinotify-tools
might not be required on some nodes depending on the version of Red Hat you are using.For example, in Red Hat v8.3,
rsync
is already installed. You can manually installinotify-tools
, by using the following command:cd /tmp git clone https://github.com/rvoicilas/inotify-tools.git cd inotify-tools ./autogen.sh ./configure && make && make install
- Confirm that
inotifywait
exists.updatedb locate inotifywait
Note down the location, for example,
/usr/local/bin/inotifywait
. You might be required to specify this location, insyncup.sh
. - On both primary and secondary nodes, update the
/etc/hosts
file with the fully qualified domain name (root authority needed). You can either use the default domain name or change it to your choice. - Change the hostname.
vi /etc/hostname
- (Optional) Modify the hostname value on both the nodes by editing the
/etc/sysconfig/network
system file. - If you changed the hostname, run the following command on both the nodes:
hostname dmc-1
hostname dmc-2
- Verify that the hostnames are correct on both the nodes.
- Restart the primary and secondary nodes after you complete the configuration changes.
- Configure Secure Shell (SSH) on both nodes to synchronize the file changes between these
two nodes:
- Run the
ssh-keygen
command on both the nodes.ssh-keygen -t rsa
- Copy the contents of the output file
id_rsa.pub
on the primary node and append it to the/root/.ssh/authorized_keys
file on the secondary node.cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
- To verify, run the following command:
cat /root/.ssh/authorized_keys
- Run the