从计算引擎连接

本指南介绍了如何创建单个 Compute Engine 客户端并将其连接到 Google Cloud Managed Lustre 实例。Managed Lustre 支持来自最多 20,000 个客户端的连接。

为了获得更好的性能,客户端 Compute Engine 虚拟机应在与受管 Lustre 实例相同的地区中创建。

所需权限

您必须拥有以下 IAM 角色:

  • Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1) 权限,以便创建 Compute Engine 虚拟机。

  • Compute Admin (roles/compute.admin) 或 Compute Security Admin (roles/compute.securityAdmin) 才能创建防火墙规则。

  • IAP-Secured Tunnel User (roles/iap.tunnelResourceAccessor) 权限,以便使用 Identity-Aware Proxy 通过 SSH 连接到 Compute Engine 虚拟机。

如需查看每个角色授予的权限的完整列表,请参阅 IAM 角色参考文档

创建 Compute Engine 虚拟机

按照说明使用以下 Google Cloud 映像系列之一创建 Compute Engine 虚拟机:

  • Rocky Linux 8
  • Rocky Linux 9
  • Red Hat Enterprise Linux (RHEL) 9
  • Ubuntu 20.04 LTS,v20250213 或更高版本。请注意,Ubuntu 20.04 已达到支持终止 (EOS) 期限,无法从 Google Cloud 控制台中选择。
  • Ubuntu 22.04 LTS,v20250128 或更高版本
  • Ubuntu 24.04 LTS,仅适用于 Arm 虚拟机

如果您运行的是自定义 Ubuntu 22.04 或 24.04 内核,则支持 DKMS。

机器类型和联网

您可以选择任何机器类型和启动磁盘。我们建议至少使用 c2-standard-4 机器类型。

网络吞吐量可能会受到所选机器类型的影响。一般来说,为了获得最佳吞吐量:

  • 增加 vCPU 数量。每个实例的最大出站流量带宽通常为每个 vCPU 2 Gbps,最高可达机器类型上限。
  • 选择支持更高入站和出站流量限制的机器系列。例如,使用 Tier_1 网络的 C2 实例支持高达 100 Gbps 的出站流量带宽。使用 Tier_1 网络的 C3 实例支持高达 200 Gbps 的带宽。
  • 使用更大的机器类型来启用每个虚拟机的 Tier_1 网络性能

如需了解详情,请参阅网络带宽

创建虚拟机

Google Cloud 控制台

  1. 在 Google Cloud 控制台中,转到虚拟机实例页面。

    转到虚拟机实例

  2. 选择您的项目并点击继续

  3. 点击创建实例

  4. 名称中,为虚拟机输入名称。如需了解详情,请参阅资源命名惯例

  5. 从此虚拟机的下拉菜单中选择区域可用区。 您的虚拟机应与 Managed Lustre 实例位于同一可用区。

  6. 从列表中为虚拟机选择机器配置

  7. 点击左侧导航栏中的操作系统和存储空间

  8. 操作系统和存储空间下,点击更改

  9. 操作系统下拉菜单中,选择以下选项之一:

    • 适用于 Rocky 8 的 HPC 虚拟机映像
    • 适用于 Rocky 9 的 Rocky Linux
    • 适用于 RHEL 9 的 Red Hat Enterprise Linux
    • 适用于 Ubuntu 22.04 LTS 或 24.04 LTS 的 Ubuntu
  10. 版本下拉列表中,选择以下选项之一:

    • HPC Rocky Linux 8
    • Rocky Linux 9
    • Red Hat Enterprise Linux 9
    • Ubuntu 22.04 LTS
    • Ubuntu 24.04 LTS

    选择 x86/64 版本或 Arm64 版本,以与您的机器类型相匹配。Ubuntu 24.04 LTS 仅在 Arm 虚拟机上受支持。

  11. 如需确认您的启动磁盘选项,请点击选择

  12. 在左侧导航栏中,点击网络

  13. 网络接口下,选择您在配置 VPC 网络中创建的 VPC 网络。

  14. 在左侧导航栏中,点击安全性

  15. 访问权限范围下方,选择允许所有 Cloud API 的全面访问权限

  16. 在左侧导航栏中,点击高级

  17. 自动化下,在启动脚本字段中输入以下内容:

    #!/bin/bash
    sudo apt-get update
    sudo apt-get install -y lustre-client-modules-$(uname -r)
    

    此脚本可确保在升级 Ubuntu 内核时更新 Lustre 客户端软件包。

  18. 要创建并启动该虚拟机,请点击创建

