Hotcopy backup using NuoAgent step-by-step

{question}

How do I run hotcopy using nuoagent?

{question}

{answer}

Use nuodbmgr: (replace HOST, PWD according to your environment) 

/opt/nuodb/bin/nuodbmgr –broker <HOST> --password <PWD>

Hotcopy Usage:

hotcopy database {dbname} [ $type ] [ $snapshot ] [ $album ] [ $plan ] [ $destinationArchiveDirectory ] [ $destinationJournalDirectory ] [ $destinationSnapshotDirectory ] [ $backupSetDirectory ] [ $host ] [ $pid ] [ $timeout ]

 

Full Hotcopy command

The full hotcopy backup files will be generated under the default backup directory specified in the full hotcopy command:

Full Hotcopy command:

/opt/nuodb/bin/nuodbmgr --broker <HOST> --password <PWD> --command "hotcopy database <DB-NAME> host <HOST> pid <SM-PID> backupSetDirectory '<PATH-TO-BACKUP-DESTINATION>' type full"
example:
/opt/nuodb/bin/nuodbmgr --broker localhost --password bird --command "hotcopy database test_nuodb host localhost pid 471 backupSetDirectory '/tmp/backup/02-27-2020' type full"
Hot copy control node: host bc00b6fef9bf pid 471
Hot copy to Node 1 (host bc00b6fef9bf pid 471) /tmp/backup/02-27-2020 completed: Hot copy successfully completed

Full Hotcopy command in an interactive mode: (another way to run this command)

/opt/nuodb/bin/nuodbmgr --broker <HOST> --password <PWD>
nuodb [domain] > hotcopy database <DB-NAME>
Hot copy type (optional): full
Snapshot to copy, or firstSnapshot-lastSnapshot (optional):
Album to copy, or firstAlbum-lastAlbum, 0 means current state (optional):
Hot copy plan (optional):
Destination directory (optional):
Destination journal directory (optional):
Destination snapshot directory (optional):
Backup set directory (optional):<PATH-TO-BACKUP-DESTINATION>
Storage Manager host (optional): <HOST>
Storage Manager process id (optional): <SM-PID>
Timeout (ms/s/m/h/d/w) (optional):
example:
/opt/nuodb/bin/nuodbmgr --broker localhost --password bird
nuodb [domain] > hotcopy database test_nuodb
Hot copy type (optional): full
Snapshot to copy, or firstSnapshot-lastSnapshot (optional):
Album to copy, or firstAlbum-lastAlbum, 0 means current state (optional):
Hot copy plan (optional):
Destination directory (optional):
Destination journal directory (optional):
Destination snapshot directory (optional):
Backup set directory (optional): /tmp/backup/02-26-2020
Storage Manager host (optional): localhost
Storage Manager process id (optional): 471
Timeout (ms/s/m/h/d/w) (optional):
Hot copy control node: host bc00b6fef9bf pid 471
Hot copy to Node 1 (host bc00b6fef9bf pid 471) /tmp/backup/02-26-2020 completed: Hot copy successfully completed
nuodb [domain] >

Check for backup completion 

/opt/nuodb/bin/nuodbmgr --broker <HOST> --password <PWD> --command "show process status host <HOST> pid <SM-PID>"
example:
/opt/nuodb/bin/nuodbmgr --broker localhost --password bird --command "show process status host localhost pid 471"
NodeID: 1 NodeState: RUNNING Clients: 0
Hot copy: id 352d50ef-e584-4cc2-abb5-37374f026396 started at 2020-02-27 19:04:27 ended at 2020-02-27 19:04:27 copying to /tmp/backup/02-27-2020/tmp/full/data status completed message Hot copy successfully completed

Check for the files generated by the full hotcopy command:

# ls -l /tmp/backup/02-27-2020
drwxrwxr-x 4 nuodb nuodb 31 Feb 27 19:04 full
-rw-rw-r-- 1 nuodb nuodb 428 Feb 27 19:04 state.xml
drwxrwxr-x 2 nuodb nuodb 6 Feb 27 19:04 tmp

 

Incremental Hotcopy command

The incremental hotcopy backup files will be generated under the default backup directory specified in the incremental hotcopy command.

Please note that an incremental backup requires a full backup first in the backup-dir path, otherwise you will get an error message:

'hotcopy database' failed: Failure while performing hot-copy: Error while sending engine request: Cannot create incremental element. No full hotcopy exists in backup set

Incremental Hotcopy command:

/opt/nuodb/bin/nuodbmgr --broker <HOST> --password <PWD> --command "hotcopy database <DB-NAME> host <HOST> pid <SM-PID> backupSetDirectory '<PATH-TO-BACKUP-DESTINATION>' type incremental"
example:
/opt/nuodb/bin/nuodbmgr --broker localhost --password bird --command "hotcopy database test_nuodb host localhost pid 471 backupSetDirectory '/tmp/backup/02-27-2020' type incremental"
Hot copy control node: host bc00b6fef9bf pid 471
Hot copy to Node 1 (host bc00b6fef9bf pid 471) /tmp/backup/02-27-2020 completed: Hot copy successfully completed

