Activating the Mirror Grid as the Primary Grid

Consider that there are two grids:

grid1

primary realm server running at 10.0.0.1:8080 .

backup for primary realm server running at 10.0.0.3:8080 .

grid2

satellite realm server running at 10.0.0.2:8080.

backup for satellite realm server running at 10.0.0.4:8080.

Currently, the primary grid is grid1. The objective is to make grid2 the primary grid.
Warning: Exercise caution when making the mirror grid the primary grid because this might result in a data loss if the mirror grid is not in sync with the current primary.

Procedure

  1. If taking periodic checkpoints on the primary grid, use the following commands to disable periodic checkpoint creation:
    tibdg –r http://10.0.0.1:8080 –g grid1 status - identify the node with a role of primary
    tibdg –r http://10.0.0.1:8080 –g grid1 grid modify checkpoint_interval=0.0
    1. Restart the node you identified as the primary above.
      On restarting, grid configuration change is picked up and periodic checkpoints stop.
  2. Use the following command to switch the primary grid to maintenance mode and preventing any new writes to the primary grid:
    tibdg -r http://10.0.0.1:8080 -g grid1 grid mode maintenance
  3. Use the following command to create a manual checkpoint on the primary grid:
    tibdg -r http://10.0.0.1:8080 -g grid1 checkpoint create changePrimaryCheckpoint
  4. Use the following command on the mirror grid to verify that the checkpoint has been successfully mirrored:
    tibdg -r http://10.0.0.2:8080 -g grid2 checkpoint list
    1. Repeat the command until you see the checkpoint listed in the command's output.
  5. Use the following commands on the mirror grid site to stop and restart the satellite realm server as the new primary realm server by removing the --satellite-of command line option:
      
    tibrealmadmin -rs http://10.0.0.2:8080 --shutdown
    tibrealmserver --http 10.0.0.2:8080 --data $HOME/rs-db
    If running a backup realm server to the satellite realm server, all mirror grid processes and clients will connect to the satellite realm server's backup realm server when the satellite realm server is shutdown.
    1. If running a backup realm server on the mirror grid site, stop and restart the backup realm server using the following commands:
        
      tibrealmadmin -rs http://10.0.0.4:8080 --shutdown
      tibrealmserver --http 10.0.0.4:8080 --data $HOME/rs-db --backupfor 10.0.0.2:8080
      This will cause the ActiveSpaces mirror grid processes and clients to reconnect to the new primary realm server.
  6. Use the following command on the mirror grid site to change the primary grid of the gridset:
    tibdg -r http://10.0.0.2:8080 gridset setPrimary gridset1 grid2
  7. Use the following commands on the primary grid site to stop and restart the primary realm server as a satellite realm server:
       
    tibrealmadmin -rs http://10.0.0.1:8080 --shutdown
    tibrealmserver --http 10.0.0.1:8080 --data $HOME/rs-db --satellite-of 10.0.0.2:8080
    If running a backup realm server to the primary realm server, all primary grid processes and client will connect to the primary realm server's backup realm server when the primary realm server is shutdown.
    1. If running a backup realm server on the primary grid site, use the following commands to stop and restart the backup realm server for the site:
       
      tibrealmadmin -rs http://10.0.0.3:8080 --shutdown
      tibrealmserver --http 10.0.0.3:8080 --data $HOME/rs-db --backupfor 10.0.0.1:8080
  8. Use the following command to set the new mirror grid back to normal mode:
    tibdg –r http://10.0.0.2:8080 -g grid1 mode normal

    Notice that tibdg configuration commands are being sent to the primary realm server for the new primary grid site at http://10.0.0.2:8080.

    1. If mirroring periodic checkpoints from the new primary grid to the mirror grids is desired, use the following commands:
      tibdg -r http://10.0.0.2:8080 -g grid2 status  - identify the node with a role of primary
      tibdg -r http://10.0.0.2:8080 -g grid2 grid modify checkpoint_interval=120
      Restart the node you identified as the primary above. This causes the grid configuration change to get picked up and periodic checkpoints to start.
    2. On the new primary grid site, start a tibdgadmind process.
      tibdgadmind -r http://10.0.0.2:8080 -l 10.0.0.2:7171
  9. Stop any existing clients that need to write to the data grid. Restart the clients so that they use the URL of the new primary realm server and its backup realm server.