gcloud

使用 gcloud 命令行工具创建虚拟机:

HPC Rocky Linux 8

使用 gcloud compute instances create 命令创建虚拟机。您可以在运行命令之前更新机器类型和任何磁盘规范。

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --scopes="https://www.googleapis.com/auth/cloud-platform" \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image-project=cloud-hpc-image-public,image-family=hpc-rocky-linux-8,\
mode=rw,size=100,type=pd-balanced

Rocky Linux 9

使用 gcloud compute instances create 命令创建虚拟机。您可以在运行命令之前更新机器类型和任何磁盘规范。

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --scopes="https://www.googleapis.com/auth/cloud-platform" \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image-project=rocky-linux-cloud,image-family=rocky-linux-9,\
mode=rw,size=100,type=pd-balanced

RHEL 9

使用 gcloud compute instances create 命令创建虚拟机。您可以在运行命令之前更新机器类型和任何磁盘规范。

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --scopes="https://www.googleapis.com/auth/cloud-platform" \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image-project=rhel-cloud,image-family=rhel-9,\
mode=rw,size=100,type=pd-balanced

Ubuntu 20.04 LTS

使用 gcloud compute instances create 命令创建虚拟机。您可以在运行命令之前更新机器类型和任何磁盘规范。

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --scopes="https://www.googleapis.com/auth/cloud-platform" \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20250606,\
mode=rw,size=100,type=pd-balanced \
  --metadata=startup-script='#!/bin/bash
    sudo apt-get update
    sudo apt-get install -y lustre-client-modules-$(uname -r)'

Ubuntu 22.04 LTS

使用 gcloud compute instances create 命令创建虚拟机。您可以在运行命令之前更新机器类型和任何磁盘规范。

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --scopes="https://www.googleapis.com/auth/cloud-platform" \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image-project=ubuntu-os-cloud,image-family=ubuntu-2204-lts,\
mode=rw,size=100,type=pd-balanced \
  --metadata=startup-script='#!/bin/bash
    sudo apt-get update
    sudo apt-get install -y lustre-client-modules-$(uname -r)'

Ubuntu 24.04 LTS

使用 gcloud compute instances create 命令创建虚拟机。

Managed Lustre 仅支持 Arm 虚拟机上的 Ubuntu 24.04 LTS。

您可以在运行命令之前更新机器类型和任何磁盘规范。

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c4a-standard-32 \
  --scopes="https://www.googleapis.com/auth/cloud-platform" \
  --network-interface=network-tier=PREMIUM,nic-type=GVNIC,stack-type=IPV4_ONLY,subnet=NETWORK_NAME \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image-project=ubuntu-os-cloud,image-family=ubuntu-2404-lts-arm64,mode=rw,size=100,type=hyperdisk-balanced

如需详细了解可用选项,请参阅 Compute Engine 文档

创建允许 SSH 的防火墙规则

如需通过 SSH 连接到 Compute Engine 虚拟机,您必须先创建一条防火墙规则,允许访问虚拟机上的 TCP 端口 22。

没有公共 IP 的虚拟机

通过 SSH 连接到没有外部 IP 地址的虚拟机时, Google Cloud 控制台 SSH 按钮和 gcloud compute ssh 都会使用 Identity-Aware Proxy (IAP) 进行连接。

对于这些连接,请按照创建防火墙规则中的说明创建防火墙规则,以仅允许来自 IAP 来源范围(始终为 35.235.240.0/20)的入站流量。这样可以避免将端口 22 暴露给更广泛的互联网,从而提高安全性。

