Returning the Designated-Slave to Slave Mode - Teradata Data Mover

Teradata Data Mover User Guide

Product
Teradata Data Mover
Release Number
16.10
Published
June 2017
Language
English (United States)
Last Update
2018-03-29
dita:mapPath
kmo1482331935137.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-4101
lifecycle
previous
Product Category
Analytical Ecosystem

Once the daemon issues with the failed original-master are resolved, return the designated-slave to its original role as a slave. Because the original-master never connected to the designated-slave as a slave, any updates from the designated-slave while it was in the role of master are not automatically applied to original-master.

Synchronize the repository of the original-master with the repository of the designated-slave prior to returning the designated-slave back to a slave system.
To complete the process of restoring the original-master and returning the designated-slave to its original role as slave, follow the instructions described in the Starting the Synchronization Service section.
  1. Stop monitoring services on all systems (designated-slave, original-master, and slave-only) where nn.nn is the major and minor version numbers of Data Mover: /opt/teradata/client/nn.nn/datamover/failover/dmcluster stopmonitor
  2. Check for any jobs running on the designated-slave: datamove list_jobs -status_mode r If any jobs are running, wait for them to complete or manually stop jobs and run cleanup: datamover stop -job_name [job-name] datamover cleanup -job_name [job-name]
  3. Shut down the synchronization service on all systems: /opt/teradata/datamover/sync/nn.nn/dmsync stop Where nn.nn in the path refers to the major and minor version numbers of Data Mover.
  4. Shut down the daemon if it is running on the original-master and slave-only: /etc/init.d/dmdaemon stop
  5. If Data Mover services are not running on the designated-slave, turn them on and wait approximately two minutes until services are started: /etc/init.d/tdactivemq start /etc/init.d/dmagent start /etc/init.d/dmdaemon start
  6. Backup the designated-slave repository by running the backup_daemon command: datamove backup_daemon A folder with script files is generated. Wait until Triggers.sql is generated and check backup_script.output and BackupTriggers.outfor any possible errors.
    1. To confirm processing is complete, run ls -al commands one after another to see if there are any changes to the file sizes.
    2. By default, the folder is generated under the directory: /var/opt/teradata/datamover/daemon_backup directory
  7. Copy the folder from the designated-slave to the original-master and slave-only, as shown in the following example: scp -r /var/opt/teradata/datamover/daemon_backup/backup_2016-07-05_13.22.41 dm-agent8:/var/opt/teradata/datamover/daemon_backup/
  8. Shut down the daemon service on the designated-slave: /etc/init.d/dmdaemon stop
  9. Start the Data Mover services on the original-master and wait two minutes until the services start: /etc/init.d/tdactivemq start /etc/init.d/dmagent start /etc/init.d/dmdaemon start
  10. Change the owner of folders and files that were copied over to dmuser, as shown in the following example: chown dmuser /var/opt/teradata/datamover/daemon_backup chown dmuser /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41 chown dmuser /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41/*
  11. Change the permissions of the files and folders that were copied over to 755, as shown in the following example: chown 755 /var/opt/teradata/datamover/daemon_backup chown 755 /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41 chown 755 /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41/*
  12. Run the restore_daemon command to import the data, as shown in the following example: datamove restore_daemon -backup_target_dir /var/opt/teradata/datamover/daemon_backup/backup_2016-07-05_13.22.41 Use the ls -al command to check if the file sizes within this directory are changing or new files are still being created. Check the temp*.out and restore_script.output files to check for any errors.
  13. Shutdown the daemon on the original-master: /etc/init.d/dmdaemon stop
  14. Start the Data Mover services on the slave-only system: /etc/init.d/tdactivemq start /etc/init.d/dmagent start /etc/init.d/dmdaemon start
  15. Change the owner of the folder and files that were copied over to dmuser, as shown in the following example: chown dmuser /var/opt/teradata/datamover/daemon_backup chown dmuser /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41 chown dmuser /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41/*
  16. Change the permissions of the files and folder that were copied over to 755, as shown in the following example: chown 755 /var/opt/teradata/datamover/daemon_backup chown 755 /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41 chown 755 /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41/*
  17. Import the data, as shown in the following example: datamove restore_daemon -backup_target_dir /var/opt/teradata/datamover/daemon_backup_2016-07-05_13.22.41 Use the ls -al command to check if the files within this directory are changing or new files are still being created. Check the temp*.out and restore_script.output files to check for any errors.
  18. Edit the sync.properties file for the slave-only and have it point to the original-master.
  19. Shut down the daemon on the slave-only: /etc/init.d/dmdaemon stop
  20. Check for and remove the following files from both the master and all slave systems that may have been generated by the synchronization system. These files are created under the path defined by the sql.log.directory property of the sync.properties file. cd /var/opt/teradata/datamover/logs/ rm dmSyncMaster.json rm slave_*.lastread rm dmSyncSlave.json rm slave_sql.lastExecuted
  21. Edit the auditLogPosition.txt file that is created under the path defined by the sql.log.directory property of the sync.properties file and change all of its content with the WAS_SLAVE string, as shown in the following example:
    Ensure that there are no spaces or new line characters after string. By making this change, you are commanding the master synchronization system to ignore preexisting content in the DMAuditLog table.
    echo "WAS_SLAVE"> /var/opt/teradat/datamover/logs/audtLogPosition.txt
  22. Start all Data Mover services on the original-master: /etc/init.d/tdactivemq start /etc/init.d/dmagent start /etc/init.d/dmdaemon start
  23. Update the sync.properties file with the appropriate parameters, starting with the master synchronization system on the original-master: /opt/teradata/datamover/sync/nn.nn/dmsync start Where nn.nn in the path refers to the major and minor version numbers of Data Mover.
  24. Update the sync.properties file with the appropriate parameters, starting with the slave synchronization system on the designated-slave and slave-only systems: /opt/teradata/datamover/sync/nn.nn/dmsync start Where nn.nn in the path refers to the major and minor version numbers of Data Mover.
    Do not delete the files until after you have run the backup_daemon and restore_daemon commands.
    To complete the process of restoring the original-master and returning the designated-slave to its original role as slave, follow the instructions described in Starting the Synchronization Service.
These files are created under the path specified by the sql.log.directory property in the sync.properties file.