Guida rapida: crea un lake
Questo documento mostra come iniziare a utilizzare Dataplex Universal Catalog nella consoleGoogle Cloud , guidandoti attraverso la creazione di un lake, l'aggiunta di una zona e il collegamento di un asset.
Prima di iniziare
- 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.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Dataplex Universal Catalog, Dataproc, Dataproc Metastore, BigQuery, and Cloud Storage APIs.
-
Make sure that you have the following role or roles on the project:
roles/dataplex.admin
,roles/dataplex.editor
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Vai a IAM - Seleziona il progetto.
- Fai clic su Concedi l'accesso.
-
Nel campo Nuove entità, inserisci il tuo identificatore utente. In genere si tratta dell'indirizzo email di un Account Google.
- Nell'elenco Seleziona un ruolo, seleziona un ruolo.
- Per concedere altri ruoli, fai clic su Aggiungi un altro ruolo e aggiungi ogni ruolo aggiuntivo.
- Fai clic su Salva.
-
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Dataplex Universal Catalog, Dataproc, Dataproc Metastore, BigQuery, and Cloud Storage APIs.
-
Make sure that you have the following role or roles on the project:
roles/dataplex.admin
,roles/dataplex.editor
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Vai a IAM - Seleziona il progetto.
- Fai clic su Concedi l'accesso.
-
Nel campo Nuove entità, inserisci il tuo identificatore utente. In genere si tratta dell'indirizzo email di un Account Google.
- Nell'elenco Seleziona un ruolo, seleziona un ruolo.
- Per concedere altri ruoli, fai clic su Aggiungi un altro ruolo e aggiungi ogni ruolo aggiuntivo.
- Fai clic su Salva.
-
- Crea un bucket Cloud Storage:
- In the Google Cloud console, go to the Cloud Storage Buckets page.
- Click Create.
- On the Create a bucket page, enter your bucket information. To go to the next
step, click Continue.
- For Name your bucket, enter a unique bucket name. Don't include sensitive information in the bucket name, because the bucket namespace is global and publicly visible.
-
In the Choose where to store your data section, do the following:
- Select a Location type.
- Choose a location where your bucket's data is permanently stored from the Location type drop-down menu.
- If you select the dual-region location type, you can also choose to enable turbo replication by using the relevant checkbox.
- To set up cross-bucket replication, select
Add cross-bucket replication via Storage Transfer Service and
follow these steps:
Set up cross-bucket replication
- In the Bucket menu, select a bucket.
In the Replication settings section, click Configure to configure settings for the replication job.
The Configure cross-bucket replication pane appears.
- To filter objects to replicate by object name prefix, enter a prefix that you want to include or exclude objects from, then click Add a prefix.
- To set a storage class for the replicated objects, select a storage class from the Storage class menu. If you skip this step, the replicated objects will use the destination bucket's storage class by default.
- Click Done.
-
In the Choose how to store your data section, do the following:
- In the Set a default class section, select the following: Standard.
- To enable hierarchical namespace, in the Optimize storage for data-intensive workloads section, select Enable hierarchical namespace on this bucket.
- In the Choose how to control access to objects section, select whether or not your bucket enforces public access prevention, and select an access control method for your bucket's objects.
-
In the Choose how to protect object data section, do the
following:
- Select any of the options under Data protection that you
want to set for your bucket.
- To enable soft delete, click the Soft delete policy (For data recovery) checkbox, and specify the number of days you want to retain objects after deletion.
- To set Object Versioning, click the Object versioning (For version control) checkbox, and specify the maximum number of versions per object and the number of days after which the noncurrent versions expire.
- To enable the retention policy on objects and buckets, click the Retention (For compliance) checkbox, and then do the following:
- To enable Object Retention Lock, click the Enable object retention checkbox.
- To enable Bucket Lock, click the Set bucket retention policy checkbox, and choose a unit of time and a length of time for your retention period.
- To choose how your object data will be encrypted, expand the Data encryption section (Data encryption method. ), and select a
- Select any of the options under Data protection that you
want to set for your bucket.
- Click Create.
Crea un lake
Un lake è un costrutto logico che rappresenta un dominio di dati o un'unità aziendale. Ad esempio, se devi organizzare i dati in base all'utilizzo dei gruppi, devi creare un lake per ogni reparto (ad esempio, vendita al dettaglio, vendite e finanza).
I seguenti passaggi mostrano come creare un lake utilizzando la console Google Cloud .
Vai a Dataplex Universal Catalog nella console Google Cloud .
Vai alla visualizzazione Gestisci.
Fai clic su
Crea.Inserisci un nome visualizzato.
L'ID del lago viene generato automaticamente.
Specifica la Regione in cui creare il lake.
Per i lake creati in una determinata regione (ad esempio
us-central1
), è possibile associare i dati sia a singola regione (us-central1
) che a più regioni (us multi-region
) a seconda delle impostazioni della zona.Fai clic su Crea.
aggiungi una zona al lake
Dopo averlo creato, puoi aggiungere zone al lake. Le zone sono raggruppamenti logici all'interno di un lake, utili per classificare dati strutturati e non strutturati.
Nella visualizzazione Gestisci, fai clic sul nome del lake a cui vuoi aggiungere una zona.
Fai clic su
Aggiungi zona.Inserisci un nome visualizzato per la zona.
Fai clic sul menu a discesa Tipo. Scegli Zona non elaborata o Zona organizzata. Scopri di più sui tipi di zone.
In Località dei dati seleziona Regionale o Più regioni. La scelta effettuata non potrà essere modificata in un secondo momento. Non è possibile combinare dati a livello di una singola regione e di più regioni nella stessa zona.
Fai clic su Crea.
La creazione della zona può richiedere alcuni minuti.
Allegare un asset
I dati possono essere archiviati nei bucket Cloud Storage o nei set di dati BigQuery e possono essere collegati come asset alle zone di dati all'interno di un lake Dataplex Universal Catalog.
Per collegare il bucket Cloud Storage come asset:
Nella visualizzazione Gestisci, fai clic sul nome del lake a cui vuoi collegare un bucket Cloud Storage.
Nella scheda Zone, fai clic sulla zona a cui aggiungere l'asset.
Nella scheda Asset, fai clic su
Aggiungi asset.Fai clic su Aggiungi un asset.
In Tipo, seleziona Bucket di archiviazione.
In Nome visualizzato, inserisci un nome per l'asset.
Nel campo Bucket, fai clic su Sfoglia. Se hai un bucket Cloud Storage, trovalo e fai clic su Seleziona. Se non hai un bucket Cloud Storage, puoi crearne uno facendo clic sul pulsante
.Inserisci un nome univoco per il bucket. Fai clic su Continua.
Scegli un Tipo di località. Fai clic su Continua.
Scegli una classe di archiviazione predefinita per i tuoi dati. Fai clic su Continua.
Scegli un livello di controllo dell'accesso. Fai clic su Continua.
Scegli un'opzione di protezione dei dati o Nessuna. Fai clic su Continua.
Fai clic su Crea.
Fai clic su Seleziona
Fai clic su Fine.
Fai clic su Continua.
In Impostazioni di rilevamento, seleziona Eredita per ereditare le impostazioni di rilevamento dal livello di zona.
Fai clic su Continua.
Nella sezione Aggiungi asset, fai clic su Invia.
Attendi il completamento della creazione dell'asset.
Per utilizzare il tuo lake, consulta la sezione Passaggi successivi. In caso contrario, elimina le risorse che hai creato seguendo i passaggi della sezione Pulizia.
Esegui la pulizia
Per evitare che al tuo account Google Cloud vengano addebitati costi relativi alle risorse utilizzate in questa pagina, segui questi passaggi.
- In the Google Cloud console, go to the Manage resources page.
- If the project that you plan to delete is attached to an organization, expand the Organization list in the Name column.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
In alternativa, puoi eliminare le risorse utilizzate in questo tutorial. Un lago non viene eliminato finché non elimini tutte le risorse della zona dati. Analogamente, una zona di dati non viene eliminata a meno che non vengano eliminate tutte le relative risorse asset.
Scollega il bucket di archiviazione
Per scollegare l'asset Dataplex Universal Catalog che hai creato, segui questi passaggi:
Vai a Dataplex Universal Catalog nella console Google Cloud .
Nella visualizzazione Gestisci, fai clic sul nome del lake che hai creato.
Nella scheda Zone, fai clic sul nome della zona che hai creato.
Nella scheda Asset, seleziona l'asset da scollegare selezionando la casella a sinistra del nome del bucket.
Fai clic su Elimina asset.
Fai clic su Elimina per confermare il distacco.
Eliminare la zona
Per eliminare la zona Dataplex Universal Catalog che hai creato, segui questi passaggi:
Vai a Dataplex Universal Catalog nella console Google Cloud .
Nella visualizzazione Gestisci, fai clic sul lake che hai creato.
Nella scheda Zone, seleziona la zona da eliminare selezionando la casella a sinistra del nome della zona di dati.
Fai clic su Elimina zona.
Fai clic su Elimina per confermare l'eliminazione.
Elimina il lake
I seguenti passaggi mostrano come eliminare il lake Dataplex Universal Catalog che hai creato.
Vai a Dataplex Universal Catalog nella console Google Cloud .
Nella visualizzazione Gestisci, fai clic sul lake che hai creato.
Nella parte superiore della pagina, fai clic su Elimina.
Conferma l'eliminazione digitando "delete" nel campo.
Fai clic su Elimina lake per confermare l'eliminazione.