我正在设计一个包含Redis服务的模板,我想在Redis中启用多可用区功能,以便在主群集故障时,可以将读取副本提升为主群集。我在CloudFormation文档中找过了,但是我找不到这个特性,即多可用区。支持RDS服务,不支持Redis。我能知道如何包含redis的功能吗?这样的AWS负责自动故障转移吗?
来源:http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticache-cache-cluster.html
可用于弹性缓存的属性列表如下所示。
"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, ...]发布于 2016-07-28 01:32:14
您可以通过以下两种方式将Redis设置为以编程方式使用Multi Az。
使用CLI
aws elasticache modify-replication-group \
--replication-group-id myReplGroup \
--automatic-failover-enabled 使用Elasticache API
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
以下是云形成的属性:
{
"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
https://stackoverflow.com/questions/38619473
复制相似问题