Google Cloud 콘솔을 사용하여 Memcached용 Memorystore 인스턴스 만들기
이 빠른 시작에서는 Memorystore for Memcached 인스턴스를 만들고, 인스턴스에 연결하고, 값을 설정하고, 값을 검색하고, 인스턴스를 삭제하는 단계를 안내합니다.
시작하기 전에
- 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.createpermission. 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.createpermission. Learn how to grant roles.
 
- 
  
    Verify that billing is enabled for your Google Cloud project. 
- 
    프로젝트에 Service Networking API를 사용 설정합니다.
    
 Service Networking API를 사용 설정합니다.
- 
    프로젝트에 Memorystore for Memcached API를 사용 설정합니다.
    
 Memorystore for Memcached API 사용 설정
Memcached 인스턴스 만들기
- Google Cloud 콘솔에서 Memcached용 Memorystore 페이지로 이동합니다. 
 Memorystore for Memcached
- 인스턴스 만들기 버튼을 클릭합니다. 
- Google Cloud 콘솔의 Memcached 인스턴스 만들기 페이지에서 새 인스턴스의 구성을 선택합니다. - 소문자, 숫자, 하이픈만 사용하여 인스턴스 ID를 입력합니다.
문자로 시작해야 합니다.
- 예를 들면 my-memcached-instance-1입니다.
 
- 예를 들면 
- 리전 드롭다운에서 us-central1을 선택합니다.
- 영역 드롭다운에서 Automatically distribute를 선택합니다.
- 2개의 노드를 만들기 위하여 노드 아래에 2를 입력합니다.
- 1GB의 노드당 메모리를 선택합니다.
- 노드당 코어 수를 1로 선택합니다.
- 승인된 네트워크로 - default를 선택합니다.
 
- 소문자, 숫자, 하이픈만 사용하여 인스턴스 ID를 입력합니다.
문자로 시작해야 합니다.
- 만들기를 클릭합니다. 
- 인스턴스가 생성된 후 인스턴스 ID를 클릭하여 인스턴스 세부정보 페이지를 확인합니다. 
- 노드 중 하나의 - IP address를 기록합니다.
Compute Engine VM에서 인스턴스에 연결
연결을 테스트하려면 다음 단계를 따르세요.
- Linux VM에 연결합니다. Linux VM에 연결하는 단계는 Linux VM을 사용한 빠른 시작을 참조하세요. 빠른 시작에 설명된 대로 Debian 기반 이미지를 사용하여 VM 인스턴스를 만든 경우 - apt-get을 사용하여- telnet을 설치합니다.- sudo apt-get install telnet
- 터미널에서 Memcached 노드 중 하나의 IP 주소를 텔넷으로 연결합니다. node-ip-address를 노드의 IP 주소로 바꿉니다. - telnet node-ip-address 11211 - 프로젝트의 변수를 교체한 - [bracketed-variables]가 포함된 다음의 출력이 표시됩니다.- Trying [node-ip-address]… Connected to [node-ip-address] 
- 텔넷 세션에서 몇 가지 Memcached 명령어를 입력합니다. - 다음을 입력합니다. - get greeting - 결과: - END - 다음을 입력합니다. - set greeting 1 0 11 hello world - 결과: - STORED - 다음을 입력합니다. - get greeting - 결과: - VALUE greeting 1 11 hello world END 
Memorystore for Memcached는 표준 오픈소스 Memcached 라이브러리를 지원합니다.
삭제
이 페이지에서 사용한 리소스 비용이 Google Cloud 계정에 청구되지 않도록 하려면 다음 단계를 수행합니다.
- Google Cloud 콘솔에서 Memcached용 Memorystore 페이지로 이동합니다. 
 Memorystore for Memcached
- 삭제할 인스턴스의 ID를 클릭합니다. 
- 삭제 버튼을 클릭합니다. 
- 표시되는 메시지에 인스턴스의 ID를 입력합니다. 
- 삭제 버튼을 클릭합니다.