Amazon ElastiCache
用户指南 (API 版本 2015-02-02)
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 Amazon AWS 入门

查找节点终端节点和端口号

要连接到某个缓存节点,您的应用程序需要知道该节点的终端节点和端口号。

(控制台) 查找节点终端节点和端口号

确定节点终端节点和端口号

  1. 登录 Amazon ElastiCache 管理控制台并选择 MemcachedRedis

    此时会显示运行所选引擎的所有群集的列表。

  2. 对您运行的引擎和配置继续下面的操作。

Memcached

  1. 选择所需群集的名称。

  2. 找到所需节点的 PortEndpoint 列。

Redis:非群集模式

  1. 选择所需群集的名称。

  2. 找到所需节点的 PortEndpoint 列。

Redis:群集模式

  1. 选择所需群集的名称。

    此时显示该群集中所有分片的列表。

  2. 选择所需分片的名称。

    此时显示该分片中所有节点的列表

  3. 找到所需节点的 PortEndpoint 列。

(AWS CLI) 查找缓存节点终端节点和端口号

要确定缓存节点终端节点和端口号,请使用带 --show-cache-node-info 参数的命令 describe-cache-clusters

aws elasticache describe-cache-clusters --show-cache-node-info

此命令应该生成类似于下述信息的输出:

{ "CacheClusters": [ { "Engine": "redis", "CacheNodes": [ { "CacheNodeId": "0001", "Endpoint": { "Port": 6379, "Address": "redis0x1.7adw3s.0001.usw2.cache.amazonaws.com" }, "CacheNodeStatus": "available", "ParameterGroupStatus": "in-sync", "CacheNodeCreateTime": "2017-04-05T20:45:28.907Z", "CustomerAvailabilityZone": "us-west-2b" } ], "CacheParameterGroup": { "CacheNodeIdsToReboot": [], "CacheParameterGroupName": "default.redis3.2", "ParameterApplyStatus": "in-sync" }, "SnapshotRetentionLimit": 1, "CacheClusterId": "redis0x1", "CacheSecurityGroups": [], "NumCacheNodes": 1, "SnapshotWindow": "00:00-01:00", "CacheClusterCreateTime": "2017-04-05T20:45:28.907Z", "AutoMinorVersionUpgrade": true, "CacheClusterStatus": "available", "PreferredAvailabilityZone": "us-west-2b", "ClientDownloadLandingPage": "https://console.aws.amazon.com/elasticache/home#client-download:", "CacheSubnetGroupName": "default", "EngineVersion": "3.2.4", "PendingModifiedValues": {}, "PreferredMaintenanceWindow": "sun:06:00-sun:07:00", "CacheNodeType": "cache.m3.medium" }, ******* some output omitted for brevity ******* { "Engine": "memcached", "CacheNodes": [ { "CacheNodeId": "0001", "Endpoint": { "Port": 11211, "Address": "mem03.5edv7s.0001.usw2.cache.amazonaws.com" }, "CacheNodeStatus": "available", "ParameterGroupStatus": "in-sync", "CacheNodeCreateTime": "2017-04-25T19:24:38.977Z", "CustomerAvailabilityZone": "us-west-2a" } ], "CacheParameterGroup": { "CacheNodeIdsToReboot": [], "CacheParameterGroupName": "default.memcached1.4", "ParameterApplyStatus": "in-sync" }, "CacheClusterId": "mem03", "PreferredAvailabilityZone": "us-west-2a", "ConfigurationEndpoint": { "Port": 11211, "Address": "mem03.9dcv5r.cfg.usw2.cache.amazonaws.com" }, "CacheSecurityGroups": [], "CacheClusterCreateTime": "2017-04-25T19:24:38.977Z", "AutoMinorVersionUpgrade": true, "CacheClusterStatus": "available", "NumCacheNodes": 1, "ClientDownloadLandingPage": "https://console.aws.amazon.com/elasticache/home#client-download:", "SecurityGroups": [ { "Status": "active", "SecurityGroupId": "sg-dbe93fa2" } ], "CacheSubnetGroupName": "default", "EngineVersion": "1.4.34", "PendingModifiedValues": {}, "PreferredMaintenanceWindow": "thu:10:30-thu:11:30", "CacheNodeType": "cache.t2.micro" }, ] }

完全限定的 DNS 名称和端口号处于输出的终端节点部分。

(ElastiCache API) 查找缓存节点终端节点和端口号

要确定缓存节点终端节点和端口号,请使用带 ShowCacheNodeInfo=true 参数的操作 DescribeCacheClusters

https://elasticache.us-west-2.amazonaws.com / ?Action=DescribeCacheClusters &ShowCacheNodeInfo=true &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20140421T220302Z &Version=2014-09-30 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=<credential> &X-Amz-Date=20140421T220302Z &X-Amz-Expires=20140421T220302Z &X-Amz-Signature=<signature> &X-Amz-SignedHeaders=Host