具有公共 IP 的虚拟机

如果您已为 Compute Engine 虚拟机分配公共 IP,Google Cloud 控制台 SSH 按钮可能会尝试直接连接,从而绕过 IAP。

此直接连接的源 IP 不是 IAP 范围,而是 Google IP 地址池中的一个。如需允许此连接,需要更广泛的来源地址范围,例如 0.0.0.0/0(任何来源)。

如果您的虚拟机具有公共 IP,我们建议您配置防火墙规则,仅允许来自 IAP 范围 (35.235.240.0/20) 的 SSH 连接。然后使用 gcloud compute ssh 进行连接,并指定 --tunnel-through-iap 标志。

如果您必须分配公共 IP 从 Google Cloud 控制台进行连接,请将来源 IPv4 范围的值指定为 0.0.0.0/0

创建防火墙规则

Google Cloud 控制台

创建允许 SSH 的防火墙规则。

  1. 在 Google Cloud 控制台中,前往防火墙政策页面。

    转到“防火墙政策”

  2. 点击创建防火墙规则

  3. 输入规则的名称

  4. 对于网络,选择您之前创建的 VPC 网络。

  5. 选择入站作为流量方向,并选择允许作为对匹配项执行的操作

  6. 目标下拉菜单中,选择网络中的所有实例

  7. 来源 IPv4 范围字段中,输入 35.235.240.0/20

  8. 协议和端口中,选择指定的协议和端口

  9. 选择 TCP,然后在端口字段中输入 22

  10. 点击创建

gcloud

创建允许 SSH 的防火墙规则。

gcloud compute firewall-rules create FIREWALL_RULE_NAME \
  --allow=tcp:22 \
  --network=NETWORK_NAME \
  --source-ranges=35.235.240.0/20 \
  --project=PROJECT_ID

通过 SSH 连接到您的 Compute Engine 虚拟机

创建防火墙规则后,您可以通过 SSH 连接到虚拟机:

Google Cloud 控制台

  1. 在 Google Cloud 控制台中,转到虚拟机实例页面。

    转到虚拟机实例

  2. 在实例表格中,找到您的实例所在的行,然后点击标题为连接的列中的 SSH

  3. 如果系统提示您执行此操作,请点击授权以允许连接。

gcloud

gcloud compute ssh VM_NAME \
  --zone=LOCATION \
  --project=PROJECT_ID \
  --tunnel-through-iap

安装 Lustre 客户端软件包

Lustre 客户端软件包托管在 Artifact Registry 的 lustre-client-binaries 项目中。

配置对代码库的访问权限

如需将虚拟机配置为从 Artifact Registry 安装,请按照以下说明操作。

HPC Rocky Linux 8

运行 gcloud beta artifacts print-settings 并将输出传送到 bash 以运行所需命令:

gcloud beta artifacts print-settings yum \
  --repository=lustre-client-rocky-8 \
  --location=us --project=lustre-client-binaries | sudo bash

Rocky Linux 9

运行 gcloud beta artifacts print-settings 并将输出传送到 bash 以运行所需命令:

gcloud beta artifacts print-settings yum \
  --repository=lustre-client-rocky-9 \
  --location=us --project=lustre-client-binaries | sudo bash

RHEL 9

运行 gcloud beta artifacts print-settings 并将输出传送到 bash 以运行所需命令:

gcloud beta artifacts print-settings yum \
  --repository=lustre-client-rocky-9 \
  --location=us --project=lustre-client-binaries | sudo bash

RHEL 9 使用与 Rocky Linux 9 相同的 lustre-client-rocky-9 代码库。

