Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 应用程序引擎中的谷歌云内存存储(Redis)ETIMEDOUT_Google App Engine_Google Cloud Platform_Redis - Fatal编程技术网

Google app engine 应用程序引擎中的谷歌云内存存储(Redis)ETIMEDOUT

Google app engine 应用程序引擎中的谷歌云内存存储(Redis)ETIMEDOUT,google-app-engine,google-cloud-platform,redis,Google App Engine,Google Cloud Platform,Redis,我正在编写一个NodeJS应用程序,并试图连接到GCPs Redis MemoryStore,但我收到了ETIMEDOUT 10.47.29.131:6379错误消息。10.47.29.131对应于REDISHOST。我正试图通过服务器的内部专用IP连接到服务器 虽然该应用程序在安装了本地Redis的情况下在本地工作,但在部署到GCP AppEngine时却无法工作 我的GCP设置 在位置europe-west3-a运行的Redis实例 在europe-west3的“无服务器VPC访问”下创建

我正在编写一个NodeJS应用程序,并试图连接到GCPs Redis MemoryStore,但我收到了
ETIMEDOUT 10.47.29.131:6379
错误消息。
10.47.29.131
对应于
REDISHOST
。我正试图通过服务器的内部专用IP连接到服务器

虽然该应用程序在安装了本地Redis的情况下在本地工作,但在部署到GCP AppEngine时却无法工作

我的GCP设置

  • 在位置europe-west3-a运行的Redis实例
  • 在europe-west3的“无服务器VPC访问”下创建了一个连接器
  • Redis和VPC连接器位于同一网络“默认”上
  • 应用程序引擎在欧洲西部运行
Redis iNtance:

VPC连接器:

app.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

我按照以下说明进行设置:

深入挖掘,我发现:他们提到了一些关于权限和
无服务器vpc访问映像的内容,而在尝试按照说明操作时:我在任何地方都找不到“定义可信映像项目”

我遗漏了什么?

事实证明,问题在于我为Redis实例选择的区域。 发件人:

重要:要连接到Redis实例的Memorystore,连接客户端必须位于与实例相同的区域内

区域是您可以运行资源的特定地理位置。每个区域被细分为几个区域

例如,美国中部的us-central1区域有us-central1-a、us-central1-b、us-central1-c和us-central1-f区

尽管文档中明确指出,AppEngine和Memorystore必须位于同一个区域,但我对实际区域的假设是错误的

当我创建AppEngine时,我在
europe-west
中创建了它,它与
europe-west1
相同。另一方面,当我创建redis实例时,我使用了
europe-west3
,假设
west3
west
是同一个区域,而不是

由于AppEngines区域无法更改,我在
europe-west1
中创建了另一个redis实例,现在一切正常


因此,redis区域必须与AppEngine区域完全相同
region1
region
相同,但
region2
region3
region

不相同,请确保将“Compute Engine VM”的权限添加到用于部署应用程序的服务帐户中。我正在部署的帐户,获得业主对整个项目的许可。这还不够吗?这是一个IP地址问题,而不是IAM问题-所有者不帮助解决IP地址问题。更多关于地址的详细信息(私人、公共、同一VPC等)。@ad_on_认为这还不够。我使用的帐户也是所有者,但我必须在那里添加计算引擎特权…@yedpodtrzitko我在所有者服务帐户和appengine服务帐户中都添加了“Compute Admin”,这没有任何效果。创建redis实例时没有region
europe-west1
,存在region europe-west1。是的,你是对的,对于应用程序引擎来说,欧洲西部是对的