본문 바로가기
테크/기타

Google Cloud Datastore 사용하기(spring)

by ahnne 2017. 5. 31.


# 관리화면

https://console.cloud.google.com/datastore


# 인증 관련

https://developers.google.com/identity/protocols/application-default-credentials


## 서비스키 파일 다운로드 -> path 를 환경변수로 설정 필요

- https://console.developers.google.com/project/_/apis/credentials 에서 관련 json 파일 다운로드.

- "GOOGLE_APPLICATION_CREDENTIALS"


## shell 에서 gcloud auth application-default login 실행


# 클라이언트 API 사용

https://cloud.google.com/appengine/docs/standard/java/datastore/


※ app engine 라이브러리와 google cloud 라이브러리는 다름?

- app engine flexible 환경에서는 다음 api 사용해야 한다.(https://cloud.google.com/appengine/docs/flexible/java/using-cloud-datastore)

- com.google.appengine api를 사용하면 아래의 에러가 발생한다.

- "No API environment is registered for this thread"


http://googlecloudplatform.github.io/google-cloud-java/0.18.0/index.html