amazon-web-services - 我无法将 Elasticache 连接到 Elastic Beanstalk(在 VPC 中)

标签 amazon-web-services redis socket.io amazon-elastic-beanstalk amazon-elasticache

我有一个 VPC,在不同的可用区中有 2 个公有子网(公有子网 2a 和公有子网 2b)。我有两个私有(private)子网(private-2a-EB-Instance、private-2b-EB-Instance)和另外两个 Elasticache 私有(private)子网(private-2a-EB-Instance、private-2b-EB-Instance),这两个elasticache 的子网是我在创建 Elasticache 集群时使用的子网组的一部分。

我已经为我的 ElastiCache(redis) 创建了一个安全组,并且更改了它的入站规则,以便它可以接受来 self 的 ElasticBeanstalk 环境的安全组的连接。没有解决问题。

我已按照 AWS 网站上的说明进行操作,但无法使其正常工作。我想知道我做错了什么。我正在使用socket-io-redis我想知道这是否是问题的一部分。

我已经使用了提供的.config文件here ,但我在部署应用程序时遇到错误。它说创建它时出错。

我从控制台创建了集群,并尝试使用“主要端点”将其连接到我的 EB 应用程序,但收到错误:

Error: Redis connection to https://myelasticache.xxxxxxxxx.cache.amazonaws.com:6379 failed - getaddrinfo ENOTFOUND https://myelasticache.xxxxxxxxx.cache.amazonaws.com 

我做错了什么?我错过了什么?

最佳答案

我认为问题在于您在应该是主机名的内容中包含了 https:// 。 Redis 不通过 HTTP 连接,它使用自己的协议(protocol)。错误消息 getaddrinfo ENOTFOUND https://myelasticache.xxxxxxxxx.cache.amazonaws.com 表示它正在尝试解析 https://myelasticache.xxxxxxxxx.cache.amazonaws.com code> 当您希望它使用 myelasticache.xxxxxxxxx.cache.amazonaws.com 时。

因此,请尝试删除 https:// 并查看它是否有效,或者是否会收到其他错误。

关于amazon-web-services - 我无法将 Elasticache 连接到 Elastic Beanstalk(在 VPC 中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62294144/

相关文章:

python - celery 任务在 Django 框架中不起作用

.net - 如何利用Redis缓存实现自动刷新

java - 订阅 key 空间通知中的更改

node.js - Sails 套接字请求日志未定义

amazon-web-services - Cloudformation属性验证失败: Encountered unsupported properties

laravel - 在 AWS S3 上获取文件,而无需使用 Laravel 公开存储桶

node.js - socket.io/1/?t=1437482662157 404 未找到

javascript - 当 Socket.io 事件发出时保存到 MongoDB

amazon-web-services - 通过 Cloudformation 在 AWS Config 中配置所有 AWS 托管规则

amazon-web-services - Terraform - 多个 AWS 代码构建项目需要 aws_codebuild_source_credential