This section provides information on the restore process for Membase Server up to and including 1.7.0. For information on using the restore functionality in Membase Server 1.7.1, see Section 4.7.3, “Restore in 1.7.1 and higher”.
It is a best practice to backup and restore all nodes together to minimize any inconsistencies in data. Membase is always per-item consistent, but does not guarantee total cluster consistency or in-order persistence.
If you want to restore a Membase Server cluster to a previous state:
The cluster must contain the same number of nodes and those nodes must have the same IP addresses (or hostnames if you followed the instructions listed here)
You must restore all of the config.dat files as well as all of the database files to their original locations
Stop the Membase Server service, replace the database and configuration files and restart the service. This must be performed on all nodes.
Restoring a Membase Server cluster using the mbrestore tool
If you are unable to meet the above requirements for restoring a cluster, you can use the mbrestore tool. This script will read the key-value pairs from a set of database files and send them as client commands into a bucket of your choosing.
This is useful if:
You want to restore data into a cluster of a different size
You want to transfer/restore data into a different bucket
You have a broken or corrupted database file (usually from running out of space on a disk drive)
The mbrestore tool provides the following options:
mbrestore opts db_files (use -h for detailed help) -a --add Use add instead of set to avoid overwriting existing items -H --host Hostname of moxi server to connect to (default is 127.0.0.1) -p --port Port of moxi server to connect to (default is 11211) -t --threads Number of worker threads -u --username Username to authenticate with (this is the name of the bucket you are sending data into) -P --password Password to authenticate with (this is the password of the bucket you are sending data into)
Depending on the amount of data, this script can take an extended amount of time to run. It is a best practice to make sure that your connection to the server running the script is not broken, or that you are using something to let the script run in the background (i.e. screen)
/opt/membase/bin/ep_engine/management/mbrestore -a default default -0.mb default-1.mb default-2.mb default-3.mb
In order to correctly restore you must put all of the database backup file names as command arguments
shell> cd "C:/Program Files/Membase/Server/bin/ep-engine/management/" .\mbrestore -a "C:/backup/2010-12-22/default" "C:/backup/2010-12-22/default-0.mb" \ "C:/backup/2010-12-22/default-1.mb" "C:/backup/2010-12-22/default-2.mb" "C:/backup/2010-12-22/default-3.mb"
In order to correctly restore you must put all of the database backup file names as command arguments