リージョン エンドポイント

Dataproc は、Compute Engine のリージョンに基づくリージョン エンドポイントをサポートしています。Dataproc クラスタの作成時に、「us-east1」や「europe-west1」などのリージョンを指定する必要があります。Dataproc は、指定されたリージョン内のゾーン内で VM インスタンス、Cloud Storage、メタデータ ストレージなどのクラスタ リソースを分離します。

必要に応じて、クラスタの作成時に、「us-east1-a」や「europe-west1-b」など特定のクラスタ リージョン内のゾーンを指定できます。ゾーンを指定しない場合、Dataproc 自動ゾーン プレースメントは、指定されたクラスタ リージョン内のゾーンを選択して、クラスタ リソースを検索します。

リージョンの名前空間は、Dataproc リソース URI の /regions/REGION セグメントに対応します(たとえば、クラスタ networkUri をご覧ください)。

リージョン エンドポイントのセマンティクス

リージョン エンドポイントの名前は、Compute Engine ゾーンに基づく標準の命名規則に従います。たとえば、中央アメリカのリージョン名は us-central1、西ヨーロッパのリージョン名は europe-west1 です。gcloud compute regions list コマンドを使用して、利用可能なリージョンのリストを表示します。

クラスタを作成

gcloud

クラスタを作成するときに、必要な --region フラグを使用してリージョンを指定します。

gcloud dataproc clusters create CLUSTER_NAME \
    --region=REGION \
    other args ...

REST API

clusters.create リクエストで REGION URL パラメータを使用して、クラスタのリージョンを指定します。

gRPC

次のパターンを使用して、クライアント トランスポート アドレスをリージョン エンドポイントに設定します。

REGION-dataproc.googleapis.com

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 = {...}

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();
 }

Console

Google Cloud コンソールで、Dataproc の [クラスタの作成] ページにある [クラスタの設定] パネルの [ロケーション] セクションで Dataproc リージョンを指定します。

次のステップ