Membuat cluster Dataproc menggunakan template

Halaman ini menunjukkan cara menggunakan template Google APIs Explorer inline untuk memanggil Dataproc API guna membuat cluster Dataproc.

Untuk cara lain membuat cluster, lihat:

Sebelum memulai

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Pastikan Anda memiliki izin yang diperlukan untuk menyelesaikan panduan ini.

  4. Verify that billing is enabled for your Google Cloud project.

  5. Enable the Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. Pastikan Anda memiliki izin yang diperlukan untuk menyelesaikan panduan ini.

  8. Verify that billing is enabled for your Google Cloud project.

  9. Enable the Dataproc API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

  10. Peran yang diperlukan

    Peran IAM tertentu diperlukan untuk menjalankan contoh di halaman ini. Bergantung pada kebijakan organisasi, peran ini mungkin sudah diberikan. Untuk memeriksa pemberian peran, lihat Apakah Anda perlu memberikan peran?.

    Untuk mengetahui informasi selengkapnya tentang pemberian peran, lihat Mengelola akses ke project,folder, dan organisasi.

    Peran pengguna

    Untuk mendapatkan izin yang Anda perlukan untuk membuat cluster Dataproc, minta administrator untuk memberi Anda peran IAM berikut:

    Peran akun layanan

    Untuk memastikan bahwa akun layanan default Compute Engine memiliki izin yang diperlukan untuk membuat cluster Dataproc, minta administrator Anda untuk memberikan peran IAM Dataproc Worker (roles/dataproc.worker) kepada akun layanan default Compute Engine di project.

    Membuat cluster

    Sebelum dapat menjalankan tugas Dataproc, Anda harus membuat cluster mesin virtual untuk menjalankannya. Untuk membuat cluster Dataproc di project Anda, isi dan jalankan template Coba API ini Google APIs Explorer.

    1. Parameter permintaan:

      1. Masukkan projectId Anda.
      2. Tentukan region tempat cluster Anda akan berada (terima atau ganti "us-central1"). Karena Anda tidak menentukan zona dalam region di panduan memulai ini, penempatan Zona Otomatis Dataproc akan memilih zona dalam region tempat cluster akan dibuat.
    2. Isi permintaan:

      1. Tentukan clusterName, (terima atau ganti "example-cluster"). Anda akan menggunakan nama ini untuk berinteraksi dengan cluster, misalnya saat Anda mengirimkan tugas atau memperbarui cluster.
    3. Klik EXECUTE. Saat pertama kali menjalankan template API, Anda mungkin diminta untuk memilih dan login ke Akun Google Anda, lalu mengizinkan Google API Explorer mengakses akun Anda. Jika permintaan berhasil, respons JSON menunjukkan bahwa pembuatan cluster sedang menunggu keputusan.

    4. Untuk mengonfirmasi pembuatan cluster, buka halaman Dataproc Clusters di konsol Google Cloud . Setelah penyediaan cluster selesai, status cluster akan ditampilkan sebagai "Berjalan".

    Pembersihan

    Agar akun Google Cloud Anda tidak dikenai biaya untuk resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut.

    1. Jika Anda tidak memerlukan cluster untuk menjelajahi panduan memulai lainnya atau menjalankan tugas lain, gunakan APIs Explorer, konsolGoogle Cloud , alat command line gcloud CLI gcloud, atau Cloud Client Libraries untuk menghapus cluster.

    Langkah berikutnya