Ubuntu 20.04 LTS

  1. 安装 Apt 代码库签名密钥:

    curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/google-cloud.gpg
    curl -fsSL https://us-apt.pkg.dev/doc/repo-signing-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/lustre-client.gpg
    
  2. 配置虚拟机以访问 Artifact Registry 软件包:

    echo 'deb [signed-by=/usr/share/keyrings/google-cloud.gpg] http://packages.cloud.google.com/apt apt-transport-artifact-registry-stable main' \
      | sudo tee /etc/apt/sources.list.d/artifact-registry.list
    
  3. 更新 Apt 并安装 apt-transport-artifact-registry 软件包:

    sudo apt update && sudo apt install apt-transport-artifact-registry
    
  4. 配置 Apt 以从代码库中提取软件包:

    echo "deb [signed-by=/usr/share/keyrings/lustre-client.gpg] ar+https://us-apt.pkg.dev/projects/lustre-client-binaries lustre-client-ubuntu-focal main" \
      | sudo tee -a /etc/apt/sources.list.d/artifact-registry.list
    
  5. 更新代码库来源:

    sudo apt update
    

    如果该命令返回错误,请确保您的 Compute Engine 虚拟机在创建时所用的访问权限范围允许对所有 Cloud API 的全面访问权限。如需了解详情,请参阅授予对 Compute Engine 实例的访问权限

如需详细了解这些命令,请参阅 Artifact Registry 文档:将虚拟机配置为安装 Debian 软件包

Ubuntu 22.04 LTS

  1. 安装 Apt 代码库签名密钥:

    curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/google-cloud.gpg
    curl -fsSL https://us-apt.pkg.dev/doc/repo-signing-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/lustre-client.gpg
    
  2. 配置虚拟机以访问 Artifact Registry 软件包:

    echo 'deb [signed-by=/usr/share/keyrings/google-cloud.gpg] http://packages.cloud.google.com/apt apt-transport-artifact-registry-stable main' \
      | sudo tee /etc/apt/sources.list.d/artifact-registry.list
    
  3. 更新 Apt 并安装 apt-transport-artifact-registry 软件包:

    sudo apt update && sudo apt install apt-transport-artifact-registry
    
  4. 配置 Apt 以从代码库中提取软件包:

    echo "deb [signed-by=/usr/share/keyrings/lustre-client.gpg] ar+https://us-apt.pkg.dev/projects/lustre-client-binaries lustre-client-ubuntu-jammy main" \
      | sudo tee -a /etc/apt/sources.list.d/artifact-registry.list
    
  5. 更新代码库来源:

    sudo apt update
    

    如果该命令返回错误,请确保您的 Compute Engine 虚拟机在创建时所用的访问权限范围允许对所有 Cloud API 的全面访问权限。如需了解详情,请参阅授予对 Compute Engine 实例的访问权限

如需详细了解这些命令,请参阅 Artifact Registry 文档:将虚拟机配置为安装 Debian 软件包

Ubuntu 24.04 LTS

  1. 安装 Apt 代码库签名密钥:

    curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/google-cloud.gpg
    curl -fsSL https://us-apt.pkg.dev/doc/repo-signing-key.gpg \
      | sudo gpg --dearmor -o /usr/share/keyrings/lustre-client.gpg
    
  2. 配置虚拟机以访问 Artifact Registry 软件包:

    echo 'deb [signed-by=/usr/share/keyrings/google-cloud.gpg] http://packages.cloud.google.com/apt apt-transport-artifact-registry-stable main' \
      | sudo tee /etc/apt/sources.list.d/artifact-registry.list
    
  3. 更新 Apt 并安装 apt-transport-artifact-registry 软件包:

    sudo apt update && sudo apt install apt-transport-artifact-registry
    
  4. 配置 Apt 以从代码库中提取软件包:

    echo "deb [signed-by=/usr/share/keyrings/lustre-client.gpg] ar+https://us-apt.pkg.dev/projects/lustre-client-binaries lustre-client-ubuntu-noble main" \
      | sudo tee -a /etc/apt/sources.list.d/artifact-registry.list
    
  5. 更新代码库来源:

    sudo apt update
    

    如果该命令返回错误,请确保您的 Compute Engine 虚拟机在创建时所用的访问权限范围允许对所有 Cloud API 的全面访问权限。如需了解详情,请参阅授予对 Compute Engine 实例的访问权限

