Dataproc クラスタの作成時に、「us-east1」や「europe-west1」などの Compute Engine リージョンを指定します。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 コマンドを使用して、利用可能なリージョンのリストを表示します。
ロケーションとリージョン エンドポイント
Google Cloud API は、ロケーション エンドポイントとリージョン エンドポイントをサポートできます。
ロケーション エンドポイントは、プライベート接続を介してアクセスされる場合に転送中のデータが指定されたロケーションに保持されるようにします。
形式:
{location}-{service}.googleapis.com例:
us-central-1-dataproc.googleapis.comリージョン エンドポイントを使用すると、プライベート接続または公共のインターネット経由でアクセスされる場合に、転送中のデータが指定されたロケーションに保持されます。
形式:
{service}.{location}.rep.googleapis.com例:
dataproc.us-central1.rep.googleapis.com
デフォルトの Dataproc エンドポイントはロケーション エンドポイントです。Dataproc によるリージョン エンドポイントのサポートに関するお知らせについては、Dataproc のリリースノートをご覧ください。
クラスタの作成
gcloud CLI
クラスタを作成するときは、必須の --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();
}コンソール
Google Cloud コンソールで、Dataproc の [クラスタの作成] ページにある [クラスタの設定] パネルの [ロケーション] セクションで Dataproc リージョンを指定します。
次のステップ
- 地域とリージョン
- Compute Engine → リージョンとゾーン
- Compute Engine → グローバル リソース、リージョン リソース、ゾーンリソース
- Dataproc 自動ゾーン プレースメント