

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 高性能计算
<a name="highperformancecomputing-pattern-list"></a>

**Topics**
+ [使用 Terraform 和 DRA 部署 Lustre 文件系统以实现高性能数据处理](deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra.md)
+ [为 AWS 设置一个 Grafana 监控控制面板 ParallelCluster](set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.md)
+ [更多模式](highperformancecomputing-more-patterns-pattern-list.md)

# 使用 Terraform 和 DRA 部署 Lustre 文件系统以实现高性能数据处理
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra"></a>

*Arun Bagal 和 Ishwar Chauthaiwale，Amazon Web Services*

## Summary
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-summary"></a>

这种模式会自动在上面部署 Lustre 文件系统，并将其与亚马逊弹性计算云 (亚马逊) AWS 和亚马逊简单存储服务 (Amazon S3 EC2) Simple Service 集成。

该解决方案可帮助您快速设置具有集成存储、计算资源和 Amazon S3 数据访问权限的高性能计算（HPC）环境。它将 Lustre 的存储功能与 Amazon 提供的灵活计算选项 EC2 以及 Amazon S3 中的可扩展对象存储相结合，因此您可以处理机器学习、HPC 和大数据分析中的数据密集型工作负载。

该模式使用 HashiCorp Terraform 模块和 Ama FSx zon for Lustre 来简化以下流程：
+ 预调配 Lustre 文件系统
+ 在 Lustre 和 S3 存储桶之间 FSx 建立数据存储库关联 (DRA)，将 Lustre 文件系统与 Amazon S3 对象关联起来
+ 创建实 EC2 例
+ 在实例上安装带有与 Amazon S3 关联的 DRA 的 Lustre 文件系统 EC2 

此解决方案的优点包括：
+ 模块化设计。您可以轻松维护和更新此解决方案的各个组件。
+ 可扩展性。您可以跨区域快速部署一致 AWS 账户 的环境。
+ 弹性 您可以自定义部署以满足您的特定需求。
+ 最佳实践 此模式使用遵循 AWS 最佳实践的预配置模块。

