クラスタ リージョン

Managed Service for Apache Spark クラスタの作成時に、Compute Engine リージョン(us-east1 や europe-west1 など)を指定します。Managed Service for Apache Spark は、指定したリージョン内のゾーン内に VM インスタンス、Cloud Storage、メタデータ ストレージなどのクラスタ リソースを隔離します。

必要に応じて、クラスタの作成時に、us-east1-a や europe-west1-b など特定のクラスタ リージョン内のゾーンを指定できます。ゾーンを指定しない場合、Managed Service for Apache Spark の自動ゾーン プレースメントにより、指定したクラスタ リージョン内のゾーンが選択され、クラスタ リソースが配置されます。

リージョンの名前空間は、Managed Service for Apache Spark リソース 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

Managed Service for Apache Spark のデフォルトのエンドポイントはロケーション エンドポイント です。 Managed Service for Apache Spark によるリージョン エンドポイントのサポートについては、Managed Service for Apache Spark のリリースノートをご覧ください。

クラスタの作成

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

コンソール

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

次のステップ