The
restore command restores your cluster from an existing
backup TAR file.
It
completely restores the following from backup:
- Studio data and metadata,
including the Studio database
- Dgraph data and metadata,
including the Dgraph databases
- Sample files in HDFS
It also restores some of the configuration settings, but not all of
them. See below for more information.
Note: The script makes a copy of the current Dgraph databases directory
in
DGRAPH_INDEX_DIR/.snapshot/old_copy. This should
be deleted if the restored version is kept.
Before running
restore, verify the following:
- The
BDD_STUDIO_JDBC_USERNAME and
BDD_STUDIO_JDBC_PASSWORD environment variables are
set. Otherwise, the script will prompt you for this information at runtime.
- The database client is
installed on the Admin Server. For MySQL databases, this should be MySQL
client. For Oracle databases, this should be Oracle Database Client, installed
with a type of Administrator. The Instant Client isn't supported.
- For Oracle databases, the
ORACLE_HOME environment variable is set to the
directory one level above the
/bin directory where the
sqlplus executable is located. For example, if the
sqlplus executable is located in
/u01/app/oracle/product/11/2/0/dbhome/bin,
ORACLE_HOME should be set to
/u01/app/oracle/product/11/2/0/dbhome/bin.
- The temporary directories
used during the restore operation contain enough free space. For more
information, see below.
- Both clusters have the
same type of database, either Oracle or MySQL.
restore doesn't support Hypersonic.
- Both environments are
either Kerberized on non-Kerberized. A Kerberized environment can't be restored
to a non-Kerberized one, and vice versa.
- Both environments either
have TLS/SSL either enabled or disabled in Hadoop. A secured environment can't
be restored to an unsecured one, and vice versa.
Note: restore can't be run if
start,
stop,
restart, or
backup is currently running.
To restore the cluster, run the following from the Admin Server:
./bdd-admin.sh restore [option] <file>
Where
<file> is the absolute path
to the backup TAR file to restore from. This must be a TAR file created by the
backup command. The cluster that was backed up to this
file and the current cluster must have the same major version of BDD as well as
the same type of database (Oracle or MySQL;
restore doesn't support Hypersonic databases). They
can have different topologies.
restore supports the following options.
| Option
|
Description
|
|
-l, --local-tmp
|
The absolute path to the temporary
directory on the Admin Server used during the restore operation. If this option
isn't specified, the location defined by
BACKUP_LOCAL_TEMP_FOLDER_PATH in
bdd.conf is used.
|
| -d, --hdfs-tmp
|
The absolute path to the temporary
directory on HDFS used during the restore operation. If this option isn't
specified, the location defined by
BACKUP_HDFS_TEMP_FOLDER_PATH in
bdd.conf is used.
|
| -v, --verbose
|
Enables debugging messages.
|
For more information on restoring your cluster, see
Restoring BDD.
Space requirements
When the script runs, it verifies that the temporary directories it
uses contain enough free space. These requirements only need to be met for the
duration of the restore operation.
- The
local-tmp directory on the Admin Server must
contain enough space to store the Dgraph databases, the HDFS sandbox, and the
edpDataDir (defined in
edp.properties) at the same time.
- The
hdfs-tmp directory on HDFS must contain free
space equal to the largest of these items, as it will only store them one at a
time.
If these requirements aren't met, the script will fail.
Configuration restoration
restore can't completely restore the configuration
files because the current cluster may have a different topology than the backup
cluster. Instead, it merges some of them with the ones from the current cluster
and leaves others unchanged.
The following table describes the changes the script makes to each
configuration file.
| File
|
Changes
|
| bdd.conf
|
The script restores the following
properties from backup:
- MAX_RECORDS
- ENABLE_ENRICHMENTS
- LANGUAGE
- SPARK_DRIVER_MEMORY
- SPARK_DRIVER_CORES
- SPARK_DYNAMIC_ALLOCATION
- SPARK_EXECUTOR_MEMORY
- SPARK_EXECUTOR_CORES
- SPARK_EXECUTORS
- YARN_QUEUE
No other properties are modified.
|
| portal-ext.properties
|
The script restores the following
properties from backup:
- dp.spark.dynamic.allocation
- sp.spark.driver.cores
- dp.spark.driver.memory
- dp.spark.executors
- dp.spark.executor.cores
- dp.spark.executor.memory
- dp.yarn.queue
- dp.settings.language
No other properties are modified.
|
| esconfig.properties
|
The script adds any properties from the
backup versions of these files that aren't in the current ones. It doesn't
modify any other settings.
|
| edp.properties
|
The script restores all settings that
don't affect cluster topology. Note that all other Data Processing
configuration files will be fully restored.
|
Examples
The following command restores your cluster from the
/tmp/bdd_backup1.tar file with no debugging
messages:
./bdd-admin.sh restore /tmp/bdd_backup1.tar