Hotcopy backup using nuoadmin step-by-step

{question}

How do I run hotcopy using nuoadmin?

{question}

{answer}

/opt/nuodb/bin/nuocmd show domain

server version: 4.0.4-2-019a14f800, server license: Enterprise
server time: 2020-02-25T18:10:24.896, client token: 9654abc912062297aed49d071df99939e7af2e17
Servers:
[nuoadmin-0] localhost:48005 [last_ack = 9.55] [member = ADDED] [raft_state = ACTIVE] (LEADER, Leader=nuoadmin-0, log=0/26/26) Connected *
Databases:
test_nuodb [state = RUNNING]
[SM] 60df1252a474/localhost:48006 [start_id = 0] [server_id = nuoadmin-0] [pid = 361] [node_id = 1] [last_ack = 8.73] MONITORED:RUNNING
[TE] 60df1252a474/localhost:48007 [start_id = 1] [server_id = nuoadmin-0] [pid = 367] [node_id = 2] [last_ack = 4.67] MONITORED:RUNNIN

NuoAdmin Hotcopy usage:

usage: nuocmd hotcopy database [-h] --db-name DB_NAME --type
{full,incremental,journal} [--shared]
[--default-backup-dir DEFAULT_BACKUP_DIR]
[--backup-dirs [BACKUP_DIRS [BACKUP_DIRS ...]]]
[--timeout TIMEOUT]

optional arguments:
-h, --help show this help message and exit
--db-name DB_NAME the name of the database to hot-copy
--type {full,incremental,journal}
the type of hot-copy to perform
--shared whether the backup location specified by --default-backup-dir is on
shared storage
--default-backup-dir DEFAULT_BACKUP_DIR
backup location to use for any archive that does not have a backup
location associated with it by --backup-dirs
--backup-dirs [BACKUP_DIRS [BACKUP_DIRS ...]]
map of archive ID to backup location to use for that archive
--timeout TIMEOUT if specified, the time to wait in seconds for the hot-copy to
complete; if not specified, the request is issued asynchronously

  

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/nuocmd hotcopy database --db-name <DB-NAME> --default-backup-dir <PATH-TO-BACKUP-DESTINATION> --type full
example:
/opt/nuodb/bin/nuocmd hotcopy database --db-name test_nuodb --default-backup-dir /tmp/backup/02-25-2020 --type full
HotCopyResponse(coordinator_start_id=0, id=ddeebf92-838f-4de6-b48e-c9630bcca7f8)
The full hotcopy backup files will be generates under the default backup dir specified in the full hotcopy command

Check for the files generated by the full hotcopy command:

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

 

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

/opt/nuodb/bin/nuocmd hotcopy database --db-name <DB-NAME> --default-backup-dir <PATH-TO-BACKUP-DESTINATION> --type incremental
example:
/opt/nuodb/bin/nuocmd hotcopy database --db-name test_nuodb --default-backup-dir /tmp/backup/02-25-2020 --type incremental
HotCopyResponse(coordinator_start_id=0, id=186a6017-2d93-48fb-bf3f-aaa3e1711212)
An incremental subdirectory will be created in the same level of the full backup subdirectory, in this example 1.inc

The incremental hotcopy backup files will be generated under the default backup-dir specified in the incremental hotcopy command

# ls -l /tmp/backup/02-25-2020
drwxrwxr-x 4 nuodb nuodb 31 Feb 25 19:15 1.inc
drwxrwxr-x 4 nuodb nuodb 31 Feb 25 18:27 full
-rw-rw-r-- 1 nuodb nuodb 425 Feb 25 18:27 state.xml
drwxrwxr-x 2 nuodb nuodb 6 Feb 25 19:15 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/nuocmd start process --db-name <DB-NAME> --server-id <Server-ID> --engine-type SM --archive-id <Archive-Id> --options  initialize false journal-hot-copy enable
example:
/opt/nuodb/bin/nuocmd start process --db-name test_nuodb --server-id nuoadmin-0 --engine-type SM --archive-id 0 --options  initialize false journal-hot-copy enable

 Journal Hotcopy command

/opt/nuodb/bin/nuocmd hotcopy database --db-name <DB-NAME> --default-backup-dir <PATH-TO-BACKUP-DESTINATION> --type journal
example:
/opt/nuodb/bin/nuocmd hotcopy database --db-name test_nuodb --default-backup-dir /tmp/backup/02-25-2020 --type journal
HotCopyResponse(coordinator_start_id=2, id=8614bb7b-9761-45fd-9556-37791e6f4702)

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

# ls -l /tmp/backup/02-25-2020/
drwxrwxr-x 4 nuodb nuodb 31 Feb 25 19:15 1.inc
drwxrwxr-x 4 nuodb nuodb 31 Feb 25 20:05 1.jnl
drwxrwxr-x 4 nuodb nuodb 31 Feb 25 19:23 2.inc
drwxrwxr-x 4 nuodb nuodb 31 Feb 25 20:11 2.jnl
drwxrwxr-x 4 nuodb nuodb 31 Feb 25 18:27 full
-rw-rw-r-- 1 nuodb nuodb 425 Feb 25 18:27 state.xml
drwxrwxr-x 2 nuodb nuodb 6 Feb 25 20:11 tmp
 
If you have any questions, please reach out by clicking here 

{answer}

Have more questions? Submit a request

Comments