View a markdown version of this page

Memecahkan masalah penerapan cluster - AWS ParallelCluster

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Memecahkan masalah penerapan cluster

Jika cluster Anda gagal dibuat dan mengembalikan pembuatan tumpukan, Anda dapat melihat melalui file log untuk mendiagnosis masalah. Pesan kegagalan kemungkinan terlihat seperti output berikut:

$ pcluster create-cluster --cluster-name mycluster --region eu-west-1 \ --cluster-configuration cluster-config.yaml { "cluster": { "clusterName": "mycluster", "cloudformationStackStatus": "CREATE_IN_PROGRESS", "cloudformationStackArn": "arn:aws:cloudformation:eu-west-1:xxx:stack/mycluster/1bf6e7c0-0f01-11ec-a3b9-024fcc6f3387", "region": "eu-west-1", "version": "3.16.1", "clusterStatus": "CREATE_IN_PROGRESS" } } $ pcluster describe-cluster --cluster-name mycluster --region eu-west-1 { "creationTime": "2021-09-06T11:03:47.696Z", ... "cloudFormationStackStatus": "ROLLBACK_IN_PROGRESS", "clusterName": "mycluster", "computeFleetStatus": "UNKNOWN", "cloudformationStackArn": "arn:aws:cloudformation:eu-west-1:xxx:stack/mycluster/1bf6e7c0-0f01-11ec-a3b9-024fcc6f3387", "lastUpdatedTime": "2021-09-06T11:03:47.696Z", "region": "eu-west-1", "clusterStatus": "CREATE_FAILED" }

Tampilan CloudFormation peristiwa di CREATE_FAILED

Anda dapat menggunakan konsol atau AWS ParallelCluster CLI untuk melihat CloudFormation peristiwa pada CREATE_FAILED kesalahan untuk membantu menemukan akar penyebabnya.

Melihat acara di CloudFormation konsol

Untuk melihat informasi lebih lanjut tentang apa yang menyebabkan "CREATE_FAILED" status, Anda dapat menggunakan CloudFormation konsol.

Lihat pesan CloudFormation kesalahan dari konsol.
  1. Masuk ke Konsol Manajemen AWS dan arahkan ke https://console.aws.amazon.com/cloudformation.

  2. Pilih tumpukan bernama cluster_name.

  3. Pilih tab Acara.

  4. Periksa Status untuk sumber daya yang gagal dibuat dengan menggulir daftar peristiwa sumber daya berdasarkan ID Logis. Jika subtugas gagal dibuat, kerjakan mundur untuk menemukan peristiwa sumber daya yang gagal.

  5. Sebagai contoh, jika Anda melihat pesan status berikut, Anda harus menggunakan jenis instans yang tidak akan melebihi batas vCPU saat ini atau meminta kapasitas vCPU yang lebih besar.

    2022-02-04 16:09:44 UTC-0800 HeadNode CREATE_FAILED You have requested more vCPU capacity than your current vCPU limit of 0 allows for the instance bucket that the specified instance type belongs to. Please visit http://aws.amazon.com/contact-us/ec2-request to request an adjustment to this limit. (Service: AmazonEC2; Status Code: 400; Error Code: VcpuLimitExceeded; Request ID: a9876543-b321-c765-d432-dcba98766789; Proxy: null).

Gunakan CLI untuk melihat dan memfilter CloudFormation peristiwa di CREATE_FAILED

Untuk mendiagnosis masalah pembuatan cluster, Anda dapat menggunakan pcluster dapatkan-kluster-tumpukan-peristiwa perintah dengan memfilter CREATE_FAILED status. Untuk informasi selengkapnya, lihat Mem AWS CLI filter keluaran di Panduan AWS Command Line Interface Pengguna.

