首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CloudFormation中的Redis多可用区功能

CloudFormation中的Redis多可用区功能
EN

Stack Overflow用户
提问于 2016-07-28 01:20:38
回答 1查看 3.8K关注 0票数 3

我正在设计一个包含Redis服务的模板,我想在Redis中启用多可用区功能,以便在主群集故障时,可以将读取副本提升为主群集。我在CloudFormation文档中找过了,但是我找不到这个特性,即多可用区。支持RDS服务,不支持Redis。我能知道如何包含redis的功能吗?这样的AWS负责自动故障转移吗?

来源:http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticache-cache-cluster.html

可用于弹性缓存的属性列表如下所示。

代码语言:javascript
复制
"AutoMinorVersionUpgrade"    : Boolean,
"AZMode"                     : String,
"CacheNodeType"              : String,
"CacheParameterGroupName"    : String,
"CacheSecurityGroupNames"    : [ String, ... ],
"CacheSubnetGroupName"       : String,
"ClusterName"                : String,
"Engine"                     : String,
"EngineVersion"              : String,
"NotificationTopicArn"       : String,
"Port"                       : Integer,
"PreferredAvailabilityZone"  : String,
"PreferredAvailabilityZones" : [String, ... ],
"PreferredMaintenanceWindow" : String,
"SnapshotArns"               : [String, ... ],
"SnapshotName"               : String,
"SnapshotRetentionLimit"     : Integer,
"SnapshotWindow"             : String,
"Tags"                       : [Resource Tag, ...],
"VpcSecurityGroupIds"        : [String, ...]
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-07-28 01:32:14

您可以通过以下两种方式将Redis设置为以编程方式使用Multi Az。

使用CLI

代码语言:javascript
复制
aws elasticache modify-replication-group \
    --replication-group-id myReplGroup \
    --automatic-failover-enabled 

使用Elasticache API

代码语言:javascript
复制
https://elasticache.us-west-2.amazonaws.com/
    ?Action=ModifyReplicationGroup
    &AutoFailover=true
    &ReplicationGroupId=myReplGroup
    &Version=2015-02-02
    &SignatureVersion=4
    &SignatureMethod=HmacSHA256
    &Timestamp=20140401T192317Z
    &X-Amz-Credential=<credential>

这是您在为redis选择Multi Az时应该阅读的一些注释。

http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoFailover.html#AutoFailover.Notes

以下是云形成的属性:

代码语言:javascript
复制
{
  "Type" : "AWS::ElastiCache::ReplicationGroup",
  "Properties" : {
    "AutomaticFailoverEnabled" : Boolean,
    "AutoMinorVersionUpgrade" : Boolean,
    "CacheNodeType" : String,
    "CacheParameterGroupName" : String,
    "CacheSecurityGroupNames" : [ String, ... ],
    "CacheSubnetGroupName" : String,
    "Engine" : String,
    "EngineVersion" : String,
    "NotificationTopicArn" : String,
    "NumCacheClusters" : Integer,
    "Port" : Integer,
    "PreferredCacheClusterAZs" : [ String, ... ],
    "PreferredMaintenanceWindow" : String,
    "ReplicationGroupDescription" : String,
    "SecurityGroupIds" : [ String, ... ],
    "SnapshotArns" : [ String, ... ],
    "SnapshotRetentionLimit" : Integer,
    "SnapshotWindow" : String
  }
}

您必须为多区域调整此属性

AutomaticFailoverEnabled

指示是否启用多可用区。启用多可用区后,如果现有主群集出现故障,只读复制副本将自动升级为读写主群集。如果指定true,则必须为NumCacheNodes属性指定一个大于1的值。默认情况下,亚马逊网络服务CloudFormation将该值设置为true。

有关多可用区的更多信息,请参阅亚马逊ElastiCache用户指南中的Multi-AZ with Redis Replication Groups

注意,2.8.6之前的Redis版本或T1和T2缓存节点类型无法开启自动故障转移功能。是否必填:否

类型: Boolean

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticache-replicationgroup.html

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38619473

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档