

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# AWS ParallelCluster 用の Grafana モニタリングダッシュボードを設定する
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster"></a>

*Amazon Web Services、Dario La Porta、William Lu*

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

AWS ParallelCluster は、ハイパフォーマンスコンピューティング(HPC)クラスターのデプロイと管理をサポートします。AWS Batch と Slurm のオープンソースジョブスケジューラーをサポートしています。AWS ParallelCluster はログ記録とメトリクス用に Amazon CloudWatch と統合されていますが、ワークロードのモニタリングダッシュボードは提供されていません。

[AWS ParallelCluster (GitHub) の Grafana ダッシュボード](https://github.com/aws-samples/aws-parallelcluster-monitoring)は AWS ParallelCluster のモニタリングダッシュボードです。ジョブスケジューラーの分析情報とオペレーティングシステム (OS) レベルでの詳細なモニタリングメトリクスを提供します。このソリューションに含まれるダッシュボードの詳細については、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 ジョブが使用する CPU コアと GPU の数を増やします。
+ ジョブモニタリングダッシュボードを追加する
+ 4 つまたは 8 つのグラフィックプロセッシングユニット (GPU) を搭載したノードの GPU ノードモニタリングダッシュボードを強化します。

このバージョンの拡張ソリューションは、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 ParallelCluster でサポートされている[ネットワーク設定](https://docs.aws.amazon.com/parallelcluster/latest/ug/iam-roles-in-parallelcluster-v3.html)。このモードでは、[AWS ParallelCluster を使用した 2 つのサブネット](https://docs.aws.amazon.com/parallelcluster/latest/ug/network-configuration-v3.html#network-configuration-v3-two-subnets) 設定を使用します。これには、1 つのパブリック サブネット、プライベート サブネット、インターネットゲートウェイ、および NAT ゲートウェイが必要です。
+ すべての AWS ParallelCluster クラスターノードがインターネットにアクセスできる必要があります。これは、インストールスクリプトがオープンソースソフトウェアと Docker イメージをダウンロードできるようにするためです。
+ Amazon Elastic Compute Cloud (Amazon 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

**請求とコストに関する考慮事項**
+ このパターンでデプロイされるソリューションは無料利用枠の対象外です。Amazon EC2、Amazon FSx for Lustre、Amazon VPC の NAT ゲートウェイ、Amazon Route 53 には料金がかかります。　

## アーキテクチャ
<a name="set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster-architecture"></a>

**ターゲット アーキテクチャ**

以下の図では、ユーザーがヘッドノードで AWS ParallelCluster のモニタリングダッシュボードにアクセスする方法を示しています。ヘッドノードは NICE DCV、Prometheus、Grafana、Prometheus Slurm Exporter、Prometheus Node Exporter、NGINX Open Source を実行します。　 コンピュートノードは Prometheus Node Exporter を実行します。ノードに GPU が含まれている場合は NVIDIA DCGM-Exporter も実行します。ヘッドノードはコンピュートノードから情報を取得し、そのデータを Grafana ダッシュボードに表示します。　

![\[ヘッドノードで AWS ParallelCluster のモニタリングダッシュボードにアクセスします。\]](http://docs.aws.amazon.com/ja_jp/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>

**AWS サービス**
+ [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/) は、オペレーティングシステムレベルの仮想化を使用してソフトウェアをコンテナで配信するサービスとしての Platform as a Service (PaaS) 製品のセットです。
+ [Grafana](https://grafana.com/docs/grafana/latest/introduction/) は、メトリクス、ログ、トレースのクエリ、可視化、アラート表示、探索に役立つオープンソースソフトウェアです。
+ [NGINX Open Source](https://nginx.org/en/docs/?_ga=2.187509224.1322712425.1699399865-405102969.1699399865) は、オープンソースのウェブサーバーで、リバースプロキシでもあります。
+ [NVIDIA データセンター GPU マネージャー (DCGM)](https://docs.nvidia.com/data-center-gpu-manager-dcgm/index.html) は、クラスター環境で NVIDIA データセンターのグラフィックプロセッシングユニット (GPU) を管理およびモニタリングするための一連のツールです。このパターンでは、Prometheus から GPU メトリクスをエクスポートするのに役立つ [DCGM-Exporter](https://github.com/NVIDIA/dcgm-exporter) を使用します。
+ [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 ベースのオペレーティングシステムで、エンタープライズサーバー、デスクトップ、クラウド環境、IoT 向けに設計されています。

**コードリポジトリ**

このパターンのコードは、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>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| 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/ja_jp/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | Linux シェルスクリプト  | 
| 必要なファイルを 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/ja_jp/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | AWS 管理者 | 
| ヘッドノードの IAM ポリシーを設定します。 | ヘッドノードの ID ベースのポリシーを作成します。このポリシーにより、ノードは Amazon CloudWatch からメトリクスデータを取得できます。　 GitHub リポジトリには、サンプル [ポリシー](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/blob/main/policies/head_node.json)が含まれています。手順については、AWS Identity and Access Management (IAM) ドキュメントの「[IAM ポリシーの作成](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html)」を参照してください。 | AWS 管理者 | 
| コンピューティングノードの IAM ポリシーを設定します。 | コンピューティングノードの ID ベースのポリシーを作成します。このポリシーを使用すると、ノードはジョブ ID とジョブ所有者を含むタグを作成できます。GitHub リポジトリには、サンプル [ポリシー](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/blob/main/policies/compute_node.json)が含まれています。詳細については、IAM ドキュメントの「[IAM ポリシーの作成](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/ja_jp/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | AWS 管理者 | 

### クラスターを作成する
<a name="create-the-cluster"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| 提供されたクラスターテンプレートファイルを変更します。 | AWS ParallelCluster を作成します。提供されている [cluster.yaml](https://github.com/aws-samples/parallelcluster-monitoring-dashboard/blob/main/cluster.yaml) AWS CloudFormation テンプレートファイルを開始点として使用して、クラスターを作成します。提供されたテンプレートの次の値を置換します：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/prescriptive-guidance/latest/patterns/set-up-a-grafana-monitoring-dashboard-for-aws-parallelcluster.html) | AWS 管理者 | 
| クラスターを作成します。 | AWS ParallelCluster CLI で、以下のコマンドを入力します。これで、CloudFormation テンプレートがデプロイされ、クラスターが作成されます。このコマンドの詳細については、AWS ParallelCluster ドキュメントの [pcluster create-cluster](https://docs.aws.amazon.com/parallelcluster/latest/ug/pcluster.create-cluster-v3.html) を参照してください。<pre>pcluster create-cluster -n <cluster_name> -c cluster.yaml</pre> | AWS 管理者 | 
| クラスターの作成をモニタリングします。 | 以下のコマンドを入力して、クラスターの作成を監視します。このコマンドの詳細については、AWS ParallelCluster ドキュメントの [pcluster describe-cluster](https://docs.aws.amazon.com/parallelcluster/latest/ug/pcluster.describe-cluster-v3.html) を参照してください。<pre>pcluster describe-cluster -n <cluster_name></pre> | AWS 管理者 | 

### Grafana ダッシュボードを使用する
<a name="using-the-grafana-dashboards"></a>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| Grafana ポータルにアクセスします。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/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>


| タスク | 説明 | 必要なスキル | 
| --- | --- | --- | 
| クラスターを削除します。 | クラスターを削除するには、次のコマンドを入力します。このコマンドの詳細については、AWS ParallelCluster ドキュメントの [pcluster delete-cluster](https://docs.aws.amazon.com/parallelcluster/latest/ug/pcluster.delete-cluster-v3.html) を参照してください。<pre>pcluster delete-cluster -n <cluster_name></pre> | AWS 管理者 | 
| IAM ポリシーを削除します。 | ヘッドノードとコンピューティングノード用に作成したポリシーを削除します。ポリシーの削除の詳細については、IAM ドキュメントの「[IAM ポリシーの削除](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 ドキュメント**
+ 「[Amazon EC2 の IAM ポリシー](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/)