$ pcluster get-cluster-stack-events --cluster-name mycluster --region eu-west-1 \ --query 'events[?resourceStatus==`CREATE_FAILED`]' [ { "eventId": "3ccdedd0-0f03-11ec-8c06-02c352fe2ef9", "physicalResourceId": "arn:aws:cloudformation:eu-west-1:xxx:stack/mycluster/1bf6e7c0-0f02-11ec-a3b9-024fcc6f3387", "resourceStatus": "CREATE_FAILED", "resourceStatusReason": "The following resource(s) failed to create: [HeadNode]. ", "stackId": "arn:aws:cloudformation:eu-west-1:xxx:stack/mycluster/1bf6e7c0-0f02-11ec-a3b9-024fcc6f3387", "stackName": "mycluster", "logicalResourceId": "mycluster", "resourceType": "AWS::CloudFormation::Stack", "timestamp": "2021-09-06T11:11:51.780Z" }, { "eventId": "HeadNode-CREATE_FAILED-2021-09-06T11:11:50.127Z", "physicalResourceId": "i-04e91cc1f4ea796fe", "resourceStatus": "CREATE_FAILED", "resourceStatusReason": "Received FAILURE signal with UniqueId i-04e91cc1f4ea796fe", "resourceProperties": "{\"LaunchTemplate\":{\"Version\":\"1\",\"LaunchTemplateId\":\"lt-057d2b1e687f05a62\"}}", "stackId": "arn:aws:cloudformation:eu-west-1:xxx:stack/mycluster/1bf6e7c0-0f02-11ec-a3b9-024fcc6f3387", "stackName": "mycluster", "logicalResourceId": "HeadNode", "resourceType": "AWS::EC2::Instance", "timestamp": "2021-09-06T11:11:50.127Z" } ]

Pada contoh sebelumnya, kegagalannya ada di pengaturan node kepala.

Gunakan CLI untuk melihat aliran log

Untuk men-debug masalah semacam ini, Anda dapat membuat daftar aliran log yang tersedia dari node kepala pcluster daftar-cluster-log-aliran dengan memfilter node-type dan kemudian menganalisis konten aliran log.

$ pcluster list-cluster-log-streams --cluster-name mycluster --region eu-west-1 \ --filters 'Name=node-type,Values=HeadNode' { "logStreams": [ { "logStreamArn": "arn:aws:logs:eu-west-1:xxx:log-group:/aws/parallelcluster/mycluster-202109061103:log-stream:ip-10-0-0-13.i-04e91cc1f4ea796fe.cfn-init", "logStreamName": "ip-10-0-0-13.i-04e91cc1f4ea796fe.cfn-init", ... }, { "logStreamArn": "arn:aws:logs:eu-west-1:xxx:log-group:/aws/parallelcluster/mycluster-202109061103:log-stream:ip-10-0-0-13.i-04e91cc1f4ea796fe.chef-client", "logStreamName": "ip-10-0-0-13.i-04e91cc1f4ea796fe.chef-client", ... }, { "logStreamArn": "arn:aws:logs:eu-west-1:xxx:log-group:/aws/parallelcluster/mycluster-202109061103:log-stream:ip-10-0-0-13.i-04e91cc1f4ea796fe.cloud-init", "logStreamName": "ip-10-0-0-13.i-04e91cc1f4ea796fe.cloud-init", ... }, ... ] }

Dua aliran log utama yang dapat Anda gunakan untuk menemukan kesalahan inisialisasi adalah sebagai berikut:

  • cfn-initadalah log untuk cfn-init skrip. Pertama periksa aliran log ini. Anda kemungkinan akan melihat Command chef failed kesalahan di log ini. Lihatlah garis tepat sebelum baris ini untuk lebih spesifik terkait dengan pesan kesalahan. Untuk informasi selengkapnya, lihat cfn-init.

  • cloud-initadalah log untuk cloud-init. Jika Anda tidak melihat apa pun di cfn-init dalamnya, coba periksa log ini selanjutnya.

Anda dapat mengambil konten aliran log dengan menggunakan pcluster get-cluster-log-event (perhatikan --limit 5 opsi untuk membatasi jumlah peristiwa yang diambil):

