

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 嘗試建立叢集
<a name="troubleshooting-fc-v3-create-cluster"></a>

使用 3.5.0 版和更新 AWS ParallelCluster 版本來建立叢集時，如果叢集建立失敗，並將 `--rollback-on-failure` 設為 `false`，請使用 [`pcluster describe-cluster`](pcluster.describe-cluster-v3.md) CLI 命令來取得狀態和失敗資訊。在此情況下，`pcluster describe-cluster`輸出`clusterStatus`的預期值為 `CREATE_FAILED`。檢查輸出中的 `failures`區段以尋找 `failureCode`和 `failureReason`。然後，在下一節中，尋找其他故障診斷說明`failureCode`的相符項目。如需詳細資訊，請參閱[`pcluster describe-cluster`](pcluster.describe-cluster-v3.md)。

在下列各節中，我們建議您檢查前端節點上的日誌，例如 `/var/log/cfn-init.log`和 `/var/log/chef-client.log` 檔案。如需 AWS ParallelCluster 日誌以及如何檢視它們的詳細資訊，請參閱 [除錯的金鑰日誌](troubleshooting-v3-scaling-issues.md#troubleshooting-v3-key-logs)和 [擷取和保留日誌](troubleshooting-v3-get-logs.md)。

如果您沒有 `failureCode`，請導覽至 CloudFormation 主控台以檢視叢集堆疊。檢查`Status Reason`其他資源上的 `HeadNodeWaitCondition`或 失敗，以尋找其他失敗詳細資訊。如需詳細資訊，請參閱[在 上檢視 CloudFormation 事件 `CREATE_FAILED`](troubleshooting-v3-cluster-deployment.md#troubleshooting-v3-cluster-deployment-events)。檢查前端節點上的 `/var/log/cfn-init.log`和 `/var/log/chef-client.log` 檔案。如果叢集建立因為前端節點建立失敗而失敗，且叢集日誌無法在叢集日誌群組中使用，您必須在失敗時保留叢集，指定 `--rollback-on-failure` = `True`並從前端節點本身擷取日誌。

## `failureCode` 是 `OnNodeConfiguredExecutionFailure`
<a name="create-cluster-on-node-configured-executed-failure-v3"></a>
+ **為什麼失敗？**

  您已在組態中前端節點區段`OnNodeConfigured`的 中提供自訂指令碼，以建立叢集。不過，自訂指令碼無法執行。
+ **如何解決？**

  檢查 `/var/log/cfn-init.log` 檔案以進一步了解故障，以及如何修正自訂指令碼中的問題。在此日誌結尾附近，您可能會在`Running command runpostinstall`訊息之後看到與`OnNodeConfigured`指令碼相關的執行資訊。

## `failureCode` 是 `OnNodeConfiguredDownloadFailure`
<a name="create-cluster-on-node-configured-download-failure-v3"></a>
+ **為什麼失敗？**

  您已在組態中前端節點區段`OnNodeConfigured`的 中提供自訂指令碼，以建立叢集。不過，自訂指令碼無法下載。
+ **如何解決？**

  請確定 URL 有效且已正確設定存取。如需自訂引導指令碼組態的詳細資訊，請參閱 [自訂引導操作](custom-bootstrap-actions-v3.md)。

  檢查 `/var/log/cfn-init.log`檔案。在接近此日誌結尾處，您可能會在`Running command runpostinstall`訊息之後看到與`OnNodeConfigured`指令碼處理相關的執行資訊，包括下載。

## `failureCode` 是 `OnNodeConfiguredFailure`
<a name="create-cluster-on-node-configured-failure-v3"></a>
+ **為什麼失敗？**

  您已在組態中前端節點區段`OnNodeConfigured`的 中提供自訂指令碼，以建立叢集。不過，在叢集部署中使用自訂指令碼失敗。無法判斷立即原因，且需要額外調查。
+ **如何解決？**

  檢查 `/var/log/cfn-init.log`檔案。在接近此日誌結尾處，您可能會在`Running command runpostinstall`訊息後看到`OnNodeConfigured`指令碼處理的相關資訊。

## `failureCode` 是 `OnNodeStartExecutionFailure`
<a name="create-cluster-on-node-start-execution-failure-v3"></a>
+ **為什麼失敗？**

  您已在組態中前端節點區段`OnNodeStart`的 中提供自訂指令碼，以建立叢集。不過，自訂指令碼無法執行。
+ **如何解決？**

  檢查 `/var/log/cfn-init.log` 檔案以進一步了解故障，以及如何修正自訂指令碼中的問題。在此日誌結尾附近，您可能會在`Running command runpreinstall`訊息之後看到與`OnNodeStart`指令碼相關的執行資訊。

## `failureCode` 是 `OnNodeStartDownloadFailure`
<a name="create-cluster-on-node-start-download-failure-v3"></a>
+ **為什麼失敗？**

  您已在組態中前端節點區段`OnNodeStart`的 中提供自訂指令碼，以建立叢集。不過，自訂指令碼無法下載。
+ **如何解決？**

  請確定 URL 有效且已正確設定存取。如需自訂引導指令碼組態的詳細資訊，請參閱 [自訂引導操作](custom-bootstrap-actions-v3.md)。

  檢查 `/var/log/cfn-init.log`檔案。在接近此日誌結尾處，您可能會在`Running command runpreinstall`訊息之後看到與`OnNodeStart`指令碼處理相關的執行資訊，包括下載。

## `failureCode` 是 `OnNodeStartFailure`
<a name="create-cluster-on-node-start-failure-v3"></a>
+ **為什麼失敗？**

  您在組態中前端節點區段`OnNodeStart`的 中提供自訂指令碼，以建立叢集。不過，在叢集部署中使用自訂指令碼失敗。無法判斷立即原因，且需要額外調查。
+ **如何解決？**

  檢查 `/var/log/cfn-init.log`檔案。在接近此日誌結尾處，您可能會在`Running command runpreinstall`訊息後看到與`OnNodeStart`指令碼處理相關的資訊。

## `failureCode` 是 `EbsMountFailure`
<a name="create-cluster-ebs-mount-failure-v3"></a>
+ **為什麼失敗？**

  叢集組態中定義的 EBS 磁碟區無法掛載。
+ **如何解決？**

  檢查 `/var/log/chef-client.log` 檔案以取得失敗詳細資訊。

## `failureCode` 是 `EfsMountFailure`
<a name="create-cluster-efs-mount-failure-v3"></a>
+ **為什麼失敗？**

  叢集組態中定義的 Amazon EFS 磁碟區無法掛載。
+ **如何解決？**

  如果您定義了現有的 Amazon EFS 檔案系統，請確定叢集和檔案系統之間允許流量。如需詳細資訊，請參閱 [`SharedStorage`](SharedStorage-v3.md) / [`EfsSettings`](SharedStorage-v3.md#SharedStorage-v3-EfsSettings) / [`FileSystemId`](SharedStorage-v3.md#yaml-SharedStorage-EfsSettings-FileSystemId)。

  檢查 `/var/log/chef-client.log` 檔案以取得失敗詳細資訊。

## `failureCode` 是 `FsxMountFailure`
<a name="create-cluster-fsx-mount-failure-v3"></a>
+ **為什麼失敗？**

  叢集組態中定義的 Amazon FSx 檔案系統無法掛載。
+ **如何解決？**

  如果您定義了現有的 Amazon FSx 檔案系統，請確定叢集和檔案系統之間允許流量。如需詳細資訊，請參閱 [`SharedStorage`](SharedStorage-v3.md) / [`FsxLustreSettings`](SharedStorage-v3.md#SharedStorage-v3-FsxLustreSettings) / [`FileSystemId`](SharedStorage-v3.md#yaml-SharedStorage-FsxLustreSettings-FileSystemId)。

  檢查 `/var/log/chef-client.log` 檔案以取得失敗詳細資訊。

## `failureCode` 是 `RaidMountFailure`
<a name="create-cluster-raid-mount-failure-v3"></a>
+ **為什麼失敗？**

  叢集組態中定義的 RAID 磁碟區無法掛載。
+ **如何解決？**

  檢查 `/var/log/chef-client.log` 檔案以取得失敗詳細資訊。

## `failureCode` 是 `AmiVersionMismatch`
<a name="create-cluster-ami-version-mismatch-v3"></a>
+ **為什麼失敗？**

  用於建立自訂 AMI 的 AWS ParallelCluster 版本與用於設定叢集的 AWS ParallelCluster 版本不同。在 CloudFormation 主控台中，檢視叢集 CloudFormation 堆疊詳細資訊，並檢查 `Status Reason` 以取得 AWS ParallelCluster 版本和 AMI `HeadNodeWaitCondition`的其他詳細資訊。如需詳細資訊，請參閱[在 上檢視 CloudFormation 事件 `CREATE_FAILED`](troubleshooting-v3-cluster-deployment.md#troubleshooting-v3-cluster-deployment-events)。
+ **如何解決？**

  確定用於建立自訂 AMI 的 AWS ParallelCluster 版本與用於設定叢集的 AWS ParallelCluster 版本相同。您可以變更自訂 AMI 版本或 `pcluster` CLI 版本，使其相同。

## `failureCode` 是 `InvalidAmi`
<a name="create-cluster-invalid-ami-v3"></a>
+ **為什麼失敗？**

  自訂 AMI 無效，因為它不是使用 建置的 AWS ParallelCluster。
+ **如何解決？**

  使用 `pcluster build-image`命令讓 AMI 成為父映像，以建立 AMI。如需詳細資訊，請參閱[`pcluster build-image`](pcluster.build-image-v3.md)。

## `failureCode` `HeadNodeBootstrapFailure`具有`failureReason`無法設定前端節點的 。
<a name="create-cluster-head-node-bootstrap-setup-failure-v3"></a>
+ **為什麼失敗？**

  無法判斷立即原因，且需要額外調查。例如，叢集可能處於受保護狀態，這可能是因為無法佈建靜態運算機群所致。
+ **如何解決？**

  檢查 `/var/log/chef-client.log.` 檔案以取得失敗詳細資訊。
**注意**  
如果您看到`RuntimeError`例外狀況 `Cluster state has been set to PROTECTED mode due to failures detected in static node provisioning`，則叢集處於受保護狀態。如需詳細資訊，請參閱[如何偵錯受保護模式](slurm-protected-mode-v3.md#slurm-protected-mode-debug-v3)。

## `failureCode` 是 `failureReason` `HeadNodeBootstrapFailure`，叢集建立逾時。
<a name="create-cluster-head-node-bootstrap-timeout-failure-v3"></a>
+ **為什麼失敗？**

  根據預設，叢集建立需要 30 分鐘的時間限制才能完成。如果叢集建立未在此時間範圍內完成，叢集建立會失敗並出現逾時錯誤。叢集建立可能因不同原因而逾時。例如，逾時失敗可能是由前端節點建立失敗、網路問題、在前端節點中執行時間過長的自訂指令碼、在運算節點中執行的自訂指令碼中的錯誤，或運算節點佈建的等待時間過長所造成。無法判斷立即原因，且需要額外調查。
+ **如何解決？**

  檢查 `/var/log/cfn-init.log`和 `/var/log/chef-client.log` 檔案以取得失敗詳細資訊。如需日誌以及如何取得它們的詳細資訊 AWS ParallelCluster ，請參閱 [除錯的金鑰日誌](troubleshooting-v3-scaling-issues.md#troubleshooting-v3-key-logs)和 [擷取和保留日誌](troubleshooting-v3-get-logs.md)。

  您可能會在這些日誌中發現以下內容。
  + **在 的結尾`Waiting for static fleet capacity provisioning`附近看到 `chef-client.log`**

    這表示等待靜態節點啟動時，叢集建立逾時。如需詳細資訊，請參閱[查看運算節點初始化中的錯誤](troubleshooting-fc-v3-compute-node-initialization-v3.md)。
  + **查看`OnNodeConfigured`或`OnNodeStart`前端節點指令碼尚未在 結尾完成 `cfn-init.log`**

    這表示 `OnNodeConfigured`或 `OnNodeStart` 自訂指令碼需要很長時間才能執行，並導致逾時錯誤。檢查您的自訂指令碼是否有可能導致其長時間執行的問題。如果您的自訂指令碼需要很長的時間來執行，請考慮將`DevSettings`區段新增至叢集組態檔案來變更逾時限制，如下列範例所示：

    ```
    DevSettings:
      Timeouts:
        HeadNodeBootstrapTimeout: 1800 # default setting: 1800 seconds
    ```
  + **找不到日誌，或前端節點未成功建立**

    前端節點可能無法成功建立，也找不到日誌。在這種情況下，您可以檢查 CloudFormation 堆疊事件和前端節點主控台日誌，以取得其他失敗詳細資訊。您可以透過 Amazon EC2 主控台或執行下列 Amazon EC2 CLI 命令來擷取前端節點主控台日誌：

    ```
    aws ec2 get-console-output --instance-id HEAD_NODE_INSTANCE_ID --output text
    ```

## `failureCode` `HeadNodeBootstrapFailure`具有`failureReason`無法引導前端節點的 。
<a name="create-cluster-head-node-bootstrap-failure-v3"></a>
+ **為什麼失敗？**

  無法判斷立即原因，且需要額外調查。
+ **如何解決？**

  檢查 `/var/log/cfn-init.log`和 `/var/log/chef-client.log` 檔案。

## `failureCode` 是 `ResourceCreationFailure`
<a name="create-cluster-resource-creation-failure-v3"></a>
+ **為什麼失敗？**

  在叢集建立程序期間，某些資源的建立失敗。失敗可能因為各種原因而發生。例如，資源建立失敗的原因可能是容量問題或設定錯誤的 IAM 政策。
+ **如何解決？**

  在 CloudFormation 主控台中，檢視叢集堆疊以檢查其他資源建立失敗詳細資訊。

## `failureCode` 是 `ClusterCreationFailure`
<a name="cluster-creation-failure-v3"></a>
+ **為什麼失敗？**

  無法判斷立即原因，且需要額外調查。
+ **如何解決？**

  在 CloudFormation 主控台中，檢視叢集堆疊並檢查 `Status Reason` 以取得`HeadNodeWaitCondition`其他失敗詳細資訊。

  檢查 `/var/log/cfn-init.log`和 `/var/log/chef-client.log` 檔案。

## 在 CloudFormation 堆疊`WaitCondition timed out...`中查看
<a name="create-cluster-wait-condition-timeout-v3"></a>

如需詳細資訊，請參閱[`failureCode` 是 `failureReason` `HeadNodeBootstrapFailure`，叢集建立逾時。](#create-cluster-head-node-bootstrap-timeout-failure-v3)。

## 在 CloudFormation 堆疊`Resource creation cancelled`中查看
<a name="create-cluster-resource-create-error-v3"></a>

如需詳細資訊，請參閱[`failureCode` 是 `ResourceCreationFailure`](#create-cluster-resource-creation-failure-v3)。

## 在 CloudFormation 堆疊中查看 `Failed to run cfn-init...`或其他錯誤
<a name="create-cluster-cfn-init-fail-error-v3"></a>

如需其他失敗詳細資訊，`/var/log/chef-client.log`請參閱 `/var/log/cfn-init.log`和 。

## 查看以 `chef-client.log`結尾 `INFO: Waiting for static fleet capacity provisioning`
<a name="create-cluster-wait-on-fleet-capacity-v3"></a>

這與等待靜態節點啟動時的叢集建立逾時有關。如需詳細資訊，請參閱[查看運算節點初始化中的錯誤](troubleshooting-fc-v3-compute-node-initialization-v3.md)。

## 查看 `Failed to run preinstall or postinstall in cfn-init.log`
<a name="create-cluster-pre-post-install-v3"></a>

您在叢集組態`HeadNode`區段中有 `OnNodeConfigured`或 `OnNodeStart`指令碼。指令碼無法正常運作。檢查 `/var/log/cfn-init.log` 檔案以取得自訂指令碼錯誤詳細資訊。

## 在 CloudFormation 堆疊`This AMI was created with xxx, but is trying to be used with xxx...`中查看
<a name="create-cluster-ami-mismatch-error-v3"></a>

如需詳細資訊，請參閱[`failureCode` 是 `AmiVersionMismatch`](#create-cluster-ami-version-mismatch-v3)。

## 在 CloudFormation 堆疊`This AMI was not baked by AWS ParallelCluster...`中查看
<a name="create-cluster-ami-incomplete-error-v3"></a>

如需詳細資訊，請參閱[`failureCode` 是 `InvalidAmi`](#create-cluster-invalid-ami-v3)。

## 查看`pcluster create-cluster`命令無法在本機執行
<a name="create-cluster-pcluster-cli-error-v3"></a>

如需失敗詳細資訊，`~/.parallelcluster/pcluster-cli.log`請參閱本機檔案系統中的 。

## 其他支援
<a name="create-cluster-additional-support-v3"></a>

請遵循中的疑難排解指引[對叢集部署問題進行故障診斷](troubleshooting-v3-cluster-deployment.md)。

檢查 [GitHub 上的 GitHub 已知問題](https://github.com/aws/aws-parallelcluster/wiki)是否涵蓋您的案例 AWS ParallelCluster GitHub 。