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.
-
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
-
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]
-
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. -
Shut down the daemon if it is running on the original-master and slave-only:
/etc/init.d/dmdaemon stop
-
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
-
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.out for any possible errors.- To confirm processing is complete, run ls -al commands one after another to see if there are any changes to the file sizes.
-
By default, the folder is generated under the directory:
/var/opt/teradata/datamover/daemon_backup directory
-
Copy the folder from the designated-slave to the original-master and slave-only. For example:
scp -r /var/opt/teradata/datamover/daemon_backup/backup_2016-07-05_13.22.41 dm-agent8:/var/opt/teradata/datamover/daemon_backup/
-
Shut down the daemon service on the designated-slave:
/etc/init.d/dmdaemon stop
-
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
-
Change the owner of folders and files that were copied over to dmuser. For example:
chwon dmuser /var/opt/teradata/datamover/daemon_backup chwon dmuser /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41 chwon dmuser /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41/*
-
Change the permissions of the files and folders that were copied over to 755. For example:
chwon 755 /var/opt/teradata/datamover/daemon_backup chwon 755 /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41 chwon 755 /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41/*
-
Run the restore_daemon command to import the data. For 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. -
Shutdown the daemon on the original-master:
/etc/init.d/dmdaemon stop
-
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
-
Change the owner of the folder and files that were copied over to dmuser. For example:
chwon dmuser /var/opt/teradata/datamover/daemon_backup chwon dmuser /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41 chwon dmuser /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41/*
-
Change the permissions of the files and folder that were copied over to 755. For example:
chwon 755 /var/opt/teradata/datamover/daemon_backup chwon 755 /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41 chwon 755 /var/opt/teradata/datamover/daemon_backup_2016_07-05_13.22.41/*
-
Import the data. For 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. - Edit the sync.properties file for the slave-only and have it point to the original-master.
-
Shut down the daemon on the slave-only:
/etc/init.d/dmdaemon stop
-
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
-
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. 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. For example:
echo "WAS_SLAVE"> /var/opt/teradat/datamover/logs/audtLogPosition.txt
-
Start all Data Mover services on the original-master:
/etc/init.d/tdactivemq start /etc/init.d/dmagent start /etc/init.d/dmdaemon start
-
Update the sync.properties file with the appropriate parameters. Start 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. -
Update the sync.properties file with the appropriate parameters. Start 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.