如需详细了解这些命令,请参阅 Artifact Registry 文档:将虚拟机配置为安装 Debian 软件包

安装 Lustre 客户端软件包

按照说明安装 Lustre 客户端软件包。

HPC Rocky Linux 8

sudo yum -y --enablerepo=lustre-client-rocky-8 install kmod-lustre-client
sudo yum -y --enablerepo=lustre-client-rocky-8 install lustre-client

Rocky Linux 9

sudo yum -y --enablerepo=lustre-client-rocky-9 install kmod-lustre-client
sudo yum -y --enablerepo=lustre-client-rocky-9 install lustre-client

RHEL 9

sudo yum -y --enablerepo=lustre-client-rocky-9 install kmod-lustre-client
sudo yum -y --enablerepo=lustre-client-rocky-9 install lustre-client

Ubuntu 20.04 LTS

运行以下命令。

sudo apt install lustre-client-modules-$(uname -r)/lustre-client-ubuntu-focal
sudo apt install lustre-client-utils/lustre-client-ubuntu-focal

Lustre 客户端软件包是特定于内核版本的。如果您在创建 Compute Engine 实例时未添加启动脚本,并且您的 Ubuntu 内核版本因自动内核更新而发生更改,则必须重新运行这些命令才能下载相应的 Lustre 客户端软件包。

Ubuntu 22.04 LTS

运行以下命令。

sudo apt install lustre-client-modules-$(uname -r)/lustre-client-ubuntu-jammy
sudo apt install lustre-client-utils/lustre-client-ubuntu-jammy

Lustre 客户端软件包是特定于内核版本的。如果您的 Ubuntu 内核版本因自动内核更新而发生变化,您必须重新运行这些命令,才能下载相应的 Lustre 客户端软件包。

Ubuntu 24.04 LTS

运行以下命令。

sudo apt install lustre-client-modules-$(uname -r)/lustre-client-ubuntu-noble
sudo apt install lustre-client-utils/lustre-client-ubuntu-noble

Lustre 客户端软件包是特定于内核版本的。如果您在创建 Compute Engine 实例时未添加启动脚本,并且您的 Ubuntu 内核版本因自动内核更新而发生更改,则必须重新运行这些命令才能下载相应的 Lustre 客户端软件包。

加载 Lustre 内核模块

安装客户端软件包后,运行以下命令以加载 Lustre 内核模块:

sudo modprobe lustre

(可选)为 gke-support-enabled 实例配置 LNet

本部分仅适用于连接到指定了 --gke-support-enabled 的受管 Lustre 实例的 Compute Engine 客户端。

如果您的 Managed Lustre 实例不是使用 GKE 支持选项创建的,请跳过本部分。

将 LNet 配置为使用 accept_port 6988

如果您的 Managed Lustre 实例的 --gke-support-enabled 设置为 true,并且您要从 Compute Engine 虚拟机进行连接,请执行以下操作:

  1. 创建或修改 /etc/modprobe.d/lnet.conf
  2. 添加以下代码行:
    options lnet accept_port=6988
    
  3. 重新启动虚拟机:
    sudo reboot
    

挂载 Managed Lustre 实例

装载 Managed Lustre 实例。

  • 对于不需要在重启后保持挂载状态的快速挂载,请使用 mount 命令。

  • 如需在每次虚拟机启动时自动装载,请使用 /etc/fstab 选项。

在这两种情况下,用作挂载点的目录都必须在您运行命令之前存在。

如需检索实例的 IP 地址和文件系统名称,请使用 gcloud lustre instances describe 命令,或访问 Google Cloud 控制台中的实例页面。

gcloud lustre instances describe INSTANCE_NAME \
  --location=ZONE

mount

在 Compute Engine 虚拟机的命令行中,使用 mount 命令手动挂载受管 Lustre 实例:

sudo mkdir -p ~/MOUNT_DIR
sudo mount -t lustre IP_ADDRESS:/FILESYSTEM_NAME ~/MOUNT_DIR