有关 Lustre 文件系统的更多信息，请访问 [Lustre 网站](https://www.lustre.org/)。

## 先决条件和限制
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-prereqs"></a>

**先决条件**
+ 活跃的 AWS 账户
+ 最低权限 AWS Identity and Access Management (IAM) 策略（参见[说明](https://aws.amazon.com/blogs/security/techniques-for-writing-least-privilege-iam-policies/)）

**限制**

FSx for Lustre 将 Lustre 文件系统限制为单个可用区，如果您有高可用性需求，这可能会是一个问题。如果包含文件系统的可用区出现故障，则在恢复之前，对该文件系统的访问权限将会丢失。为了实现高可用性，您可以使用 DRA 建立 Lustre 文件系统与 Amazon S3 之间的关联，并在可用区之间传输数据。

**产品版本**
+ [Terraform 版本 1.9.3 或更高版本](https://developer.hashicorp.com/terraform/install?product_intent=terraform)
+ [HashiCorp AWS 提供商版本 4.0.0 或更高版本](https://registry.terraform.io/providers/hashicorp/aws/latest)

## 架构
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-architecture"></a>

下图显示了 Lustre FSx 的架构，以及 AWS 服务 中的互补架构。 AWS 云

![\[FSx 用于使用 AWS KMS、Amazon EC2、Amazon Logs 和 Amazon CloudWatch S3 部署 Lustre。\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/images/pattern-img/51d38589-e752-42cd-9f46-59c3c8d0bfd3/images/c1c21952-fd6f-4b1d-9bf8-09b2f4f4459f.png)


该架构包括以下内容：
+ S3 存储桶可用作耐用、可扩展且经济实惠的数据存储位置。f FSx or Lustre 和 Amazon S3 之间的集成提供了一个与 Amazon S3 无缝关联的高性能文件系统。
+ FSx for Lustre 运行和管理 Lustre 文件系统。
+ Amazon Log CloudWatch s 从文件系统收集和监控日志数据。借助这些日志，您即可深入了解 Lustre 文件系统的性能、运行状况和活动。
+ 亚马逊 EC2 用于通过开源 Lustre 客户端访问 Lustre 文件系统。 EC2 实例可以从同一虚拟私有云 (VPC) 内的其他可用区访问文件系统。联网配置允许在 VPC 内跨子网访问。在实例上挂载 Lustre 系统后，您就可以像使用本地文件系统一样，使用您文件系统中的文件和目录。
+ AWS Key Management Service (AWS KMS) 通过为静态数据提供加密来增强文件系统的安全性。

**自动化和扩展**

利用 Terraform，您可轻松地部署、管理和扩缩多个环境中的 Lustre 文件系统。在 F FSx or Lustre 中，单个文件系统有大小限制，因此您可能需要通过创建多个文件系统来进行水平扩展。您可以使用 Terraform 根据您的工作负载需求预调配多个 Lustre 文件系统。

## 工具
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-tools"></a>

**AWS 服务**
+ [Amazon CloudWatch Lo](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) gs 可帮助您集中所有系统和应用程序的日志， AWS 服务 这样您就可以监控它们并安全地将其存档。
+ [亚马逊弹性计算云 (Amazon EC2)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) 在中提供可扩展的计算容量 AWS 云。您可以根据需要启动任意数量的虚拟服务器，并快速纵向扩展或缩减这些服务器。
+ [Amazon FSx for Lustre](https://docs.aws.amazon.com/fsx/latest/LustreGuide/what-is.html) 可以轻松且经济高效地启动、运行和扩展高性能 Lustre 文件系统。
+ [AWS Key Management Service (AWS KMS)](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) 可帮助您创建和控制加密密钥以帮助保护您的数据。
+ [Amazon Simple Storage Service（Amazon S3）](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html)是一项基于云的对象存储服务，可帮助您存储、保护和检索任意数量的数据。

**代码存储库 **

此模式的代码可在[使用 Terraform 存储库的 Lustre 文件系统 GitHub 配置 FSx ](https://github.com/aws-samples/provision-fsx-lustre-with-terraform)中找到。

## 最佳实践
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-best-practices"></a>
+ 以下变量定义了 Lustre 文件系统。请确认按照[操作说明](#deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-epics)中所述，根据您的环境正确进行配置。
  + `storage_capacity`— Lustre 文件系统的存储容量，在。 GiBs最低和默认设置为 1200 GiB。
  + `deployment_type` – Lustre 文件系统的部署类型。有关这两个选项`PERSISTENT_1`和`PERSISTENT_2`（默认）的说明，请参阅 for [Lustre 文档](https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-fsx-lustre.html#persistent-file-system)。FSx 
  + `per_unit_storage_throughput`— 读取和写入吞吐量，以 MBs 每秒 TiB 为单位。 
  + `subnet_id`— 您要 FSx 为 Lustre 部署到的私有子网的 ID。
  + `vpc_id`— 您要在 Lustre 上部署 AWS 的虚拟私有云 FSx 的 ID。
  + `data_repository_path` – 要链接到 Lustre 文件系统的 S3 存储桶的路径。
  + `iam_instance_profile`— 用于启动实例的 IAM EC2 实例配置文件。
  + `kms_key_id`— 将用于数据加密的 AWS KMS 密钥的 Amazon 资源名称 (ARN)。
+ 使用 `security_group` 和 `vpc_id` 变量，确保在 VPC 内正确访问和放置网络。
+ 按照[操作说明](#deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-epics)部分所述，运行 `terraform plan` 命令，以预览和验证更改再进行应用。这有助于发现潜在的问题，并确保您知道将要部署的内容。
+ 按照[操作说明](#deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-epics)部分所述，使用 `terraform validate` 命令，以检查语法错误并确认您的配置正确无误。

## 操作说明
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-epics"></a>

### 设置您的环境
<a name="set-up-your-environment"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 安装 Terraform。 | 要在本地计算机上安装 Terraform，请按照 [Terraform 文档](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)中的说明操作。 | AWS DevOps， DevOps 工程师 | 
| 设置 AWS 凭据。 | 要为账户设置 AWS Command Line Interface (AWS CLI) 配置文件，请按照[AWS 文档](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)中的说明进行操作。 | AWS DevOps， DevOps 工程师 | 
| 克隆 GitHub 存储库。 | 要克隆 GitHub 存储库，请运行以下命令：<pre>git clone https://github.com/aws-samples/provision-fsx-lustre-with-terraform.git</pre> | AWS DevOps， DevOps 工程师 | 

### 为 Lustre FSx 进行配置和部署
<a name="configure-and-deploy-fsxlustre"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 更新部署配置。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra.html) | AWS DevOps， DevOps 工程师 | 
| 初始化 Terraform 环境。 | 要初始化您运行 Terraform `fsx_deployment` 模块的环境，请运行：<pre>terraform init</pre> | AWS DevOps， DevOps 工程师 | 
| 验证 Terraform 语法。 | 要检查语法错误并确认您的配置正确无误，请运行：<pre>terraform validate </pre> | AWS DevOps， DevOps 工程师 | 
| 验证 Terraform 配置。 | 要创建 Terraform 执行计划并预览部署，请运行：<pre>terraform plan -var-file terraform.tfvars</pre> | AWS DevOps， DevOps 工程师 | 
| 部署 Terraform 模块。 | 要部署 for FSx Lustre 资源，请运行：<pre>terraform apply -var-file terraform.tfvars</pre> | AWS DevOps， DevOps 工程师 | 

### 清理 AWS 资源
<a name="clean-up-aws-resources"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 移除 AWS 资源。 | 使用 for Lustre 环境后，您可以移除 Terraform 部署的 AWS 资源，以避免产生不必要的费用。 FSx 代码存储库中提供的 Terraform 模块可自动执行此清理任务。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra.html) | AWS DevOps， DevOps 工程师 | 

## 问题排查
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-troubleshooting"></a>


| 问题 | 解决方案 | 
| --- | --- | 
| FSx for Lustre 会返回错误。 | 要获得有关 Lustre 问题的帮助，请参阅 for Lustre 文档中的 [Amazon f FSx or Lustre 故障排除](https://docs.aws.amazon.com/fsx/latest/LustreGuide/troubleshooting.html)。 FSx FSx  | 

## 相关资源
<a name="deploy-lustre-file-system-for-high-performance-data-processing-with-terraform-dra-resources"></a>
+ [使用 Terraform（Terraform 文档中的AWS 提供商参考） FSx 为 Lustre 构建亚马逊](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/fsx_lustre_file_system)
+ [开始使用 Amazon f FSx or Lustre（查](https://docs.aws.amazon.com/fsx/latest/LustreGuide/getting-started.html)看 FSx Lustre 文档）
+ [AWS 关于 Amazon for Lustre FSx 的博客文章](https://aws.amazon.com/blogs/storage/tag/amazon-fsx-for-lustre/)

# 为 AWS 设置一个 Grafana 监控控制面板 ParallelCluster
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster"></a>

*Dario La Porta 和 William Lu，Amazon Web Services*

## Summary
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster-summary"></a>

AWS ParallelCluster 可帮助您部署和管理高性能计算 (HPC) 集群。支持 AWS Batch 和 Slurm 开源作业计划程序。尽管 ParallelCluster AWS 与 Amazon CloudWatch 集成了日志和指标，但它没有为工作负载提供监控控制面板。

[适用于 AWS 的 Grafana 控制面板 GitHub () 是 ParallelCluster AWS](https://github.com/aws-samples/aws-parallelcluster-monitoring) 的监控控制面板。 ParallelCluster它提供了操作系统级别的作业调度程序见解和详细的监控指标。有关此解决方案中包含的仪表板的更多信息，请参阅 GitHub 存储库中的[示例仪表板](https://github.com/aws-samples/aws-parallelcluster-monitoring#example-dashboards)。这些指标可帮助您更好地了解 HPC 工作负载及性能。但是，控制面板代码不会针对最新版本的 AWS ParallelCluster 或解决方案中使用的开源软件包进行更新。此模式增强解决方案，提供以下优势：
+ 支持 AWS ParallelCluster v3
+ 使用最新版开源包，包括 Prometheus、Grafana、Prometheus Slurm Exporter 和 NVIDIA DCGM-Exporter
+ 增加 Slurm 作业使用 GPUs 的 CPU 内核数量
+ 添加任务监控控制面板
+ 增强具有 4 或 8 个图形处理单元的节点的 GPU 节点监控仪表板 (GPUs)

此版本的增强型解决方案已在 AWS 客户的 HPC 生产环境中实施和验证。

## 先决条件和限制
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster-prereqs"></a>

**先决条件**
+ [AWS ParallelCluster CLI](https://docs.aws.amazon.com/parallelcluster/latest/ug/pcluster-v3.html)，已安装并配置。
+ AWS 支持的[网络配置](https://docs.aws.amazon.com/parallelcluster/latest/ug/iam-roles-in-parallelcluster-v3.html) ParallelCluster。此模式使用使用[ ParallelCluster 使用两个子网的 AWS 配置，这需要公有子网](https://docs.aws.amazon.com/parallelcluster/latest/ug/network-configuration-v3.html#network-configuration-v3-two-subnets)、私有子网、Internet 网关和 NAT 网关。
+ 所有 AWS ParallelCluster 集群节点都必须能够访问互联网。这是必要条件，这样安装脚本才能下载开源软件和 Docker 映像。
+ 亚马逊弹性计算云（亚马逊 EC2）中的[密钥对](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)。具有此密钥对的资源具有对头节点的 Secure Shell (SSH) 访问权限。

**限制**
+ 此示例旨在支持 Ubuntu 20.04 LTS。如果您使用的是其他版本的 Ubuntu，或者您使用的是 Amazon Linux 或 CentOS，则需要修改此解决方案提供的脚本。这些修改不包含在此模式中。

**产品版本**
+ Ubuntu 20.04 LTS
+ ParallelCluster 3.X

**账单与成本注意事项**
+ 以这种模式部署的解决方案并不在免费套餐范围内。亚马逊 EC2、亚马逊 Lustre、亚马逊 VPC 中的 NAT 网关和亚马逊 Route 53 均 FSx 需收费。

## 架构
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster-architecture"></a>

**目标架构**

下图显示了用户如何在头节点 ParallelCluster 上访问 AWS 的监控控制面板。头节点运行 NICE DCV、Prometheus、Grafana、Prometheus Slurm Exporter、Prometheus Node Exporter 以及 NGINX Open Source。计算节点运行 Prometheus Node Exporter，如果节点包含，它们还会运行 NVIDIA dcgm-Exporter。 GPUs头节点从计算节点检索信息，并将此数据显示在 Grafana 控制面板中。

![\[在头节点 ParallelCluster 上访问 AWS 的监控控制面板。\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/images/pattern-img/a2132c94-98e0-4b90-8be0-99ebfa546442/images/d2255792-f66a-4ef2-8f04-cc3d5482db5f.png)


在大多数情况下，头节点的负载并不重，因为作业调度程序不需要大量的 CPU 或内存。用户通过端口 443 上的 SSL 访问头节点上的控制面板。

所有授权查看者都可以匿名查看监控控制面板。仅 Grafana 管理员可以修改控制面板。您可在 `aws-parallelcluster-monitoring/docker-compose/docker-compose.head.yml` 文件中为 Grafana 管理员配置密码。

## 工具
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster-tools"></a>

**Amazon Web Services**
+ [NICE DCV](https://docs.aws.amazon.com/dcv/#nice-dcv) 是一种高性能远程显示协议，可帮助您在不同的网络条件下将远程桌面和应用程序流从任何云或数据中心传送到任何设备。
+ [AWS ParallelCluster](https://docs.aws.amazon.com/parallelcluster/latest/ug/what-is-aws-parallelcluster.html) 可帮助您部署和管理高性能计算 (HPC) 集群。支持 AWS Batch 和 Slurm 开源作业计划程序。
+ [Amazon Simple Storage Service (Amazon S3)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) 是一项基于云的对象存储服务，可帮助您存储、保护和检索任意数量的数据。
+ [Amazon Virtual Private Cloud (Amazon VPC)](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) 可帮助您将 AWS 资源启动到您定义的虚拟网络中。

**其他工具**
+ [Docker](https://www.docker.com/) 是一组平台即服务（PaaS）产品，它们使用操作系统级别的虚拟化技术在容器中交付软件。
+ [Grafana](https://grafana.com/docs/grafana/latest/introduction/) 是一款开源软件，可帮助您查询、可视化、提醒和浏览指标、日志和跟踪。
+ [NGINX Open Source](https://nginx.org/en/docs/?_ga=2.187509224.1322712425.1699399865-405102969.1699399865) 是一个开源 Web 服务器和反向代理。
+ [NVIDIA 数据中心 GPU 管理器 (DCGM)](https://docs.nvidia.com/data-center-gpu-manager-dcgm/index.html) 是一套工具，用于在集群环境中管理和监控 NVIDIA 数据中心图形处理单元 (GPUs)。在这种模式中，您使用 [dcgm-Exporter](https://github.com/NVIDIA/dcgm-exporter)，它可以帮助您从 Prometheus 中导出 GPU 指标。
+ [Prometheus](https://prometheus.io/docs/introduction/overview/) 是开源系统监控工具包，可将其指标收集并存储为时间序列数据，以及相关的键值对（称为*标签*）。在此模式下，您还可使用 [Prometheus Slurm Exporter](https://github.com/vpenso/prometheus-slurm-exporter) 收集和导出指标，您可使用 [Prometheus Node Exporter](https://github.com/prometheus/node_exporter) 导出来自结算节点的指标。
+ [Ubuntu](https://help.ubuntu.com/) 是基于 Linux 的开源操作系统，专为企业服务器、桌面、云环境和物联网而设计。

**代码存储库**

此模式的代码可在 GitHub [pcluster-monitoring-dashboard](https://github.com/aws-samples/parallelcluster-monitoring-dashboard)存储库中找到。

## 操作说明
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster-epics"></a>

### 创建所需资源
<a name="create-the-required-resources"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 创建 S3 存储桶。 | 创建 Amazon S3 存储桶。您可使用此存储桶存储配置脚本。有关说明，请参阅 Amazon S3 文档中的[创建存储桶](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)。 | 常规 AWS | 
| 克隆存储库。 | 通过运行以下命令克隆 GitHub [pcluster-monitoring-dashboard](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/tree/main/aws-parallelcluster-monitoring)存储库。<pre>git clone https://github.com/aws-samples/parallelcluster-monitoring-dashboard.git</pre> | DevOps 工程师 | 
| 创建管理员密码。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | Linux Shell 脚本 | 
| 将所需文件复制至 S3 存储桶。 | 将 [post\$1install.sh](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/blob/main/post_install.sh) 脚本和[aws-parallelcluster-monitoring](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/tree/main/aws-parallelcluster-monitoring)文件夹复制到您创建的 S3 存储桶中。有关说明，请参阅 Amazon S3 文档中的[上传对象](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html)。 | 常规 AWS | 
| 为头节点配置其他安全组。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | AWS 管理员 | 
| 为头节点配置 IAM policy。 | 为头节点创建基于身份的策略。该策略允许节点从 Amazon 检索指标数据 CloudWatch。该 GitHub 存储库包含一个示例[策略](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/blob/main/policies/head_node.json)。有关说明，请参阅 AWS Identity and Access Management (IAM) 文档中的[创建 IAM policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html)。 | AWS 管理员 | 
| 为计算机节点配置 IAM policy。 | 为计算机节点创建基于身份的策略。此策略允许节点创建包含作业 ID 和任务拥有者的标签。该 GitHub 存储库包含一个示例[策略](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/blob/main/policies/compute_node.json)。有关说明，请参阅 IAM 文档中的[创建 IAM policy。 ](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html)如您使用提供的示例文件，请替换以下值：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | AWS 管理员 | 

### 创建集群
<a name="create-the-cluster"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 修改所提供的集群模板文件。 | 创建 AWS ParallelCluster 集群。使用提供的 [cluster.yaml](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/blob/main/cluster.yaml) A CloudFormation WS 模板文件作为创建集群的起点。替换所提供模板中的以下值：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | AWS 管理员 | 
| 创建集群。 | 在 AWS ParallelCluster CLI 中，输入以下命令。这将部署 CloudFormation 模板并创建集群。有关此命令的更多信息，请参阅 AWS 文档中的 [pcluster create-cluster](https://docs.aws.amazon.com/parallelcluster/latest/ug/pcluster.create-cluster-v3.html)。 ParallelCluster <pre>pcluster create-cluster -n <cluster_name> -c cluster.yaml</pre> | AWS 管理员 | 
| 监控集群创建。 | 输入以下命令，以监控集群创建。有关此命令的更多信息，请参阅 [AWS 文档中的 pcluster describe-](https://docs.aws.amazon.com/parallelcluster/latest/ug/pcluster.describe-cluster-v3.html) cluster。 ParallelCluster <pre>pcluster describe-cluster -n <cluster_name></pre> | AWS 管理员 | 

### 使用 Grafana 控制面板
<a name="using-the-grafana-dashboards"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 访问 Grafana 门户。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | AWS 管理员 | 

### 清理解决方案，以停止产生相关成本
<a name="clean-up-the-solution-to-stop-incurring-associated-costs"></a>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 请删除集群。 | 输入以下命令以删除集群。有关此命令的更多信息，请参阅 AWS 文档中的 [pcluster delete-cluster](https://docs.aws.amazon.com/parallelcluster/latest/ug/pcluster.delete-cluster-v3.html)。 ParallelCluster <pre>pcluster delete-cluster -n <cluster_name></pre> | AWS 管理员 | 
| 删除 IAM policy。 | 删除您为头节点与计算节点创建的策略。有关删除策略的更多信息，请参阅 IAM 文档中的[删除 IAM policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-delete.html)。 | AWS 管理员 | 
| 删除安全组和规则。 | 删除您为头节点创建的安全组。有关更多信息，请参阅 Amazon VPC 文档中的[删除安全组规则](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-security-groups.html#deleting-security-group-rules)和[删除安全组](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-security-groups.html#deleting-security-groups)。 | AWS 管理员 | 
| 删除 S3 存储桶。 | 删除您创建的用于存储配置脚本的 S3 存储桶。有关更多信息，请参阅 Amazon S3 文档中的[删除存储桶](https://docs.aws.amazon.com/AmazonS3/latest/userguide/delete-bucket.html)。 | 常规 AWS | 

## 问题排查
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster-troubleshooting"></a>


| 问题 | 解决方案 | 
| --- | --- | 
| 头节点在浏览器中不可访问。 | 检查安全组并确认入站端口 443 已经打开。 | 
| 无法打开 Grafana。 | 在头节点上，查看 `docker logs Grafana` 的容器日志。 | 
| 部分指标没有数据。 | 在头节点，检查所有容器的容器日志。 | 

## 相关资源
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster-resources"></a>

**AWS 文档**
+ [适用于亚马逊的 IAM 政策 EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-policies-for-amazon-ec2.html)

**其他 AWS 资源**
+ [AWS ParallelCluster](https://aws.amazon.com/hpc/parallelcluster/)
+ [AWS 监控控制面板 ParallelCluster](https://aws.amazon.com/blogs/compute/monitoring-dashboard-for-aws-parallelcluster/)（AWS 博客文章）

**其他资源**
+ [Prometheus 监控系统](https://prometheus.io/)
+ [Grafana](https://grafana.com/)

# 更多模式
<a name="highperformancecomputing-more-patterns-pattern-list"></a>

**Topics**
+ [通过 K8sGPT 和 Amazon Bedrock 集成，实施人工智能驱动的 Kubernetes 诊断和问题排查](implement-ai-powered-kubernetes-diagnostics-and-troubleshooting-with-k8sgpt-and-amazon-bedrock-integration.md)