Check the files generated by the incremental hotcopy backup, directory 1.inc

root@bc00b6fef9bf bin]# ls -l /tmp/backup/02-27-2020
drwxrwxr-x 4 nuodb nuodb 31 Feb 27 19:35 1.inc
drwxrwxr-x 4 nuodb nuodb 31 Feb 27 19:04 full
-rw-rw-r-- 1 nuodb nuodb 428 Feb 27 19:04 state.xml
drwxrwxr-x 2 nuodb nuodb 6 Feb 27 19:35 tmp


Next Incremental hotcopy will generate 2.inc subdirectory and so on.


Journal hotcopy

To use journal hotcopy with an SM, start that SM with the option --journal-hot-copy enable, if not you will get the following error message while taking a journal hotcopy

I stopped the SM that I was using and I started it in adding the journal-hot-copy enable option:

SM should be restarted with journal-hot-copy enabled:

/opt/nuodb/bin/nuodbmgr --broker <HOST> --password <PWD> --command "hotcopy database <DB-NAME> host <HOST> pid <SM-PID> backupSetDirectory '<PATH-TO-BACKUP-DESTINATION>' type full"
example:
/opt/nuodb/bin/nuodbmgr --broker localhost --password bird
nuodb [domain] > start process sm database test_nuodb host localhost archive /var/opt/nuodb/test_nuodb
Process command-line options (optional): --journal-hot-copy enable
Initialize archive (optional): false
Started: [SM] bc00b6fef9bf/127.0.0.1:48005 (DEFAULT_REGION) [ pid = 2935 ] [ db = test_nuodb ] [ nodeId = 1 ] ACTIVE 

Once you set journal-hot-copy to enable, you will have to create a new backup set with full backup, otherwise, you will get this error message:

/opt/nuodb/bin/nuodbmgr --broker <HOST> --password <PWD> --command "hotcopy database <DB-NAME> host <HOST> pid <SM-PID> backupSetDirectory '<PATH-TO-BACKUP-DESTINATION>' type journal"
example:
/opt/nuodb/bin/nuodbmgr --broker localhost --password bird --command "hotcopy database test_nuodb host localhost pid 2935 backupSetDirectory '/tmp/backup/02-27-2020' type journal"
Hot copy control node: host bc00b6fef9bf pid 2935
At line 1: hotcopy: Backup set ids in backup set /tmp/backup/02-27-2020 and archive do not match, journal hot copy is not allowed
Run first full hotcopy in a new backup set
/opt/nuodb/bin/nuodbmgr --broker <HOST> --password <PWD> --command "hotcopy database <DB-NAME> host <HOST> pid <SM-PID> backupSetDirectory '<PATH-TO-BACKUP-DESTINATION>' type full"
example:
/opt/nuodb/bin/nuodbmgr --broker localhost --password bird --command "hotcopy database test_nuodb host localhost pid 2935 backupSetDirectory '/tmp/backup/02-28-2020' type full"
Hot copy control node: host bc00b6fef9bf pid 2935
Hot copy to Node 1 (host bc00b6fef9bf pid 2935) /tmp/backup/02-28-2020 completed: Hot copy successfully completed

 Journal Hotcopy command:

/opt/nuodb/bin/nuodbmgr --broker <HOST> --password <PWD> --command "hotcopy database <DB-NAME> host <HOST> pid <SM-PID> backupSetDirectory '<PATH-TO-BACKUP-DESTINATION>' type jourmal"
example:
/opt/nuodb/bin/nuodbmgr --broker localhost --password bird --command "hotcopy database test_nuodb host localhost pid 2935 backupSetDirectory '/tmp/backup/02-28-2020' type journal"
Hot copy control node: host bc00b6fef9bf pid 2935
Hot copy to Node 1 (host bc00b6fef9bf pid 2935) /tmp/backup/02-28-2020 completed: Hot copy successfully completed

The Journal hotcopy backup files will be generated under the default backup-dir specified in the journal hotcopy command, check the generated files:

[root@bc00b6fef9bf bin]# ls -l /tmp/backup/02-28-2020/
drwxrwxr-x 4 nuodb nuodb 31 Feb 27 20:29 1.jnl
drwxrwxr-x 4 nuodb nuodb 31 Feb 27 20:28 full
-rw-rw-r-- 1 nuodb nuodb 428 Feb 27 20:28 state.xml
drwxrwxr-x 2 nuodb nuodb 6 Feb 27 20:29 tmp  

 

If you have any questions, please reach out by clicking here

{answer}

 

Have more questions? Submit a request

Comments