Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Saat membuat cluster Dataproc, Anda dapat menempatkan cluster ke mode Ketersediaan Tinggi (HA) Hadoop dengan menentukan jumlah instance master dalam cluster. Jumlah master hanya dapat ditentukan pada saat pembuatan cluster.
Saat ini, Dataproc mendukung dua konfigurasi master:
1 master (default, non-HA)
3 master (HA Hadoop)
Perbandingan mode default dan Hadoop High Availability
Kegagalan Compute Engine: Jika terjadi kegagalan Compute Engine yang tidak terduga, instance Dataproc akan mengalami mulai ulang mesin. Konfigurasi master tunggal default untuk Dataproc dirancang untuk memulihkan dan melanjutkan pemrosesan tugas baru dalam kasus tersebut, tetapi tugas yang sedang berjalan pasti akan gagal dan perlu dicoba lagi, dan HDFS tidak akan dapat diakses hingga NameNode tunggal pulih sepenuhnya saat dimulai ulang. Dalam mode HA, Ketersediaan Tinggi HDFS dan
Ketersediaan Tinggi YARN
dikonfigurasi untuk memungkinkan operasi YARN dan HDFS tanpa gangguan meskipun ada
kegagalan/reboot node tunggal.
Penghentian driver tugas: Driver/program utama dari tugas apa pun yang Anda jalankan masih merupakan
potensi titik kegagalan tunggal jika kebenaran tugas Anda bergantung pada
keberhasilan menjalankan program driver. Tugas yang dikirimkan melalui Dataproc
Jobs API tidak dianggap "ketersediaan tinggi", dan akan tetap dihentikan jika terjadi kegagalan pada node master yang menjalankan program driver tugas yang sesuai. Agar
setiap tugas dapat bertahan dari kegagalan satu node menggunakan cluster Cloud
Dataproc HA, tugas harus 1) dijalankan tanpa program driver sinkron atau 2) menjalankan program driver itu sendiri di dalam container YARN dan
ditulis untuk menangani mulai ulang program driver. Lihat
Meluncurkan Spark di YARN untuk mengetahui contoh
cara program driver yang dapat dimulai ulang dapat berjalan di dalam container YARN untuk toleransi
kesalahan.
Kegagalan zona: Seperti halnya semua cluster Dataproc, semua node dalam cluster Ketersediaan Tinggi berada di zona yang sama. Jika terjadi kegagalan yang memengaruhi semua node dalam suatu zona, kegagalan tersebut tidak akan dimitigasi.
Nama Instance
Master default diberi nama cluster-name-m; master HA diberi nama
cluster-name-m-0, cluster-name-m-1, cluster-name-m-2.
Apache ZooKeeper
Di cluster Dataproc HA, komponen Zookeeper
diinstal secara otomatis di node master cluster. Semua master
berpartisipasi dalam cluster ZooKeeper, yang memungkinkan failover otomatis untuk
layanan Hadoop lainnya.
Untuk membuat cluster HA, pilih Ketersediaan Tinggi (3 master, N pekerja) di bagian Jenis cluster pada panel Siapkan cluster di halaman
Buat cluster
Dataproc.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-22 UTC."],[[["\u003cp\u003eDataproc clusters can be configured in Hadoop High Availability (HA) mode by setting the number of master instances to 3 during cluster creation, as opposed to the default of 1.\u003c/p\u003e\n"],["\u003cp\u003eHA mode provides uninterrupted YARN and HDFS operations despite single-node failures or reboots, unlike the default mode where in-flight jobs may fail during a Compute Engine failure, necessitating job retries.\u003c/p\u003e\n"],["\u003cp\u003eJobs submitted through the Dataproc Jobs API are not considered "high availability" and will be terminated if the master node running the job driver fails; if a job requires high availability, it must be launched without a driver program, or the driver program must be launched within a YARN container.\u003c/p\u003e\n"],["\u003cp\u003eIn an HA cluster, all master nodes participate in a ZooKeeper cluster to enable automatic failover, and each node runs ResourceManager, while in a default cluster, the single master runs the NameNode, Secondary NameNode, and ResourceManager.\u003c/p\u003e\n"],["\u003cp\u003eCreating an HA cluster involves using either the gcloud command with \u003ccode\u003e--num-masters=3\u003c/code\u003e, the REST API by setting \u003ccode\u003emasterConfig.numInstances\u003c/code\u003e to \u003ccode\u003e3\u003c/code\u003e, or by selecting "High Availability (3 masters, N workers)" in the Dataproc console.\u003c/p\u003e\n"]]],[],null,["# High Availability Mode\n\nWhen creating a Dataproc cluster, you can put the cluster into\nHadoop High Availability (HA) mode by\nspecifying the number of master instances in the\ncluster. The number of masters can only be specified at cluster creation time.\n\nCurrently, Dataproc supports two master configurations:\n\n- 1 master (default, non HA)\n- 3 masters (Hadoop HA)\n\nComparison of default and Hadoop High Availability mode\n-------------------------------------------------------\n\n| Due to the complexity and higher cost of HA mode, use the default mode unless your use case requires HA mode.\n\n- **Compute Engine failure:** In the rare case of an\n unexpected Compute Engine failure, Dataproc\n instances will experience a machine reboot. The default single-master\n configuration for Dataproc is designed to recover and continue processing\n new work in such cases, but in-flight jobs will necessarily fail and need to be\n retried, and HDFS will be inaccessible until the single NameNode fully recovers\n on reboot. In **HA mode** , [HDFS High Availability](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html) and\n [YARN High Availability](https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html)\n are configured to allow uninterrupted YARN and HDFS operations despite any\n single-node failures/reboots.\n\n- **Job driver termination:** The driver/main program of any jobs you run still represents a\n potential single point of failure if the correctness of your job depends on the\n driver program running successfully. Jobs submitted through the Dataproc\n Jobs API are not considered \"high availability,\" and will still be terminated on\n failure of the master node that runs the corresponding job driver programs. For\n individual jobs to be resilient against single-node failures using a HA Cloud\n Dataproc cluster, the job must either 1) run without a synchronous driver\n program or 2) it must run the driver program itself inside a YARN container and\n be written to handle driver-program restarts. See\n [Launching Spark on YARN](http://spark.apache.org/docs/latest/running-on-yarn.html#launching-spark-on-yarn) for an example\n of how restartable driver programs can run inside YARN containers for fault\n tolerance.\n\n- **Zonal failure:** As is the case with all Dataproc clusters, all nodes in a High\n Availability cluster reside in the same zone. If there is a failure that\n impacts all nodes in a zone, the failure will not be mitigated.\n\n### Instance Names\n\nThe default master is named `cluster-name-m`; HA masters are named\n`cluster-name-m-0`, `cluster-name-m-1`, `cluster-name-m-2`.\n\n### Apache ZooKeeper\n\nIn an HA Dataproc cluster, the\n[Zookeeper component](/dataproc/docs/concepts/components/zookeeper)\nis automatically installed on cluster master nodes. All masters\nparticipate in a ZooKeeper cluster, which enables automatic failover for\nother Hadoop services.\n\n### HDFS\n\nIn a standard Dataproc cluster:\n\n- `cluster-name-m` runs:\n - NameNode\n - Secondary NameNode\n\nIn a High Availability Dataproc cluster:\n\n- `cluster-name-m-0` and `cluster-name-m-1` run:\n - NameNode\n - ZKFailoverController\n- All masters run JournalNode\n- There is no Secondary NameNode\n\nPlease see the [HDFS High Availability](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html)\ndocumentation for additional details on components.\n\n### YARN\n\nIn a standard Dataproc cluster, `cluster-name-m` runs ResourceManager.\n\nIn a High Availability Dataproc cluster, all masters run ResourceManager.\n\nPlease see the [YARN High Availability](https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html)\ndocumentation for additional details on components.\n\nCreate a High Availability cluster\n----------------------------------\n\n### gcloud command\n\n\n| **gcloud CLI setup:** You must [setup and configure](/sdk/docs/quickstarts) the gcloud CLI to use the Google Cloud CLI.\nTo create an HA cluster with [gcloud dataproc clusters create](/sdk/gcloud/reference/dataproc/clusters/create), run the following command: \n\n```\ngcloud dataproc clusters create cluster-name \\\n --region=region \\\n --num-masters=3 \\\n ... other args\n```\n\n\u003cbr /\u003e\n\n### REST API\n\n\nTo create an HA cluster, use the\n[clusters.create](/dataproc/docs/reference/rest/v1/projects.regions.clusters/create)\nAPI, setting [masterConfig.numInstances](/dataproc/docs/reference/rest/v1/ClusterConfig#InstanceGroupConfig)\nto `3`.\n| An easy way to construct the JSON body of an HA cluster create request is to create the request from the Dataproc [Create a cluster](https://console.cloud.google.com/dataproc/clustersAdd) page of the Google Cloud console. Select High Availability (3 masters, N workers) in the Cluster type section of the Set up cluster panel, then click the Equivalent REST button at the bottom of the left panel. Here's a snippet of a sample JSON output produced by the console for an HA cluster create request: \n|\n| ```\n| ...\n| masterConfig\": {\n| \"numInstances\": 3,\n| \"machineTypeUri\": \"n1-standard-4\",\n| \"diskConfig\": {\n| \"bootDiskSizeGb\": 500,\n| \"numLocalSsds\": 0\n| }\n| }\n| ...\n| ```\n\n\u003cbr /\u003e\n\n### Console\n\n\nTo create an HA cluster, select High Availability (3 masters, N workers) in\nthe Cluster type section of the Set up cluster panel on the\nDataproc\n[Create a cluster](https://console.cloud.google.com/dataproc/clustersAdd)\npage."]]