Creating an Archive
The following assumes that the Transparent Huge Pages (THP) setting is disabled on Linux operating systems. For more information on how to disable THP, see Disabling Transparent Huge Pages. |
When creating a NuoDB database, you must first create a database storage archive entry. In NuoDB, a database archive is a copy of the database on disk. NuoDB does not enforce the location of the database archive directories. The database archive directory location specified in this section is the default location when installing using the Linux OS package install method.
If you decide to change the database archive location, you must ensure that:
-
If using the .deb/.rpm package install method, the
nuodb
user and group have read and write privileges to the new location. -
If using the .tar install method, the user running NuoDB commands has read and write privileges to the new location.
To define the persistent disk storage archive properties within the NuoDB Durable State machine (DSM) for a particular database, use the nuocmd create archive
command.
The nuocmd create archive
command does not pre-allocate storage space to the archive.
nuocmd create archive --db-name <database name> --server-id <server ID> --archive-path <full path>
For more information on NuoDB Command and other command line tools, see Command Line Tools.
Parameters
This section describes parameters that can be provided when using the create archive
command.
Parameter | Description | Comments |
---|---|---|
|
The database this archive will be associated with. |
- |
|
The NuoDB Admin server that is configured on the host machine where the archive will exist. |
This parameter is mandatory except when using the |
|
The database archive directory location on disk. |
When specifying the location, include the full path. For example, |
|
The database journal directory location on disk |
When specifying the location, include the full path. For example, |
|
The database snapshot archive directory location on disk |
When specifying the location, include the full path. For example, |
|
Creates an archive entry based on an existing archive. |
For more information, see Restoring a Database Using an Archive. |
Example
The following example shows how to create an archive object with a server ID and archive path.
nuocmd create archive --db-name hockey \
--server-id nuoadmin-0 --archive-path /var/opt/nuodb/production-archives/hockey
Archive(archive_path=/var/opt/nuodb/production-archives/hockey, db_name=hockey, id=0, server_id=nuoadmin-0, state=PROVISIONED)
The create archive command documented here specifies:- The name of the database for which an archive is required (hockey). - The ID of the NuoDB Admin server where the archive is to be stored (nuoadmin-0). - The location (with archive name appended) of the archive being created (/var/opt/nuodb/production-archive/hockey). |
The create archive command generates an archive ID for the archive created (id=0 ).
|
Archive Paths per Installation Type
Depending on how NuoDB has been installed, ensure the archive path is set appropriately.
For a TAR installation
nuocmd create archive --db-name <database name> --server-id <server ID> --archive-path /var/opt/nuodb/production-archives/<database name>
For a RPM / DEB installation
nuocmd create archive --db-name <database name> --server-id <server ID> --archive-path /var/opt/nuodb/production-archives/<database name>
For a Windows installation
mkdir %NUODB_HOME%/archives
nuocmd create archive --db-name <database name> --server-id <server ID> --archive-path %NUODB_HOME%/archives/<database name>