首页 > 解决方案 > 如何获取 AWS ElastiCache 的 Reader Endpoint?

问题描述

我正在部署一个 AWS ElastiCache 复制组,根据这篇文章,它应该公开 Reader Endpoint。它确实如此,但仅在 UI 中意味着我既不能通过CLI也不能通过Boto3检索此端点。我正在使用 Cloud Formation 部署复制组。这是与缓存相关的部分:

elastiCache:
  Type: AWS::ElastiCache::ReplicationGroup
  Properties:
    AutoMinorVersionUpgrade: false
    AutomaticFailoverEnabled: true
    AtRestEncryptionEnabled: true
    TransitEncryptionEnabled: true
    SnapshotRetentionLimit: 0
    AuthToken: password123
    CacheNodeType: cache.m4.large
    NumCacheClusters: 2
    CacheSubnetGroupName: !Ref subnetGroup
    ReplicationGroupId: Test
    ReplicationGroupDescription: My ElastiCache
    Engine: redis
    EngineVersion: 5.0.4
    CacheParameterGroupName: default.redis5.0
    Port: 6379
    SecurityGroupIds:
      - !Ref securityGroup

我尝试了很多部署方式,但都没有运气。我开始认为除了 UI 之外它不会暴露在任何地方。有没有其他人有检索这件作品的经验?

标签: amazon-web-servicesamazon-elasticache

解决方案


这个答案有一个从主端点构建读取器端点的解决方法。


推荐阅读