rladmin 恢复
在恢复模式下恢复数据库。
Redis 企业软件 |
---|
在集群故障等事件后以恢复模式恢复数据库,并从存储的持久性文件中恢复数据库的配置和数据。有关详细说明,请参阅恢复失败的数据库。
数据库持久性文件存储在/var/opt/redislabs/persist/redis/
默认情况下,但您可以指定用于数据库恢复的其他目录rladmin node <id> recovery_path set <path>
.
recover all
在恢复模式下恢复所有数据库。
rladmin recover all
[ only_configuration ]
Parameters
Parameters
Type/Value
Description
only_configuration
Recover database configuration without data
Returns
Returns Completed successfully
if the database was recovered. Otherwise, returns an error.
Example
$ rladmin recover all
0% [ 0 recovered | 0 failed ] | | Elapsed Time: 0:00:00[first-db (db:1) recovery] Initiated.[second-db (db:2) recovery] Initiated.
50% [ 0 recovered | 0 failed ] |### | Elapsed Time: 0:00:04[first-db (db:1) recovery] Completed successfully
75% [ 1 recovered | 0 failed ] |###### | Elapsed Time: 0:00:06[second-db (db:2) recovery] Completed successfully
100% [ 2 recovered | 0 failed ] |#########| Elapsed Time: 0:00:08
recover db
Recovers a specific database in recovery mode.
rladmin recover db { db:<id> | <name> }
[ only_configuration ]
Parameters
Parameters
Type/Value
Description
db
db:<id>
name
Database to recover
only_configuration
Recover database configuration without data
Returns
Returns Completed successfully
if the database was recovered. Otherwise, returns an error.
Example
$ rladmin recover db db:1
0% [ 0 recovered | 0 failed ] | | Elapsed Time: 0:00:00[demo-db (db:1) recovery] Initiated.
50% [ 0 recovered | 0 failed ] |### | Elapsed Time: 0:00:00[demo-db (db:1) recovery] Completed successfully
100% [ 1 recovered | 0 failed ] |######| Elapsed Time: 0:00:02
recover list
Shows a list of all databases that are currently in recovery mode.
rladmin recover list
Parameters
None
Returns
Displays a list of all recoverable databases. If no databases are in recovery mode, returns No recoverable databases found
.
Example
$ rladmin recover list
DATABASES IN RECOVERY STATE:
DB:ID NAME TYPE SHARDS REPLICATION PERSISTENCE STATUS
db:5 tr01 redis 1 enabled aof missing-files
db:6 tr02 redis 4 enabled snapshot ready
recover s3_import
Imports current database snapshot files from an AWS S3 bucket to a directory on the node.
rladmin recover s3_import
s3_bucket <bucket name>
[ s3_prefix <prefix> ]
s3_access_key_id <access key>
s3_secret_access_key <secret access key>
import_path <path>
Parameters
Parameters
Type/Value
Description
s3_bucket
string
S3 bucket name
s3_prefix
string
S3 object prefix
s3_access_key_id
string
S3 access key ID
s3_secret_access_key
string
S3 secret access key
import_path
filepath
Local import path where all database snapshots will be imported
Returns
Returns Completed successfully
if the database files were imported. Otherwise, returns an error.
Example
rladmin recover s3_import s3_bucket <bucket-name> s3_prefix <s3-prefix>/ s3_access_key_id <access-key> s3_secret_access_key <secret-access-key> import_path /tmp
On this page