在 aerospike 中恢复备份

Restore backup in aerospike

我正在尝试从 aerospike 恢复备份,但出现此错误:

2016-01-26 21:55:47 GMT [INF] [20675] Starting restore to 127.0.0.1:3000 (bins: [all], sets: [all]) from backup.asb
2016-01-26 21:55:47 GMT [INF] [20675] Processing 1 node(s)
2016-01-26 21:55:47 GMT [INF] [20675] Restoring backup.asb
2016-01-26 21:55:47 GMT [INF] [20675] Opened backup file backup.asb
2016-01-26 21:55:47 GMT [ERR] [20675] Invalid version line in backup file backup.asb
2016-01-26 21:55:47 GMT [ERR] [20675] 0000 32 30 31 36 2d 30 31 2d 32 36 20 31 00          2016-01-26 1.
2016-01-26 21:55:47 GMT [ERR] [20675] Error while opening shared backup file
2016-01-26 21:55:48 GMT [INF] [20693] 0 UDF file(s), 0 secondary index(es), 0 record(s) (0 KiB/s, 0 rec/s, 0 B/rec, backed off: 0)
2016-01-26 21:55:48 GMT [INF] [20693] Expired 0 : skipped 0 : inserted 0 : failed 0 (existed 0, fresher 0)

如何解决这个问题?

备份服务器和恢复服务器都有相同版本的 aerospike(Aerospike 社区版 build 3.7.2)

这里是备份文件的前42行:

2016-01-26 15:54:18 GMT [INF] [23418] Starting 100% backup of 127.0.0.1:3000 (namespace: test, set: [all], bins: [all]) to [stdout]
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:415][as_cluster_seed_nodes] Add node BB90600F00A0142 127.0.0.1:3000
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:475][as_cluster_find_nodes_to_add] Duplicate node found BB90600F00A0142 127.0.0.1:3000
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:483][as_cluster_find_nodes_to_add] Add node BB91B00F00A0142 10.240.0.27:3000
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:483][as_cluster_find_nodes_to_add] Add node BB90500F00A0142 10.240.0.5:3000
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:483][as_cluster_find_nodes_to_add] Add node BB90D00F00A0142 10.240.0.13:3000
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:483][as_cluster_find_nodes_to_add] Add node BB90E00F00A0142 10.240.0.14:3000
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:483][as_cluster_find_nodes_to_add] Add node BB91700F00A0142 10.240.0.23:3000
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:483][as_cluster_find_nodes_to_add] Add node BB91800F00A0142 10.240.0.24:3000
2016-01-26 15:54:18 GMT [INF] [23418] [src/main/aerospike/as_cluster.c:475][as_cluster_find_nodes_to_add] Duplicate node found BB90600F00A0142 127.0.0.1:3000
2016-01-26 15:54:18 GMT [INF] [23418] Processing 7 node(s)
2016-01-26 15:54:18 GMT [INF] [23418] Node ID             Objects        Replication
2016-01-26 15:54:18 GMT [INF] [23418] BB90600F00A0142     5897565        3
2016-01-26 15:54:18 GMT [INF] [23418] BB91B00F00A0142     5957713        3
2016-01-26 15:54:18 GMT [INF] [23418] BB90500F00A0142     5956161        3
2016-01-26 15:54:18 GMT [INF] [23418] BB90D00F00A0142     5955580        3
2016-01-26 15:54:18 GMT [INF] [23418] BB90E00F00A0142     5879393        3
2016-01-26 15:54:18 GMT [INF] [23418] BB91700F00A0142     5923271        3
2016-01-26 15:54:18 GMT [INF] [23418] BB91800F00A0142     5936997        3
2016-01-26 15:54:18 GMT [INF] [23418] Namespace contains 13835560 record(s)
2016-01-26 15:54:18 GMT [INF] [23453] Starting backup for node BB90600F00A0142
2016-01-26 15:54:18 GMT [INF] [23453] No secondary indexes
2016-01-26 15:54:18 GMT [INF] [23453] Backing up 0 UDF file(s)
Version 3.1
# namespace test
# first-file
+ k B 8 ADhSgg==
+ n test
+ d GmBtCbKAyOCJkFjeYld+6JOvLEU=
+ s linksd
+ g 1
+ t 0
+ b 1
- B value 8 AAibxA==
+ k B 8 AGJkEA==
+ n test
+ d GqDqbia17QaG5dEpmyBcTGv5JiI=
+ s index
+ g 133
+ t 0
+ b 1

前几行,直到您看到 "Version 3.1" 行是无效备份。

....backup of 127.0.0.1:3000 (namespace: test, set: [all], bins: [all]) to [stdout]

根据您分享的第一行,您似乎正在使用 'stdout' 作为输出文件名。这将捕获备份命令的所有输出,其中还会打印一些运行时信息。这会使还原命令感到困惑,因为备份文件不是预期的格式。

因此,请不要将标准输出重定向到备份文件。如果要捕获备份命令的标准输出,可以将其重定向到与备份文件不同的文件。