rladmin 故障转移

将数据库的主分片故障转移到其副本。

Redis 企业软件

对数据库的一个或多个主(也称为主)分片进行故障转移,并将其各自的副本提升为主分片。

rladmin failover
        [db { db:<id> | <name> }]
        shard <id1 ... idN>
        [immediate]

Parameters

Parameter Type/Value Description
db db:<id>
name
Fail over shards for the specified database
shard one or more primary shard IDs Primary shard or shards to fail over
immediate Perform failover without verifying the replica shards are in full sync with the master shards

Returns

Returns Finished successfully if the failover completed. Otherwise, it returns an error.

Use rladmin status shards to verify that the failover completed.

Example

$ rladmin status shards
SHARDS:
DB:ID  NAME        ID         NODE     ROLE     SLOTS     USED_MEMORY    STATUS
db:5   tr01        redis:12   node:1   slave    0-16383   3.02MB         OK     
db:5   tr01        redis:13   node:2   master   0-16383   3.09MB         OK     
$ rladmin failover shard 13
Executing shard fail-over: OOO.
Finished successfully
$ rladmin status shards
SHARDS:
DB:ID  NAME        ID         NODE     ROLE     SLOTS     USED_MEMORY    STATUS
db:5   tr01        redis:12   node:1   master   0-16383   3.12MB         OK     
db:5   tr01        redis:13   node:2   slave    0-16383   2.99MB         OK
RATE THIS PAGE
Back to top ↑