其中:

  • IP_ADDRESS 是您的受管 Lustre 实例的 IP 地址。

  • FILESYSTEM_NAME 是您实例的文件系统名称。

  • ~/MOUNT_DIR 是您创建的本地装载点目录。

/etc/fstab

在 Compute Engine 虚拟机的命令行中:

  1. 为装载点创建本地目录:

    sudo mkdir -p ~/MOUNT_DIR
    
  2. 打开 /etc/fstab 文件进行修改,并添加以下行:

    IP_ADDRESS@tcp:/FILESYSTEM_NAME ~/MOUNT_DIR lustre defaults,_netdev 0 0
    

    其中:

    • IP_ADDRESS 是您的受管 Lustre 实例的 IP 地址。

    • FILESYSTEM_NAME 是您实例的文件系统名称。

    • ~/MOUNT_DIR 是您创建的本地装载点目录。

    • lustre defaults,_netdev 0 0 是建议的装载选项:

      • lustre 将文件系统类型指定为 Lustre。
      • defaults 使用默认的一组装载选项。
      • _netdev 指示系统在尝试装载文件系统之前等待网络连接。
      • 0 0 控制转储和文件系统检查顺序。
  3. 保存并退出 /etc/fstab 文件。

  4. 运行以下命令以装载 /etc/fstab 中列出的所有文件系统:

    sudo mount -a
    

您的 Managed Lustre 实例现已挂载。每次 Compute Engine 虚拟机启动时,系统都会自动装载该磁盘。

如果挂载命令失败,请参阅问题排查说明来诊断问题。

使用辅助 NIC

如果您要使用具有多个 NIC 的 Compute Engine 实例的辅助 NIC 的 VPC 来装载 Managed Lustre 实例,请按照以下说明操作:

  1. 配置 LNET 以使用正确的 NIC。

    /etc/lnet.conf 的内容复制到虚拟机上名为 /etc/modprobe.d/lustre.conf 的文件中。将以下行附加到该文件,并将 eth1 替换为辅助 NIC 的名称:

    options lnet networks="tcp0(eth1)"
    

    重新加载 Lustre 内核模块:

    lustre_rmmod
    modprobe lustre
    

    验证 LNET 是否已配置为使用第二个 NIC。以下命令的输出应为第二个 NIC:

    lctl list_nids
    
  2. 通过辅助 NIC 的网关向 Managed Lustre 实例的 CIDR 块添加静态路由。

    • 如需查找辅助 NIC 的网关,请运行 route 命令。

    • 如需查找 Managed Lustre 实例的 CIDR 块,请执行以下操作:

      • 运行 gcloud lustre instances describe 命令可获取实例详情。
      • 获取 mountPoint 字段中提供的地址。
      • 将 IP 地址转换为包含该地址的 CIDR 地址块,大小为 24。

    例如,如果 Managed Lustre 实例的 CIDR 块为 172.16.0.0/24,辅助 NIC 为 eth1,网关为 10.128.0.1,则运行以下命令:

    ip route add 172.16.0.0/24 via 10.128.0.1 dev eth1
    

    请注意,如果 Compute Engine 实例重新启动,添加的路由将不会保留。如何使该设置保持不变取决于您使用的特定操作系统系列。

访问您的 Managed Lustre 实例

您的托管 Lustre 实例现已装载到 Compute Engine 虚拟机,并且可以使用标准 POSIX 语法进行读取/写入,但存在一些例外情况

运行以下命令来检查已挂载的目录:

sudo lfs df -h ~/MOUNT_DIR

您可以使用以下命令测试文件复制和写入:

# sample file copy/file write
sudo dd if=/dev/zero of=~/MOUNT_DIR/bigfile1 bs=1M count=8000
sudo dd if=/dev/urandom of=~/MOUNT_DIR/bigfile1 bs=1M count=1000

如需确认磁盘空间使用情况,请执行以下操作:

sudo lfs df -h ~/MOUNT_DIR

卸载实例

可以使用以下命令卸载 Managed Lustre 实例:

sudo umount ~/MOUNT_DIR

后续步骤