Google Cloud 콘솔을 사용하여 Dataproc 클러스터 만들기
이 페이지에서는 Google Cloud 콘솔을 사용하여 Dataproc 클러스터를 만들고, 클러스터에서 기본적인 Apache Spark 작업을 실행한 다음, 클러스터의 작업자 수를 수정하는 방법을 보여줍니다.
Google Cloud 콘솔에서 이 태스크에 대한 단계별 안내를 직접 수행하려면 둘러보기를 클릭합니다.
시작하기 전에
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Dataproc API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles. -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Dataproc API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles.
클러스터 만들기
Google Cloud 콘솔에서 Dataproc 클러스터 페이지로 이동합니다.
클러스터 만들기를 클릭합니다.
Dataproc 클러스터 만들기 대화상자의 Compute Engine의 클러스터 행에서 만들기를 클릭합니다.
클러스터 이름 필드에
example-cluster
를 입력합니다.리전 및 영역 목록에서 리전과 영역을 선택합니다.
리전(예:
us-east1
또는europe-west1
)을 선택하여 해당 리전에서 Dataproc에서 활용하는 가상 머신(VM) 인스턴스, Cloud Storage와 같은 리소스와 메타데이터 스토리지 위치를 격리합니다. 자세한 내용은 사용 가능한 리전 및 영역과 리전 엔드포인트를 참조하세요.다른 모든 옵션은 기본 설정을 사용합니다.
만들기를 클릭하여 클러스터를 만듭니다.
새 클러스터가 클러스터 페이지의 목록에 나타납니다. 클러스터를 사용할 준비가 될 때까지 상태는 프로비저닝이 되고 상태는 실행 중으로 변경됩니다. 클러스터를 프로비저닝하는 데 몇 분 정도 걸릴 수 있습니다.
Spark 작업 제출
Pi 값을 추정하는 Spark 작업을 제출합니다.
- Dataproc 탐색 메뉴에서 작업을 클릭합니다.
작업 페이지에서
작업 제출을 클릭한 후 다음을 수행합니다.- 작업 ID 필드에서 기본 설정을 사용하거나 Google Cloud 프로젝트에 고유한 ID를 제공합니다.
- 클러스터 드롭다운에서
example-cluster
를 선택합니다. - 작업 유형으로 Spark를 선택합니다.
- 기본 클래스 또는 jar 필드에
org.apache.spark.examples.SparkPi
를 입력합니다. - Jar 파일 필드에
file:///usr/lib/spark/examples/jars/spark-examples.jar
를 입력합니다. 인수 필드에
1000
을 입력하여 작업 수를 설정합니다.제출을 클릭합니다.
작업이 작업 세부정보 페이지에 표시됩니다. 작업 상태는 실행 중 또는 시작 중 하나이며 제출 후 성공으로 변경됩니다.
출력에서 스크롤되지 않도록 하려면 자동 줄바꿈: 사용 중지를 클릭합니다. 출력은 다음과 비슷합니다.
Pi is roughly 3.1416759514167594
작업 세부정보를 보려면 구성 탭을 클릭합니다.
클러스터 업데이트
작업자 인스턴스 수를 변경하여 클러스터를 업데이트합니다.
- Dataproc 탐색 메뉴에서 클러스터를 클릭합니다.
- 클러스터 목록에서
example-cluster
를 클릭합니다. 클러스터 세부정보 페이지에서 구성 탭을 클릭합니다.
클러스터 설정이 표시됩니다.
수정을 클릭합니다.
작업자 노드 필드에
5
를 입력합니다.저장을 클릭합니다.
클러스터가 업데이트되었습니다. 작업자 노드 수를 기존 값으로 줄이려면 동일한 절차를 따릅니다.
삭제
이 페이지에서 사용한 리소스 비용이 Google Cloud 계정에 청구되지 않도록 하려면 다음 단계를 수행합니다.
- 클러스터를 삭제하려면
example-cluster
의 클러스터 세부정보 페이지에서 삭제를 클릭합니다. - 삭제를 클릭하여 클러스터를 삭제할 것인지 확인합니다.
다음 단계
- 다른 도구를 사용하여 이 빠른 시작을 사용해 보세요.
- 프로젝트를 만들 때 강력한 방화벽 규칙을 만드는 방법 알아보기
- Spark Scala 작업 작성 및 실행 방법 알아보기