[ aws . elasticache ]
Represents the input of a TestFailover
operation which test automatic failover on a specified node group (called shard in the console) in a replication group (called cluster in the console).
Note the following
A customer can use this operation to test automatic failover on up to 5 shards (called node groups in the ElastiCache API and AWS CLI) in any rolling 24-hour period.
If calling this operation on shards in different clusters (called replication groups in the API and CLI), the calls can be made concurrently.
If calling this operation multiple times on different shards in the same Redis (cluster mode enabled) replication group, the first node replacement must complete before a subsequent call can be made.
To determine whether the node replacement is complete you can check Events using the Amazon ElastiCache console, the AWS CLI, or the ElastiCache API. Look for the following automatic failover related events, listed here in order of occurrance:
Replication group message: Test Failover API called for node group <node-group-id>
Cache cluster message: Failover from master node <primary-node-id> to replica node <node-id> completed
Replication group message: Failover from master node <primary-node-id> to replica node <node-id> completed
Cache cluster message: Recovering cache nodes <node-id>
Cache cluster message: Finished recovery for cache nodes <node-id>
For more information see:
Viewing ElastiCache Events in the ElastiCache User Guide
DescribeEvents in the ElastiCache API Reference
Also see, Testing Multi-AZ in the ElastiCache User Guide .
See also: AWS API Documentation
See ‘aws help’ for descriptions of global parameters.
test-failover
--replication-group-id <value>
--node-group-id <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--cli-auto-prompt <value>]
--replication-group-id
(string)
The name of the replication group (console: cluster) whose automatic failover is being tested by this operation.
--node-group-id
(string)
The name of the node group (called shard in the console) in this replication group on which automatic failover is to be tested. You may test automatic failover on up to 5 node groups in any rolling 24-hour period.
--cli-input-json
| --cli-input-yaml
(string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml
.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. Similarly, if provided yaml-input
it will print a sample input YAML that can be used with --cli-input-yaml
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
--cli-auto-prompt
(boolean)
Automatically prompt for CLI input parameters.
See ‘aws help’ for descriptions of global parameters.
To test failover of a node group
The following test-failover
example tests automatic failover on the specified node group (called a shard in the console) in a replication group (called a cluster in the console).
aws elasticache test-failover /
--replication-group-id "mycluster" /
--node-group-id "0001"
Output:
{
"ReplicationGroup": {
"ReplicationGroupId": "mycluster",
"Description": "My Cluster",
"Status": "available",
"PendingModifiedValues": {},
"MemberClusters": [
"mycluster-0001-001",
"mycluster-0001-002",
"mycluster-0001-003",
"mycluster-0002-001",
"mycluster-0002-002",
"mycluster-0002-003",
"mycluster-0003-001",
"mycluster-0003-002",
"mycluster-0003-003"
],
"NodeGroups": [
{
"NodeGroupId": "0001",
"Status": "available",
"Slots": "0-5461",
"NodeGroupMembers": [
{
"CacheClusterId": "mycluster-0001-001",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2b"
},
{
"CacheClusterId": "mycluster-0001-002",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2a"
},
{
"CacheClusterId": "mycluster-0001-003",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2c"
}
]
},
{
"NodeGroupId": "0002",
"Status": "available",
"Slots": "5462-10922",
"NodeGroupMembers": [
{
"CacheClusterId": "mycluster-0002-001",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2a"
},
{
"CacheClusterId": "mycluster-0002-002",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2b"
},
{
"CacheClusterId": "mycluster-0002-003",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2c"
}
]
},
{
"NodeGroupId": "0003",
"Status": "available",
"Slots": "10923-16383",
"NodeGroupMembers": [
{
"CacheClusterId": "mycluster-0003-001",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2c"
},
{
"CacheClusterId": "mycluster-0003-002",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2b"
},
{
"CacheClusterId": "mycluster-0003-003",
"CacheNodeId": "0001",
"PreferredAvailabilityZone": "us-west-2a"
}
]
}
],
"AutomaticFailover": "enabled",
"ConfigurationEndpoint": {
"Address": "mycluster.xxxxih.clustercfg.usw2.cache.amazonaws.com",
"Port": 6379
},
"SnapshotRetentionLimit": 1,
"SnapshotWindow": "13:00-14:00",
"ClusterEnabled": true,
"CacheNodeType": "cache.r5.large",
"TransitEncryptionEnabled": false,
"AtRestEncryptionEnabled": false
}
}
ReplicationGroup -> (structure)
Contains all of the attributes of a specific Redis replication group.
ReplicationGroupId -> (string)
The identifier for the replication group.
Description -> (string)
The user supplied description of the replication group.
GlobalReplicationGroupInfo -> (structure)
The name of the Global Datastore and role of this replication group in the Global Datastore.
GlobalReplicationGroupId -> (string)
The name of the Global Datastore
GlobalReplicationGroupMemberRole -> (string)
The role of the replication group in a Global Datastore. Can be primary or secondary.
Status -> (string)
The current state of this replication group -
creating
,available
,modifying
,deleting
,create-failed
,snapshotting
.PendingModifiedValues -> (structure)
A group of settings to be applied to the replication group, either immediately or during the next maintenance window.
PrimaryClusterId -> (string)
The primary cluster ID that is applied immediately (if
--apply-immediately
was specified), or during the next maintenance window.AutomaticFailoverStatus -> (string)
Indicates the status of automatic failover for this Redis replication group.
Resharding -> (structure)
The status of an online resharding operation.
SlotMigration -> (structure)
Represents the progress of an online resharding operation.
ProgressPercentage -> (double)
The percentage of the slot migration that is complete.
AuthTokenStatus -> (string)
The auth token status
MemberClusters -> (list)
The names of all the cache clusters that are part of this replication group.
(string)
NodeGroups -> (list)
A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, this is a single-element list. For Redis (cluster mode enabled) replication groups, the list contains an entry for each node group (shard).
(structure)
Represents a collection of cache nodes in a replication group. One node in the node group is the read/write primary node. All the other nodes are read-only Replica nodes.
NodeGroupId -> (string)
The identifier for the node group (shard). A Redis (cluster mode disabled) replication group contains only 1 node group; therefore, the node group ID is 0001. A Redis (cluster mode enabled) replication group contains 1 to 90 node groups numbered 0001 to 0090. Optionally, the user can provide the id for a node group.
Status -> (string)
The current state of this replication group -
creating
,available
,modifying
,deleting
.PrimaryEndpoint -> (structure)
The endpoint of the primary node in this node group (shard).
Address -> (string)
The DNS hostname of the cache node.
Port -> (integer)
The port number that the cache engine is listening on.
ReaderEndpoint -> (structure)
The endpoint of the replica nodes in this node group (shard).
Address -> (string)
The DNS hostname of the cache node.
Port -> (integer)
The port number that the cache engine is listening on.
Slots -> (string)
The keyspace for this node group (shard).
NodeGroupMembers -> (list)
A list containing information about individual nodes within the node group (shard).
(structure)
Represents a single node within a node group (shard).
CacheClusterId -> (string)
The ID of the cluster to which the node belongs.
CacheNodeId -> (string)
The ID of the node within its cluster. A node ID is a numeric identifier (0001, 0002, etc.).
ReadEndpoint -> (structure)
The information required for client programs to connect to a node for read operations. The read endpoint is only applicable on Redis (cluster mode disabled) clusters.
Address -> (string)
The DNS hostname of the cache node.
Port -> (integer)
The port number that the cache engine is listening on.
PreferredAvailabilityZone -> (string)
The name of the Availability Zone in which the node is located.
CurrentRole -> (string)
The role that is currently assigned to the node -
primary
orreplica
. This member is only applicable for Redis (cluster mode disabled) replication groups.SnapshottingClusterId -> (string)
The cluster ID that is used as the daily snapshot source for the replication group.
AutomaticFailover -> (string)
Indicates the status of automatic failover for this Redis replication group.
MultiAZ -> (string)
A flag indicating if you have Multi-AZ enabled to enhance fault tolerance. For more information, see Minimizing Downtime: Multi-AZ
ConfigurationEndpoint -> (structure)
The configuration endpoint for this replication group. Use the configuration endpoint to connect to this replication group.
Address -> (string)
The DNS hostname of the cache node.
Port -> (integer)
The port number that the cache engine is listening on.
SnapshotRetentionLimit -> (integer)
The number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For example, if you set
SnapshotRetentionLimit
to 5, a snapshot that was taken today is retained for 5 days before being deleted.Warning
If the value of
SnapshotRetentionLimit
is set to zero (0), backups are turned off.SnapshotWindow -> (string)
The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your node group (shard).
Example:
05:00-09:00
If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range.
Note
This parameter is only valid if the
Engine
parameter isredis
.ClusterEnabled -> (boolean)
A flag indicating whether or not this replication group is cluster enabled; i.e., whether its data can be partitioned across multiple shards (API/CLI: node groups).
Valid values:
true
|false
CacheNodeType -> (string)
The name of the compute and memory capacity node type for each node in the replication group.
AuthTokenEnabled -> (boolean)
A flag that enables using an
AuthToken
(password) when issuing Redis commands.Default:
false
AuthTokenLastModifiedDate -> (timestamp)
The date the auth token was last modified
TransitEncryptionEnabled -> (boolean)
A flag that enables in-transit encryption when set to
true
.You cannot modify the value of
TransitEncryptionEnabled
after the cluster is created. To enable in-transit encryption on a cluster you must setTransitEncryptionEnabled
totrue
when you create a cluster.Required: Only available when creating a replication group in an Amazon VPC using redis version
3.2.6
,4.x
or later.Default:
false
AtRestEncryptionEnabled -> (boolean)
A flag that enables encryption at-rest when set to
true
.You cannot modify the value of
AtRestEncryptionEnabled
after the cluster is created. To enable encryption at-rest on a cluster you must setAtRestEncryptionEnabled
totrue
when you create a cluster.Required: Only available when creating a replication group in an Amazon VPC using redis version
3.2.6
,4.x
or later.Default:
false
KmsKeyId -> (string)
The ID of the KMS key used to encrypt the disk in the cluster.
ARN -> (string)
The ARN (Amazon Resource Name) of the replication group.