为专用互连建立 99.9% 可用性配置

99.9% 可用性的拓扑适用于可承受一些停机时间的非关键应用。例如,您的组织可能会执行批量上传,而且运行该任务的具体时间并不重要。如果连接不可用,操作会在连接恢复时继续。

如需了解本页面中使用的 Cloud Interconnect 术语,请参阅关键术语

如需了解如何在故障切换场景中创建具有足够容量的冗余 Cloud Interconnect 连接,请参阅最佳实践

使用要求

为实现 99.9% 的可用性,需要以下资源和设置:

  • 至少两个 Cloud Interconnect 连接。连接必须位于同一个都市区域(都市圈),但位于不同的边缘可用性网域(都市圈可用区)。连接位于同一网点还是不同网点无关紧要,只要它们位于两个不同的边缘可用性网域即可。

  • 至少一个 Cloud Router 路由器。每个 Cloud Interconnect 连接必须连接到 Cloud Router 路由器。

示例拓扑

以下示例拓扑显示了位于同一都市圈但位于不同对接网点的两个 Cloud Interconnect 连接:lga-zone1-16lga-zone2-1422。Cloud Router 路由器位于 us-central1 区域的 vpc1 网络中。

可实现 99.9% 可用性的冗余互连(点击可放大)
可实现 99.9% 可用性的冗余连接(点击可放大)

创建 99.9% 拓扑

以下几个部分介绍创建此拓扑的步骤。要量身定制自己的拓扑,请将示例输入值替换成您的资源的相应值。例如,将 vpc1 网络名称替换成您的 VPC 网络名称。

订购 Cloud Interconnect 连接

您可以使用 Google Cloud 控制台或 Google Cloud CLI 订购重复的连接。

控制台

  1. 在 Google Cloud 控制台中,转到互连混合连接页面。

    前往“互连混合连接”

  2. 点击开始使用

  3. 选择专用互连,然后点击继续

  4. 选择订购新的专用互连,然后点击继续

  5. 指定 Cloud Interconnect 连接的详细信息:

    • 名称:输入 int-lga1
    • 说明:输入 Example Cloud Interconnect connection in LGA ZONE1
    • 位置:选择 Digital Realty | Telx New York (111 8th Ave),这是 lga-zone1-16 位置的 PeeringDB 名称。
    • 容量:使用默认容量 (10 Gb/s)。
  6. 点击下一步

  7. 指定冗余 Cloud Interconnect 连接的详细信息:

    • 名称:输入 int-lga2
    • 说明:输入 Example Cloud Interconnect connection in LGA ZONE2
    • 位置:选择 zColo New York - 60 Hudson St,这是 lga-zone2-1422 位置的 PeeringDB 名称。
    • 容量:使用默认容量 (10 Gb/s)。
  8. 点击下一步

  9. 指定您的联系信息:

    • 公司名称:输入 The Customer。此名称在 LOA-CFA 中用作有权请求 Cloud Interconnect 连接的一方。
    • 技术联系人:输入 customer@customer.com。您不需要输入自己的地址;所有通知中都会包含您。
  10. 点击下一步

  11. 查看您的订单。检查您的 Cloud Interconnect 连接详细信息和联系信息是否正确。如果所有信息均正确,点击下订单。如果信息有误,请返回并修改连接详细信息。

  12. 在订单确认页面,查看后续步骤,然后点击完成

gcloud

  • 订购两个名称分别为 int-lga1int-lga2 的 Cloud Interconnect 连接:

    gcloud compute interconnects create int-lga1 \
      --customer-name "The Customer" \
      --description "Example Cloud Interconnect connection in LGA ZONE1" \
      --interconnect-type DEDICATED \
      --link-type ETHERNET_10G_LR \
      --location lga-zone1-16 \
      --requested-link-count 1 \
      --noc-contact-email customer@customer.com
    gcloud compute interconnects create int-lga2 \
      --customer-name "The Customer" \
      --description "Example Cloud Interconnect connection in LGA ZONE2" \
      --interconnect-type DEDICATED \
      --link-type ETHERNET_10G_LR \
      --location lga-zone2-1422 \
      --requested-link-count 1 \
      --noc-contact-email customer@customer.com

订购 Cloud Interconnect 连接后,Google 会通过电子邮件向您发送确认,并为您分配端口。分配完成后,Google 会针对您的连接生成 LOA-CFA,并将其通过电子邮件发送给您。所有自动发送的电子邮件将发送给 NOC 联系人和连接订购人员。

只有在预配并测试连接后,您才可以使用 Cloud Interconnect 连接。如需详细了解预配过程,请参阅预配概览

创建 Cloud Router 路由器

要创建 Cloud Router 路由器,请按照本部分中的说明操作。

控制台

  1. 在 Google Cloud 控制台中,转到创建 Cloud Router 路由器页面。

    前往“创建 Cloud Router 路由器”

  2. 指定 Cloud Router 路由器详细信息:

    • 名称:输入 router1 作为 Cloud Router 路由器的名称。
    • 网络:选择 vpc1,这是本地网络扩展到的目标网络的名称。
    • 区域:指定 us-central1,这是 Cloud Router 路由器通告所有子网的区域,如示例拓扑所示。
    • Google ASN:输入 64513,这是示例 Cloud Router 路由器的 ASN。
  3. 路由下,选择通告向 Cloud Router 公开的所有子网(默认),然后点击创建