$ pcluster get-cluster-log-events --cluster-name mycluster \ --region eu-west-1 --log-stream-name ip-10-0-0-13.i-04e91cc1f4ea796fe.cfn-init \ --limit 5 { "nextToken": "f/36370880979637159565202782352491087067973952362220945409/s", "prevToken": "b/36370880752972385367337528725601470541902663176996585497/s", "events": [ { "message": "2021-09-06 11:11:39,049 [ERROR] Unhandled exception during build: Command runpostinstall failed", "timestamp": "2021-09-06T11:11:39.049Z" }, { "message": "Traceback (most recent call last):\n File \"/opt/aws/bin/cfn-init\", line 176, in <module>\n worklog.build(metadata, configSets)\n File \"/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py\", line 135, in build\n Contractor(metadata).build(configSets, self)\n File \"/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py\", line 561, in build\n self.run_config(config, worklog)\n File \"/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py\", line 573, in run_config\n CloudFormationCarpenter(config, self._auth_config).build(worklog)\n File \"/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py\", line 273, in build\n self._config.commands)\n File \"/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py\", line 127, in apply\n raise ToolError(u\"Command %s failed\" % name)", "timestamp": "2021-09-06T11:11:39.049Z" }, { "message": "cfnbootstrap.construction_errors.ToolError: Command runpostinstall failed", "timestamp": "2021-09-06T11:11:39.049Z" }, { "message": "2021-09-06 11:11:49,212 [DEBUG] CloudFormation client initialized with endpoint https://cloudformation.eu-west-1.amazonaws.com", "timestamp": "2021-09-06T11:11:49.212Z" }, { "message": "2021-09-06 11:11:49,213 [DEBUG] Signaling resource HeadNode in stack mycluster with unique ID i-04e91cc1f4ea796fe and status FAILURE", "timestamp": "2021-09-06T11:11:49.213Z" } ] }

Pada contoh sebelumnya, kegagalan disebabkan oleh runpostinstall kegagalan, sehingga sangat terkait dengan konten skrip bootstrap kustom yang digunakan dalam parameter OnNodeConfigured konfigurasi. CustomActions

Re-create cluster yang gagal dengan rollback-on-failure

AWS ParallelCluster membuat aliran CloudWatch log cluster dalam grup log. Anda dapat melihat log ini di CloudWatch konsol Custom Dashboards atau grup Log. Untuk informasi selengkapnya, lihat Integrasi dengan Amazon CloudWatch Logs dan CloudWatch Dasbor Amazon. Jika tidak ada aliran log yang tersedia, kegagalan mungkin disebabkan oleh skrip bootstrap CustomActions khusus atau AMI-related masalah. Untuk mendiagnosis masalah pembuatan dalam kasus ini, buat cluster lagi menggunakanpcluster buat-klaster, termasuk --rollback-on-failure parameter yang disetel kefalse. Kemudian, gunakan SSH untuk melihat cluster, seperti yang ditunjukkan sebagai berikut:

$ pcluster create-cluster --cluster-name mycluster --region eu-west-1 \ --cluster-configuration cluster-config.yaml --rollback-on-failure false { "cluster": { "clusterName": "mycluster", "cloudformationStackStatus": "CREATE_IN_PROGRESS", "cloudformationStackArn": "arn:aws:cloudformation:eu-west-1:xxx:stack/mycluster/1bf6e7c0-0f01-11ec-a3b9-024fcc6f3387", "region": "eu-west-1", "version": "3.16.1", "clusterStatus": "CREATE_IN_PROGRESS" } } $ pcluster ssh --cluster-name mycluster

Setelah Anda masuk ke node kepala, Anda harus menemukan tiga file log utama yang dapat Anda gunakan untuk menemukan kesalahan.

  • /var/log/cfn-init.logadalah log untuk cfn-init skrip. Pertama periksa log ini. Anda mungkin melihat kesalahan seperti Command chef failed di log ini. Lihatlah garis tepat sebelum baris ini untuk lebih spesifik terkait dengan pesan kesalahan. Untuk informasi selengkapnya, lihat cfn-init.

  • /var/log/cloud-init.logadalah log untuk cloud-init. Jika Anda tidak melihat apa pun di cfn-init.log dalamnya, coba periksa log ini selanjutnya.

  • /var/log/cloud-init-output.logadalah output dari perintah yang dijalankan oleh cloud-init. Ini termasuk output daricfn-init. Dalam kebanyakan kasus, Anda tidak perlu melihat log ini untuk memecahkan masalah jenis ini.