Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Quando crei un cluster Dataproc, puoi impostarlo in modalità
Hadoop ad alta affidabilità (HA) specificando il numero di istanze master nel cluster. Il numero di nodi master può essere specificato solo al momento della creazione del cluster.
Al momento, Dataproc supporta due configurazioni master:
1 master (predefinito, non HA)
3 master (Hadoop HA)
Confronto tra la modalità predefinita e la modalità Hadoop High Availability
Errore di Compute Engine: nel raro caso di un
errore imprevisto di Compute Engine, le istanze
Dataproc subiranno un riavvio del computer. La configurazione
single-master predefinita per Dataproc è progettata per recuperare e continuare l'elaborazione
di nuovi lavori in questi casi, ma i lavori in corso non andranno a buon fine e dovranno essere
riprovati e HDFS sarà inaccessibile finché il singolo NameNode non verrà recuperato completamente
al riavvio. In modalità HA, alta disponibilità HDFS e
alta disponibilità YARN
sono configurate per consentire operazioni YARN e HDFS ininterrotte nonostante eventuali
errori/riavvii a livello di singolo nodo.
Terminazione del driver del job: il driver/programma principale di tutti i job eseguiti rappresenta ancora un potenziale singolo punto di errore se la correttezza del job dipende dall'esecuzione corretta del programma driver. I job inviati tramite l'API Dataproc Jobs non sono considerati "ad alta disponibilità" e verranno comunque terminati in caso di errore del nodo master che esegue i programmi driver del job corrispondenti. Affinché
i singoli job siano resilienti ai guasti di un singolo nodo utilizzando un cluster Cloud
Dataproc HA, il job deve 1) essere eseguito senza un programma driver sincrono o 2) deve eseguire il programma driver stesso all'interno di un container YARN ed
essere scritto per gestire i riavvii del programma driver. Consulta
Avvio di Spark su YARN per un esempio
di come i programmi driver riavviabili possono essere eseguiti all'interno dei container YARN per la tolleranza
agli errori.
Errore di zona:come per tutti i cluster Dataproc, tutti i nodi di un cluster ad alta disponibilità si trovano nella stessa zona. Se si verifica un errore che
interessa tutti i nodi di una zona, l'errore non verrà mitigato.
Nomi delle istanze
Il master predefinito è denominato cluster-name-m; i master HA sono denominati
cluster-name-m-0, cluster-name-m-1, cluster-name-m-2.
Apache ZooKeeper
In un cluster Dataproc HA, il
componente Zookeeper
viene installato automaticamente sui nodi master del cluster. Tutti i nodi master
partecipano a un cluster ZooKeeper, che consente il failover automatico per
altri servizi Hadoop.
HDFS
In un cluster Dataproc standard:
cluster-name-m runs:
NameNode
NameNode secondario
In un cluster Dataproc ad alta disponibilità:
cluster-name-m-0 e cluster-name-m-1 eseguiti:
NameNode
ZKFailoverController
Tutti i master eseguono JournalNode
Non esiste un NameNode secondario
Per ulteriori dettagli sui componenti, consulta la documentazione relativa all'alta disponibilità di HDFS.
YARN
In un cluster Dataproc standard, cluster-name-m esegue ResourceManager.
In un cluster Dataproc ad alta disponibilità, tutti i master eseguono ResourceManager.
Per ulteriori dettagli sui componenti, consulta la documentazione relativa all'alta disponibilità di YARN.
Per creare un cluster HA, seleziona Alta disponibilità (3 master, N worker) nella sezione Tipo di cluster del riquadro Configura cluster nella pagina Crea un cluster di Dataproc.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 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,["When 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 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\nInstance 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\nApache 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\nHDFS\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\nYARN\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\ngcloud 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\nREST 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\nConsole\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."]]