Managed Service for Apache Spark では、Compute Engine のリージョン(us-east1 や europe-west1 など)を指定して、クラスタの実行場所を決定できます。このサービスは、VM インスタンス、Cloud Storage、メタデータ ストレージなどのリソースを、そのリージョン内の単一のゾーンに分離します。
クラスタを作成するときに、必要に応じて us-east1-a や europe-west1-b などのゾーンを選択できます。省略すると、Managed Service for Apache Spark の自動ゾーン プレースメントによって、そのリージョン内のゾーンが自動的に選択されます。
地域名
リージョンの名前は、Compute Engine リージョンに基づく標準の命名規則に従います。たとえば、中央アメリカのリージョン名は us-central1、西ヨーロッパのリージョン名は europe-west1 です。gcloud compute regions list コマンドを使用して、利用可能なリージョンのリストを表示します。
ロケーション エンドポイントとリージョン エンドポイント
Cloud de Confiance by S3NS API は、ロケーション エンドポイントとリージョン エンドポイントをサポートできます。
ロケーション エンドポイントは、プライベート接続を介してアクセスされる場合に、転送中のデータが指定されたロケーションに保持されるようにします。
形式:
{location}-{service}.googleapis.com例:
us-central-1-dataproc.googleapis.comリージョン エンドポイントは、プライベート接続または公共のインターネット経由でアクセスされる場合に、転送中のデータが指定されたロケーションに保持されるようにします。
形式:
{service}.{location}.rep.googleapis.com例:
dataproc.us-central1.rep.googleapis.com
Managed Service for Apache Spark のデフォルトのエンドポイントは、ロケーション エンドポイントです。Managed Service for Apache Spark のリージョン エンドポイントのサポートに関するお知らせについては、Managed Service for Apache Spark のリリースノートをご覧ください。
クラスタの作成
コンソール
Cloud de Confiance コンソールの [クラスタの作成] ページの [クラスタを定義する] セクションの [リージョン] フィールドで、Compute Engine リージョンを指定します。
Google Cloud 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();
}