本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
查找分片的 ID
您可以使用 AWS 管理控制台、AWS CLI 或 ElastiCache API 查找分片 ID。
使用 AWS 管理控制台
对于 Redis(已禁用集群模式)
Redis (已禁用集群模式) 复制组分片 IDs 始终为 0001
。
对于 Redis(已启用集群模式)
以下过程使用 AWS 管理控制台 查找 Redis (已启用集群模式)复制组的分片 ID。
在 Redis (已启用集群模式) 复制组中查找分片 ID
-
登录 AWS 管理控制台并通过以下网址打开 ElastiCache 控制台:https://console.amazonaws.cn/elasticache/
。 -
在导航窗格上,选择 Redis,然后选择要为其查找分片 Redis (已启用集群模式) 的 IDs 复制组的名称。
-
在 Shard Name (分片名称) 列中,分片 ID 是分片名称的最后四位数字。
使用 AWS CLI
要为 Redis (已禁用集群模式)或 Redis (已启用集群模式)复制组查找分片(节点组)ID,请使用具有以下可选参数的 AWS CLI 操作 describe-replication-groups
。
-
--replication-group-id
—用来将输出限制为指定复制组的详细信息的可选参数。如果忽略此参数,将返回最多 100 个复制组的详细信息。
此命令将返回 sample-repl-group
的详细信息。
对于 Linux, OS X, or Unix:
aws elasticache describe-replication-groups \ --replication-group-id
sample-repl-group
对于 Windows:
aws elasticache describe-replication-groups ^ --replication-group-id
sample-repl-group
该命令的输出类似于此处所示。分片(节点组)ID 为 highlighted
以便更轻松地找到它们。
{
"ReplicationGroups": [
{
"Status": "available",
"Description": "2 shards, 2 nodes (1 + 1 replica)",
"NodeGroups": [
{
"Status": "available",
"Slots": "0-8191",
"NodeGroupId": "0001
",
"NodeGroupMembers": [
{
"PreferredAvailabilityZone": "us-west-2c",
"CacheNodeId": "0001",
"CacheClusterId": "sample-repl-group-0001-001"
},
{
"PreferredAvailabilityZone": "us-west-2a",
"CacheNodeId": "0001",
"CacheClusterId": "sample-repl-group-0001-002"
}
]
},
{
"Status": "available",
"Slots": "8192-16383",
"NodeGroupId": "0002
",
"NodeGroupMembers": [
{
"PreferredAvailabilityZone": "us-west-2b",
"CacheNodeId": "0001",
"CacheClusterId": "sample-repl-group-0002-001"
},
{
"PreferredAvailabilityZone": "us-west-2a",
"CacheNodeId": "0001",
"CacheClusterId": "sample-repl-group-0002-002"
}
]
}
],
"ConfigurationEndpoint": {
"Port": 6379,
"Address": "sample-repl-group.9dcv5r.clustercfg.usw2.cache.amazonaws.com"
},
"ClusterEnabled": true,
"ReplicationGroupId": "sample-repl-group",
"SnapshotRetentionLimit": 1,
"AutomaticFailover": "enabled",
"SnapshotWindow": "13:00-14:00",
"MemberClusters": [
"sample-repl-group-0001-001",
"sample-repl-group-0001-002",
"sample-repl-group-0002-001",
"sample-repl-group-0002-002"
],
"CacheNodeType": "cache.m3.medium",
"PendingModifiedValues": {}
}
]
}
使用 ElastiCache API
要为 Redis (已禁用集群模式)或 Redis (已启用集群模式)复制组查找分片(节点组)ID,请使用具有以下可选参数的 AWS CLI 操作 describe-replication-groups
。
-
ReplicationGroupId
—用来将输出限制为指定复制组的详细信息的可选参数。如果忽略此参数,则最多为xxx
将返回复制组。
此命令将返回 sample-repl-group
的详细信息。
对于 Linux, OS X, or Unix:
https://elasticache.us-west-2.amazonaws.com/ ?Action=DescribeReplicationGroup &ReplicationGroupId=sample-repl-group &Version=2015-02-02 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20150202T192317Z &X-Amz-Credential=<credential>