11.1. Disaster Recovery Setup Guide

Disaster recovery is an automated process to replicate the database of the main server in a remote server.

Requirements:

  • A pre-configured server as the remote server with a user having sudo rights.

  • Static IPs for both main and remote servers.

Steps to Initiate Disaster Recovery

Note: For demonstration sake, you would consider IP addresses of main and remote as: Main-server: 192.168.1.111 and Remote-server: 192.168.1.109.

  1. Create authentication SSH-Keygen keys on the main server (192.168.1.111).

  1. Run the following commands.

figure 1

This generates a pair of public keys.

  1. Create .ssh directory in the remote server (192.168.1.109).

  1. Use ssh from main server to connect to the remote server using [remote server username] and create .ssh directory using the following command.

figure 2
  1. You will be asked for the password of the remote server’s user account; please type in the password.

  1. Upload generated public keys to remote server (192.168.1.109).

  1. We will upload the new generated public key in the main server on the remote server using the following command.

figure 3
  1. You will be asked for the password of the remote server’s user account; provide the password.

  1. Set permissions in remote server (192.168.1.109) and a directory where the recovery will happen.

  1. Log in to the remote server and run the following commands.

  1. Login from main (192.168.1.111) to remote (192.168.1.109) without using password.

You can now login to the remote server without a password.

  1. Now we will create a cron job in the main server (192.168.1.111) as the root user.