이 문서에서는 Cloud Shell에서 Spanner 마이그레이션 도구(SMT)를 설치하고 실행하는 방법을 설명합니다. SMT에 대한 자세한 내용은 Spanner 마이그레이션 도구를 참고하세요.
시작하기 전에
- 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.
-
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.
- Google Cloud CLI를 설치합니다.
-
Google Cloud CLI를 초기화하려면
gcloud init
명령어를 실행합니다. 수정 버튼을 클릭하여 Spanner 연결을 구성합니다.
Spanner에 연결하려면 다음 정보를 지정하세요.
- 프로젝트 ID: Spanner 인스턴스가 있는 프로젝트 ID입니다.
- 인스턴스 ID: Spanner 인스턴스 ID입니다.
저장을 클릭합니다.
- 데이터베이스 엔진: 소스 데이터베이스가 MySQL, SQL Server, Oracle 또는 PostgreSQL인지 지정합니다.
- 호스트 이름: 소스 데이터베이스의 IP 주소입니다.
- 포트: 소스 데이터베이스에 액세스할 수 있는 포트입니다.
- 사용자 이름: 소스 데이터베이스의 사용자 이름입니다.
- 비밀번호: 소스 데이터베이스의 비밀번호입니다.
- Spanner 언어: GoogleSQL 또는 PostgreSQL을 사용할지 지정합니다.
Spanner 마이그레이션 도구 설치
Linux 셸 명령어 또는 Google Cloud CLI를 사용하여 SMT를 설치할 수 있습니다.
Linux 셸
SMT를 설치하려면 다음 명령어를 실행합니다.
sudo apt-get install google-cloud-sdk-spanner-migration-tool
gcloud
gcloud components install
명령어를 사용하여 SMT를 설치할 수 있습니다.
gcloud components install spanner-migration-tool
SMT 설치에 대한 자세한 내용은 Spanner 마이그레이션 도구 설치를 참고하세요.
Spanner 마이그레이션 도구 액세스
gcloud alpha spanner migrate
명령어를 사용하여 SMT에 액세스하고 사용할 수 있습니다.
SMT 웹 UI를 실행하려면 다음 명령어를 실행하면 됩니다.
gcloud alpha spanner migrate web
SMT가 리소스에 액세스할 수 있도록 Google Cloud 사용자 인증 정보를 제공해야 합니다. 이전 명령어에 대한 응답에서 http://localhost:8080
을 클릭하여 웹 UI를 엽니다.
Spanner에 연결
SMT 웹 UI를 사용하여 Spanner에 연결하려면 다음 단계를 따르세요.
소스 데이터베이스에 연결
다음 정보를 제공하여 SMT 웹 UI를 사용하여 소스 데이터베이스에 연결해야 합니다.
정보를 입력한 후 연결 테스트를 클릭하고 연결을 클릭하여 소스 데이터베이스에 연결할 수 있습니다.