我正在编写一个 NodeJS 应用程序并尝试连接到 GCP Redis MemoryStore,但我收到了ETIMEDOUT 10.47.29.131:6379错误消息。10.47.29.131对应REDISHOST于。我正在尝试通过其内部私有 IP 访问服务器。
虽然该应用在安装了本地 Redis 的情况下可以在本地工作,但在部署到 GCP AppEngine 时却不能。
我的 GCP 设置
- 在位置 europe-west3-a 运行的 Redis 实例
- 在 europe-west3 的“Serverless VPC access”下创建了一个连接器
- Redis 和 VPC 连接器位于同一网络“默认”上。
- 在欧洲西部运行的 App Engine
应用程序.yml
runtime: nodejs
env: flex
automatic_scaling:
// or this but without env: flex (standard)
vpc_access_connector:
name: "projects/project-ID/locations/europe-west/connectors/connector-name"
beta_settings:
cloud_sql_instances: project-ID:europe-west3:name
env_variables:
REDISHOST: '10.47.29.131'
REDISPORT: '6379'
// removed this when trying without env: flex (standard)
network:
name: default
session_affinity: true
我按照这些说明设置了所有内容:https ://cloud.google.com/memorystore/docs/redis/connect-redis-instance-standard
深入挖掘,我发现:https ://cloud.google.com/vpc/docs/configure-serverless-vpc-access他们提到了一些关于权限和的内容serverless-vpc-access-images,并在尝试遵循说明时:https ://cloud.google .com/compute/docs/images/restricting-image-access#trusted_images我找不到“定义受信任的图像项目”。任何地方
我在这里想念什么?

