Sometimes one of the nodes in the cluster possesses the tokens that are not available on other nodes of the cluster. One of the main reason for this is that the appliance processed client application traffic while replication was disabled. Follow below steps to manually replicate the data that was created while the replication was disabled.
NOTE: Replace below parameters in the commands.
- <SID> - ServerID number of the appliance with the extra tokens. You may check the SID number of the appliance by running 'mysql -u skles -p`dbpass 2> /dev/null` strongkeylite -e "select sid, fqdn from servers;"' command as strongauth user and using the FQDN of the appliance as reference.
- <DID> - DomainID number for which the tokens are created. If there are multiple DomainIDs with the extra tokens, then run the same commands for all the DIDs.
- <DATE1> - Replace with the date on which the replication was disabled. Format should be 'YYYY-MM-DD HH:MM:SS'.
- <DATE2> - Replace with the date on which the replication was enabled back. Format should be 'YYYY-MM-DD HH:MM:SS'.
|
- Login into the appliance (where records were created when replication was disabled) as strongauth user.
- Export the tokens to be replicated to other node.
shell> mysqldump -u skles -p`dbpass 2> /dev/null` -w "sid=<SID> and did=<DID> and request_date>'<DATE1>' and request_date<'<DATE2>'" --no-create-info --insert-ignore strongkeylite encryption_requests > /usr/local/strongauth/dbdumps/enc_req_repl_<SID>_<DID>_`hostname`.db
- Copy over the exported file (/usr/local/strongauth/dbdumps/enc_req_repl_<SID>_<DID>_`hostname`.db) to other appliances under /usr/local/strongauth/dbdumps.
- Logout of this appliance.
- Login into other appliance in the cluster.
- Take a backup of encryption_requests table.
shell> mysqldump -u skles -p`dbpass 2> /dev/null` --no-create-info --insert-ignore strongkeylite encryption_requests > /usr/local/strongauth/dbdumps/enc_req_`hostname`-$(date +"%Y-%m-%d").db
- Login into the strongkeylite database as skles user.
shell> mys
- Import data using the file that was copied over.
shell> source /usr/local/strongauth/dbdumps/enc_req_repl_<SID>_<DID>_<FQDN of Node with extra data>.db;
- Exit out of database.
- Logout out of appliance.