gcloud

  • us-central1 区域的 vpc1 网络中创建 Cloud Router 路由器;使用 ASN 64513

    gcloud compute routers create router1 \
      --asn 64513 \
      --network vpc1 \
      --region us-central1

创建 VLAN 连接

Cloud Interconnect 连接可供使用(处于 ACTIVE 状态)后,创建 VLAN 连接,以便将该连接与 Cloud Router 路由器连接。创建重复的连接,每个连接一个。在此示例中,int-lga1int-lga2 连接到 router1

控制台

  1. 在 Google Cloud 控制台中,进入 VLAN 连接标签页。

    转到 VLAN 连接

  2. 点击添加 VLAN 连接

  3. 选择专用互连,然后点击继续

  4. 选择在此项目中

  5. 选择 int-lga1 Cloud Interconnect 连接,然后点击继续

  6. 选择添加 VLAN 连接

    • 名称:输入 attachment-lga1-central1
    • 路由器:选择 router1 Cloud Router 路由器。
  7. 点击创建。创建连接需要一点时间。

  8. 对于连接,如需将 BGP 会话添加到 router1,请点击配置。VLAN 连接已填充 Google 和对等 BGP IP 地址。

  9. 记录每个连接的 IP 地址、ASN 和 VLAN 标记。配置本地路由器需要此信息。

  10. 如需添加 BGP 会话,请点击保存配置。在您在本地路由器上配置 BGP 之前,BGP 会话处于非活动状态。

  11. int-lga2 连接创建另一个名为 attachment-lga2-central1 的连接。使用 router1 作为该连接的 Cloud Router 路由器。

gcloud

  1. 创建两个连接,一个用于 int-lga1 Cloud Interconnect 连接和 router1 Cloud Router,另一个用于 int-lga2 连接和 router1

    gcloud compute interconnects attachments create attachment-lga1-central1 \
       --interconnect int-lga1 \
       --router router1
    gcloud compute interconnects attachments create attachment-lga2-central1 \
       --interconnect int-lga2 \
       --router router1
  2. 描述 attachment-lga1-central1 连接以检索它分配的资源,如 VLAN ID 和 BGP 对等互连地址;使用这些值配置 Cloud Router 路由器和本地路由器:

    gcloud compute interconnects attachments describe attachment-lga1-central1 \
       --region us-central1

    以上命令输出以下信息:

    cloudRouterIpAddress: 169.254.58.49/29
    creationTimestamp: '2017-08-15T08:34:11.137-07:00'
    customerRouterIpAddress: 169.254.58.50/29
    id: '5630382895290821276'
    interconnect:
    https://www.googleapis.com/compute/v1/projects/customer-project/global/interconnects/int-lga1
    kind: compute#interconnectAttachment
    name: attachment-lga1-central1
    operationalStatus: ACTIVE
    privateInterconnectInfo:
      tag8021q: 1000
    region: https://www.googleapis.com/compute/v1/projects/customer-project/regions/us-central1
    router: https://www.googleapis.com/compute/v1/projects/customer-project/regions/us-central1/routers/router1
    selfLink: https://www.googleapis.com/compute/v1/projects/customer-project/regions/us-central1/interconnectAttachments/attachment-lga1-central1
      
  3. 记录以下值:

    • tag8021q:指定 VLAN ID,即 1000。VLAN ID 可识别经过此连接的流量。使用此值配置本地路由器上已标记的 VLAN 子接口。
    • cloudRouterIpAddress:Cloud Router 路由器 IP 地址,即 169.254.58.49/29。将此地址分配给 Cloud Router 接口,并将此地址指定为本地路由器上的 BGP 邻居。
    • customerRouterIpAddress:客户路由器 IP 地址,即 169.254.58.50/29。在 Cloud Router 路由器上,将此地址指定为已为其分配 Cloud Router 路由器 IP 地址的接口上的 BGP 对等地址。将此地址分配给本地路由器上的 VLAN 子接口。
  4. router1 Cloud Router 路由器上,为 attachment-lga1-central1 连接添加接口:

    gcloud compute routers add-interface router1 \
      --interface-name router1-1 \
      --interconnect-attachment attachment-lga1-central1 \
      --ip-address 169.254.58.49 \
      --mask-length 29 \
      --region us-central1
  5. 将对等 BGP 添加到接口;对于本示例,本地 ASN 为 12345

    gcloud compute routers add-bgp-peer router1 \
      --interface router1-1 \
      --peer-name central1 \
      --peer-ip-address 169.254.58.50 \
      --peer-asn 12345 \
      --region us-central1
  6. 描述 attachment-lga2-central1 连接,然后在 router1 Cloud Router 路由器上配置另一个 BGP 会话。

配置本地路由器

如需配置本地路由器,请使用 VLAN 连接中的信息。以下示例摘自某 Juniper 路由器配置。您可参照该示例来配置您自己的路由器。如需了解详情,请参阅配置本地路由器

interface ae20 {
  flexible-vlan-tagging;
  native-vlan-id 1;
  aggregated-ether-options {
    lacp {
      active;
     }
   }
  unit 1000 {
    vlan-id 1000;
    family inet {
      address 169.254.58.50/29;
    }
  }
}

protocols bgp {
  group google {
    type external;
    multihop {
      ttl 4;
    }
    hold-time 60;
    peer-as 64513;
    local-as 12345;
    local-address 169.254.58.50;
    neighbor 169.254.58.49 {
      ...
    }
  }
}

后续步骤