amazon-web-services - AWS Elasticache Redis,当我的 Redis(已禁用集群模式)只有 1 个节点并且失败时会发生什么

标签 amazon-web-services redis failover amazon-elasticache

我已阅读有关 AWS Elasticache Redis 的自动故障转移功能的信息。文档告诉我,故障转移过程需要我至少有 1 个副本节点(即至少 2 个节点),以便它可以使用副本节点来替换发生故障的主节点。

但是我无法找到有关如果我只有 1 个节点并且失败时会发生什么情况的详细信息。它是自动重新创建还是需要手动过程来删除并重新创建它?

我打算使用以下 CloudFormation 模板在我的测试环境中创建一个仅包含 1 个节点的 Redis 组(已禁用集群模式)。

    "ReplicationGroup": {
        "Type": "AWS::ElastiCache::ReplicationGroup",
        "Properties": {
            "ReplicationGroupId" : "my-redis",
            "ReplicationGroupDescription" : "My Redis",
            "NumCacheClusters": 1,
            "AutomaticFailoverEnabled": false,
            "CacheNodeType": "cache.t3.medium",
            "CacheParameterGroupName" : "default.redis5.0",
            "Engine": "redis",
            "EngineVersion" : "5.0.6",
            "Port": "6379",
            "AtRestEncryptionEnabled" : true,
            "TransitEncryptionEnabled" : true,
            "AuthToken" : {"Ref": "AuthToken"},
            "CacheSubnetGroupName": {"Ref": "SubnetGroup"},
            "SecurityGroupIds": [
                {"Ref": "RedisSecurityGroup"}
            ],
            "SnapshotRetentionLimit": 0,
            "MultiAZEnabled" : {"Fn::If": ["ConditionMultiAZEnabled", true, false]}
        }
    },

最佳答案

我们之前遇到过这个问题。当 AWS 尝试安装重要的安全更新时,我们丢失了所有数据(服务更新 SLA 不满足)。这是一个单节点 Elasticache 实例。以下是包含 AWS Support 的所有详细信息的回复;

As you said, I found there were event messages on the cluster and BytesUsedForCache was dropped to 0. When I investigated the redis node, I was able to see that health check from ElastiCache service was failed since hardware failure and the node ***** was replaced to healthy new node to recover the redis service. Due to the redis cluster ***** has only single node *****, data loss can happen whenever the node is failed like this case.

To improve high availability to the redis cluster and keep your data in node failure case, you should make a replication group by adding at least a replica node to the cluster. Please read this link to understand replication group in detail. https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Replication.html

Replica node can be used for only read request, but data is always replicated from primary node to replica node. Also replica node can be promoted to new primary when primary is failed, and then you can protect your data. This link provides how to add replica node . https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Replication.AddReadReplica.html

Furthermore, you can also enable Multi-az with auto failover feature with replication group. It can failover primary node automatically when the primary node is failed. It can also jazz up High Aavailability of your redis cluster. https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/AutoFailover.html

关于amazon-web-services - AWS Elasticache Redis,当我的 Redis(已禁用集群模式)只有 1 个节点并且失败时会发生什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63048162/

相关文章:

linux - Logstash高可用部署

java - Apache 、汤姆猫 : Loadbalancing and failover configuration showing blank page.

amazon-web-services - AWS 为 ECS Auto Scaling 组中启动的实例创建标签

python - EC2 自动缩放 Python 脚本

android - 从 AWS Lambda Node.js 向 Android 手机发送 AWS SNS 通知

python - 如何使用 Celery 和 Flask 实现缓存系统

mongodb - 蒙戈 : How to automatically connect to secondary in case of primary failure

amazon-web-services - 您如何衡量 EC2 实例的能耗?

Redisson 将 ArrayList 或 RList 放入 RMap 中。会发生什么?

ruby-on-rails - 在 heroku 上运行和配置 rhoconnect 作为实例