【问题标题】:AppEngine standard and Memorystore connection issueAppEngine 标准和 Memorystore 连接问题
【发布时间】:2019-10-16 13:19:07
【问题描述】:

我有 Memorystore 实例:

gcloud redis instances list --region europe-west1
INSTANCE_NAME      VERSION    REGION        TIER   SIZE_GB  HOST      PORT  NETWORK  RESERVED_IP  STATUS  CREATE_TIME
sm-cache  REDIS_4_0  europe-west1  BASIC  1        10.1.1.3  6379  default  10.1.1.0/28  READY   2019-05-30T19:03:29

与运行在同一区域的 App Engine 标准应用程序。

连接需要 VPC。我尝试添加它而不缺少。这种连接的 CIDR 应该是什么?与 Memorystore 相同不起作用:

gcloud beta compute networks vpc-access connectors describe sm-01-vpc --region europe-west1 
ipCidrRange: 10.1.1.0/28
maxThroughput: 1000
minThroughput: 200
name: projects/salesmanago-data-01/locations/europe-west1/connectors/sm-01-vpc
network: default
state: ERROR

我应该在 Spring Boot 配置中使用什么 IP?有什么建议?这在文档和教程中没有明确描述。

到目前为止,我在应用程序中遇到错误:

Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 10.1.1.3:6379

【问题讨论】:

    标签: spring-boot redis google-cloud-platform google-cloud-memorystore


    【解决方案1】:

    这种连接的 CIDR 应该是多少?与 Memorystore 相同不起作用:

    使用您的 VPC 网络中不存在的 ip 范围,并且与使用的一个 memorystore 不同。

    我应该在 Spring Boot 配置中使用什么 IP

    gcloud redis instances list --region europe-west1中显示的IP

    BTW Serverless 似乎目前仅适用于 us-central1,不确定它是否适用于 europe-west1

    【讨论】:

    • 我们也试过这个。我询问了 Google 支持,这是否在 europe-west1 中可用。您可以在那里创建 VCP - 但只能使用 gcloud 命令行工具。
    • @Konrad 我明白了,不过,您应该选择不同的 IP 范围。
    • 是的,你是对的。正如 Google 支持所证实的那样,在欧洲西部 1 中没有完全支持无服务器 VPC,尤其是在 Peering 方面。解决方案是使用弹性环境。
    猜你喜欢
    • 1970-01-01
    • 2015-11-08
    • 2020-01-15
    • 2018-08-22
    • 1970-01-01
    • 1970-01-01
    • 2018-06-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多