Google Cloud 콘솔을 사용하여 Redis용 Memorystore 인스턴스 만들기
Redis용 Memorystore 인스턴스를 만들고, 연결하고, 삭제하는 방법을 알아봅니다.
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
이 가이드에 기존 프로젝트를 사용하는 경우 이 가이드를 완료하는 데 필요한 권한이 있는지 확인합니다. 새 프로젝트를 만든 경우 필요한 권한이 이미 있습니다.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Memorystore for Redis API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. 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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
이 가이드에 기존 프로젝트를 사용하는 경우 이 가이드를 완료하는 데 필요한 권한이 있는지 확인합니다. 새 프로젝트를 만든 경우 필요한 권한이 이미 있습니다.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Memorystore for Redis API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. -
Cloud Memorystore Redis 관리자(
roles/redis.admin) -
Compute 인스턴스 관리자 (v1) (
roles/compute.instanceAdmin.v1) -
서비스 계정 사용자 (
roles/iam.serviceAccountUser)
필요한 역할
Memorystore for Redis 인스턴스를 만드는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 다음 IAM 역할을 부여해 달라고 요청하세요.
역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.
Redis용 Memorystore 인스턴스 만들기
이 섹션에서는 us-central1 리전에 있고 기본 등급인 2GB Memorystore for Redis 인스턴스를 만듭니다. 등급에 대한 자세한 내용은 Redis 등급 기능을 참고하세요.
Google Cloud 콘솔에서 Memorystore for Redis 페이지로 이동합니다.
인스턴스 만들기를 클릭합니다.
Redis 인스턴스 만들기 페이지에서 생성할 인스턴스를 다음과 같이 구성합니다.
- 인스턴스 ID 필드에
my-instance-1를 입력합니다. - 표시 이름 필드에
My Quickstart Instance을 입력합니다. - 등급 선택 섹션에서 기본을 선택합니다. 이 등급은 복제본 노드를 사용하여 데이터를 백업하는 표준 등급이 아닌 독립형 Redis 노드를 지정합니다.
- 용량 필드에
5을 입력합니다. 이렇게 하면 인스턴스 용량이 5GB로 설정됩니다. - 리전 메뉴에서 us-central1 (아이오와)을 선택합니다.
- 네트워크 메뉴에서 기본값을 선택합니다.
- 구성 노드를 펼친 다음 버전 메뉴에서
7.2 (권장)를 선택합니다.
- 인스턴스 ID 필드에
인스턴스 만들기를 클릭합니다.
인스턴스를 만든 후 다음 단계에 따라 인스턴스의
IP address를 가져옵니다.- Google Cloud 콘솔에서 Memorystore for Redis 페이지로 이동합니다.
Redis용 Memorystore - 인스턴스 ID
my-instance-1을 클릭합니다. - 연결 섹션에서 인스턴스의 기본 엔드포인트와 포트 번호(
6379)를 기록해 둡니다. 인스턴스에 연결하려면 엔드포인트와 포트 번호가 필요합니다.
- Google Cloud 콘솔에서 Memorystore for Redis 페이지로 이동합니다.
Compute Engine VM에서 Memorystore for Redis 인스턴스에 연결
지원되는 RFC 1918 IP 주소를 사용하여 인스턴스의 승인된 네트워크를 사용하는 모든 Compute Engine VM에서 Redis용 Memorystore 인스턴스에 연결할 수 있습니다.
인스턴스와 동일한 승인된 네트워크를 사용하는 Compute Engine VM이 없으면 VM을 만들고 SSH를 사용하여 연결합니다. 이렇게 하려면 Compute Engine에서 Linux VM 인스턴스 만들기의 단계를 따르세요.
apt-get를 사용하여telnet을 설치합니다.sudo apt-get install telnet터미널에서 인스턴스의 IP 주소를 텔넷으로 연결합니다. VARIABLES를 적절한 값으로 바꿉니다.
telnet INSTANCE_IP_ADDRESS 6379
인스턴스에 연결할 수 있으면 명령어가 다음 결과를 반환합니다.
Trying INSTANCE_IP_ADDRESS… Connected to INSTANCE_IP_ADDRESS
텔넷 세션에서 몇 가지 Redis 명령어를 입력합니다.
다음을 입력합니다.
PING
결과:
PONG
입력
SET HELLO WORLD
결과:
+OK
다음을 입력합니다.
GET HELLO
결과:
$5 WORLD
삭제
이 페이지에서 사용한 리소스 비용이 Google Cloud 계정에 청구되지 않도록 하려면 다음 단계를 수행합니다.
- Google Cloud 콘솔에서 Memorystore for Redis 페이지로 이동합니다.
Redis용 Memorystore - 삭제할 인스턴스의 ID를 클릭합니다.
- 삭제를 클릭합니다.
- 프롬프트가 나타나면 인스턴스 ID를 입력합니다.
- 삭제를 클릭합니다.
- 선택사항. 이 빠른 시작을 위해 Compute Engine VM을 만든 경우 삭제합니다.
다음 단계
- 인스턴스 만들기 및 관리 자세히 알아보기
- Redis 인스턴스에 연결하는 다른 방법 알아보기
- Redis 인스턴스의 특징 알아보기