6.18.1. Moving the THL File Location

The location of the THL directory where THL files are stored can be changed, either by using a symbolic link or by changing the configuration to point to the new directory:

6.18.1.1. Relocating THL Storage using Symbolic Links

In an emergency, the directory currently holding the THL information, can be moved using symbolic links to relocate the files to a location with more space.

Moving the THL location requires updating the location for a Replica by temporarily setting the Replica offline, updating the THL location, and re-enabling back into the cluster:

  1. Shun the datasource and switch your node into the offline state using cctrl:

    shell> cctrl -expert
    [LOGICAL:EXPERT] /alpha > datasource host1 shun
    [LOGICAL:EXPERT] /alpha > replicator host1 offline
  2. Create a new directory, or attach a new filesystem and location on which the THL content will be located. You can use a directory on another filesystem or connect to a SAN, NFS or other filesystem where the new directory will be located. For example:

    shell> mkdir /mnt/data/thl
  3. Copy the existing THL directory to the new directory location. For example:

    shell> rsync -r /opt/continuent/thl/* /mnt/data/thl/
  4. Move the existing directory to a temporary location:

    shell> mv /opt/continuent/thl /opt/continuent/old-thl
  5. Create a symbolic link from the new directory to the original directory location:

    shell> ln -s /mnt/data/thl /opt/continuent/thl
  6. Recover the host back into the cluster :

    shell> cctrl -expert
    [LOGICAL:EXPERT] /alpha > datasource host1 recover

To change the THL location on a Primary:

  1. Manually promote an existing Replica to be the new Primary:

    [LOGICAL] /alpha > switch to host2
    SELECTED SLAVE: host2@alpha
    PURGE REMAINING ACTIVE SESSIONS ON CURRENT MASTER 'host1@alpha'
    PURGED A TOTAL OF 0 ACTIVE SESSIONS ON MASTER 'host1@alpha'
    FLUSH TRANSACTIONS ON CURRENT MASTER 'host1@alpha'
    PUT THE NEW MASTER 'host2@alpha' ONLINE
    PUT THE PRIOR MASTER 'host1@alpha' ONLINE AS A SLAVE
    RECONFIGURING SLAVE 'host3@alpha' TO POINT TO NEW MASTER 'host2@alpha'
    SWITCH TO 'host2@alpha' WAS SUCCESSFUL
  2. Update the THL location as provided in the previous sequence.

  3. Switch the updated Replica back to be the Primary:

    [LOGICAL] /alpha > switch to host1
    SELECTED SLAVE: host1@alpha
    PURGE REMAINING ACTIVE SESSIONS ON CURRENT MASTER 'host2@alpha'
    PURGED A TOTAL OF 0 ACTIVE SESSIONS ON MASTER 'host2@alpha'
    FLUSH TRANSACTIONS ON CURRENT MASTER 'host2@alpha'
    PUT THE NEW MASTER 'host1@alpha' ONLINE
    PUT THE PRIOR MASTER 'host2@alpha' ONLINE AS A SLAVE
    RECONFIGURING SLAVE 'host3@alpha' TO POINT TO NEW MASTER 'host1@alpha'
    SWITCH TO 'host1@alpha' WAS SUCCESSFUL

6.18.1.2. Relocating THL Storage using Configuration Changes

To permanently change the directory currently holding the THL information can by reconfigured to a new directory location.

To update the location for a Replica by temporarily setting the Replica offline, updating the THL location, and re-enabling back into the cluster:

  1. Shun the datasource and switch your node into the offline state using cctrl:

    shell> cctrl -expert
    [LOGICAL:EXPERT] /alpha > datasource host1 shun
    [LOGICAL:EXPERT] /alpha > replicator host1 offline
  2. Create a new directory, or attach a new filesystem and location on which the THL content will be located. You can use a directory on another filesystem or connect to a SAN, NFS or other filesystem where the new directory will be located. For example:

    shell> mkdir /mnt/data/thl
  3. Copy the existing THL directory to the new directory location. For example:

    shell> rsync -r /opt/continuent/thl/* /mnt/data/thl/
  4. Change the directory location using tpm to update the configuration for a specific host:

    shell> tpm update --thl-directory=/mnt/data/thl --host=host1
  5. Recover the host back into the cluster :

    shell> cctrl -expert
    [LOGICAL:EXPERT] /alpha > datasource host1 recover

To change the THL location on a Primary:

  1. Manually promote an existing Replica to be the new Primary:

    [LOGICAL] /alpha > switch to host2
    SELECTED SLAVE: host2@alpha
    PURGE REMAINING ACTIVE SESSIONS ON CURRENT MASTER 'host1@alpha'
    PURGED A TOTAL OF 0 ACTIVE SESSIONS ON MASTER 'host1@alpha'
    FLUSH TRANSACTIONS ON CURRENT MASTER 'host1@alpha'
    PUT THE NEW MASTER 'host2@alpha' ONLINE
    PUT THE PRIOR MASTER 'host1@alpha' ONLINE AS A SLAVE
    RECONFIGURING SLAVE 'host3@alpha' TO POINT TO NEW MASTER 'host2@alpha'
    SWITCH TO 'host2@alpha' WAS SUCCESSFUL
  2. Update the THL location as provided in the previous sequence.

  3. Switch the updated Replica back to be the Primary:

    [LOGICAL] /alpha > switch to host1
    SELECTED SLAVE: host1@alpha
    PURGE REMAINING ACTIVE SESSIONS ON CURRENT MASTER 'host2@alpha'
    PURGED A TOTAL OF 0 ACTIVE SESSIONS ON MASTER 'host2@alpha'
    FLUSH TRANSACTIONS ON CURRENT MASTER 'host2@alpha'
    PUT THE NEW MASTER 'host1@alpha' ONLINE
    PUT THE PRIOR MASTER 'host2@alpha' ONLINE AS A SLAVE
    RECONFIGURING SLAVE 'host3@alpha' TO POINT TO NEW MASTER 'host1@alpha'
    SWITCH TO 'host1@alpha' WAS SUCCESSFUL