asbackup [OPTIONS]
命令的最简单形式是指定需要备份的命名空间(
namespace )和本地目录。
-f 3
,-c
。或者如果你想备份集群的特定节点,只需要给它地址和服务端口(默认3000)的节点。asbackup -h
10.0.0.9 -p 3000-d backup_01_23_2013 -n test -f3 -c -v
$ asbackup -l"host1:port1;host2:port2"-d backup_01_23_2013 -n test -f3 -c -v
Option | Default | Description |
---|---|---|
-h host |
127.0.0.1 | Host that acts as seed (entry point) to the cluster. Any single node can be specified and the entire cluster will be automatically discovered. |
-p port |
3000 | Port to use with the host specified in the -h option. |
-n namespace |
- | Namespace to back up. (Mandatory) |
-s set |
ALL SETS | The SET to backup up. |
-U user name |
- | User name with read permission. (Mandatory if security is enabled on server side) |
-P password |
- | Password. |
-d directory |
- | Local directory where the backup .asb files will be stored. If the directory does not exist, it will be created before use. (Mandatory) |
-F file size |
1GB | 文件大小。在跨越这个限制之后,将创建新文件。 |
-r |
False | Clean up directory - If this option is specified, then any .asb files in the backup directory will be removed before the backup begins. If this option is not specified and .asb files are found in the directory, the backup will terminate and you need to remove the files manually or change directory. |
-f scan priority |
2 | Scan priority - This option controls the level of concurrency on a node. Increasing this setting will increase the speed of the backup, but should be done while monitoring normal read/write performance to make sure cluster performance is not affected. The allowed values are:
|
-c |
False | Terminate on cluster change or ongoing migrations - If this option is specified the backup will fail if the cluster changes. When a cluster changes (for example, a node goes down), there is a period of time where the data migrates between the nodes to rebalance the cluster. If a backup is running while data rebalances, it is possible to get the same object backed up twice, or have some data that may be missed. To get a good, complete backup, use this option so that asbackup will fail if the cluster changes during the backup. |
-v |
False | Verbose mode - Use this option to enable verbose mode so that additional messages are displayed on the console. |
-B bin_list |
All bins | Backup with specific bins. |
-x |
False | "No bin" mode - While enabled the backup does not store data – i.e., Backup of only metadata is taken. When this option is set ONLY THE RECORD METADATA (digest information, the TTL and the generation information) is backed up. (Note that this is different from the single-bin option in the configuration file.) |
-w number of nodes |
10 | Number of nodes to back up in parallel. Backup will concurrently query the requested number of nodes. As backup for each node completes, an additional node will be added to the nodes being backed up. Setting this number too high may result in the client getting overloaded. |
-l list of nodes |
ALL | List of nodes to back up. This option allows you to specify which nodes to backup up. The list is of the form: node1 : port1 ; node2 : port2 ; ... ; noden : portn When you specify this option, the -h and -p options are ignored and the first host/port in the list is used to connect to the cluster. |
-% scan percentage |
100% | Percentage of each partition to backup. This option is useful for sampling – for example, you might backup 10% of the data to analyze with a script. |
-b |
False | Store all strings as Special Strings with base64 encoding. If this option is specified, strings will be converted to base64 encoding and included in the backup as X TYPE Strings . Reason for this is if your strings contain non-printable characters, those characters may cause formatting errors in the backup files that prevent asrestore from correctly restoring the data unless you use the -b option. From tools version 3.3.24 this option is no-op(depricated) and By default all strings will be stored as base64 encoded string |
-S |
False | From tools version 3.3.26 use this option to store normal strings as string only instead of base64 encoded |
--usage |
- | Display command usage. |
asrestore [OPTIONS]
$ asrestore -h 127.0.0.1 -p 3000-d /home/aerospike/backup_10_23_2011
Option | Default | Description |
---|---|---|
-d <target> |
[None] | Path to the directory where the backup files are located. (Mandatory) |
-h <host> |
127.0.0.1 | Host that acts as seed (entry point) to the cluster where data needs to be restored. Any single node can be specified and the entire cluster will be automatically discovered. |
-p <port> |
3000 | Port to use with the host specified in the -h option. |
-U user name |
- | User name with read permission. (Mandatory if security is enabled on server side) |
-P password |
- | Password. |
-B bin_list |
All bins | Restore only specific bins. |
`-b batch size | 100 | 可批量插入元素。最大允许为100。 |
-r replace or create |
update or create | 更换或创建记录。 |
-t <threads> |
20 | 在本地机器上运行备份的线程数。线程数的增加会使恢复过程更快,但设置值过高会使本地机器超载。 |
-u |
DISABLED | 丢失的记录。当这个选项被指定时,只在所有群集中不存在的记录被插入。 如果群集上存在这记录, 然后,该记录的备份版本将被丢弃,不管生成数(generation number)。 如果记录包含LDT bins,则不使用此选项。 |
-g |
DISABLED | 忽略generation number. When this option is set, records in the backup set overwrite records that already exist in the database, even if the generation number of the record in the database is newer. If record contains LDT bins dont use this option.
By using this option you may loose most recent copy of your data
|
-v |
DISABLED | 详细模式-如果指定了该选项,详细模式的启用和更多的信息显示在控制台。 |
--usage |
[None] | Display command usage. |
$ asrestore -d /home/john/dir
restoring: host 127.0.0.1 port 3000 from directory /home/john/dir
Sep 04201323:48:04 GMT: starting restore: filename: /home/john/dir/BB925F305CA0568_00000.asb FILE 0x7f65a80008c0
Sep 04201323:48:04 GMT: starting restore: filename: /home/john/dir/BB939F706CA0568_00000.asb FILE 0x7f65a00008c0
Sep 04201323:48:04 GMT: restore complete /home/john/dir/BB925F305CA0568_00000.asb processed 17 items
Sep 04201323:48:04 GMT: restore complete /home/john/dir/BB939F706CA0568_00000.asb processed 24 items
Sep 04201323:48:05 GMT: expired 0 : attempted 41 : [updated 41 not-updated (existed 0 gen-old 0)]
Sep 3201312:57:15 GMT: expired 4333 : attempted 3563832 : [updated 1354433 not-updated (existed 0 gen-old 2100432)]
Version VERSION
( RECORD )
( RECORD )
...
+ k TYPE TYPE-SPECIFIC
+ n NAMESPACE
+ d DIGEST
+ s SET
+ g GENERATION
+ t TTL
+ b NBINS
- ( BIN )
- ( BIN )
...