Dataproc mendukung endpoint regional berdasarkan region Compute Engine. Anda harus menentukan region, seperti "us-east1" atau "europe-west1", saat membuat cluster Dataproc. Dataproc akan mengisolasi resource cluster, seperti instance VM dan Cloud Storage serta penyimpanan metadata, dalam zona di region yang ditentukan.
Secara opsional, Anda dapat menentukan zona dalam region cluster yang ditentukan, seperti "us-east1-a" atau "europe-west1-b", saat membuat cluster. Jika Anda tidak menentukan zona, Penempatan Zona Otomatis Dataproc akan memilih zona dalam region cluster yang Anda tentukan untuk menempatkan resource cluster.
Namespace regional sesuai dengan segmen /regions/REGION
URI resource Dataproc (lihat, misalnya, cluster
networkUri
).
Semantik endpoint regional
Nama endpoint regional mengikuti konvensi penamaan standar berdasarkan region Compute Engine.
Misalnya, nama untuk region US Central adalah us-central1
, dan nama
untuk region Eropa Barat adalah europe-west1
. Jalankan perintah gcloud compute regions list
untuk melihat daftar region yang tersedia.
Membuat cluster
gcloud
Saat membuat cluster, tentukan region menggunakan flag --region
yang diperlukan.
gcloud dataproc clusters create CLUSTER_NAME \ --region=REGION \ other args ...
REST API
Gunakan parameter URL REGION
dalam permintaan
clusters.create
untuk menentukan region cluster.
gRPC
Tetapkan alamat transport klien ke endpoint regional menggunakan pola berikut:
REGION-dataproc.googleapis.com
Contoh Python (google-cloud-python):
from google.cloud import dataproc_v1
from google.cloud.dataproc_v1.gapic.transports import cluster_controller_grpc_transport
transport = cluster_controller_grpc_transport.ClusterControllerGrpcTransport(
address='us-central1-dataproc.googleapis.com:443')
client = dataproc_v1.ClusterControllerClient(transport)
project_id = 'my-project'
region = 'us-central1'
cluster = {...}
Contoh Java (google-cloud-java):
ClusterControllerSettings settings =
ClusterControllerSettings.newBuilder()
.setEndpoint("us-central1-dataproc.googleapis.com:443")
.build();
try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create(settings)) {
String projectId = "my-project";
String region = "us-central1";
Cluster cluster = Cluster.newBuilder().build();
Cluster response =
clusterControllerClient.createClusterAsync(projectId, region, cluster).get();
}
Konsol
Tentukan region Dataproc di bagian Location pada panel Set up cluster di halaman Create a cluster Dataproc di konsol Google Cloud .
Langkah berikutnya
- Geografi dan Region
- Compute Engine→Regions and Zones
- Compute Engine→Global, Regional, and Zonal Resources
- Penempatan Zona Otomatis Dataproc