code

Google Application Engine에서 사용하지 않는 색인을 제거하려면 어떻게해야합니까?

codestyles 2020. 12. 7. 08:09
반응형

Google Application Engine에서 사용하지 않는 색인을 제거하려면 어떻게해야합니까?


내가 한 실수로 추가 내 GAE 응용 프로그램에 새 필터를. 색인의 상태는 현재 '제공 중'입니다. 그러나 해당 색인이 전혀 필요하지 않으며 제거하고 싶습니다. 어떻게 할 수 있습니까?


여기에 문서화되어 있습니다 . 도움이되기를 바랍니다.

사용하지 않는 인덱스 삭제

index.yaml에서 색인을 변경하거나 제거해도 원래 색인은 App Engine에서 자동으로 삭제되지 않습니다. 이렇게하면 새 색인이 빌드되는 동안 이전 버전의 앱을 실행 상태로 두거나 최신 버전에서 문제가 발견되는 경우 즉시 이전 버전으로 되돌릴 수 있습니다.

이전 색인이 더 이상 필요하지 않다고 확신하는 경우 다음 명령어를 사용하여 App Engine에서 삭제할 수 있습니다.

appcfg.py vacuum_indexes myapp/

이 명령어는 index.yaml의 로컬 버전에 언급되지 않은 앱의 모든 색인을 삭제합니다.


GAE / Java의 경우 설명서에 다음 정보가 포함됩니다 .

사용하지 않는 인덱스 삭제

...

이전 색인이 더 이상 필요하지 않다고 확신하는 경우 vacuum_indexes 작업을 사용하여 App Engine에서 삭제할 수 있습니다.

./appengine-java-sdk/bin/appcfg.sh vacuum_indexes myapp/war

이 명령은 datastore-indexes.xml 및 generated / datastore-indexes-auto.xml의 로컬 버전에 언급되지 않은 앱의 모든 인덱스를 삭제합니다.


에서 윈도우 구글 AppEngine에 자바 , 우리는 사용할 필요가 appcfg.cmd 명령을 사용하지 않는 인덱스 삭제 배포 된 응용 프로그램의합니다.

구문 :

appengine-java-sdk-path \ bin \ appcfg.cmd vacuum_indexes project-root-path \ poject-name \ war \


JochenJung이 언급했듯이 gae-java의 경우 "vacuum_indexes"도구가 작동하지만 다음과 같은 방법으로 파이썬 프로젝트를 에뮬레이트해야합니다.

vacuum 도구는 로컬 dev가 아닌 * .appspot.com을 가리킬 때만 작동하는 것 같습니다. 환경.

  • 앱용 app.yaml을 만들고 최소한 / myapp / 루트 디렉터리에 넣습니다.

    application: myproj
    version: 4
    runtime: python
    api_version: 1

여기서 "version"은 앱의 버전이고 "myproj"는 프로젝트의 GAE 이름입니다.

  • index.yaml을 만들고 동일한 루트 디렉토리에 넣습니다. 유지하려는 인덱스에 대한 인덱스 정보를 힘들게 파일에 넣는 대신 도구가 삭제하는 모든 인덱스에 대해 예 / 아니오 확인을 제공하므로 ALL을 표시하는 것이 더 간단합니다. 인덱스를 삭제하고 확인을 사용하여 유지하려는 인덱스를 보존해야합니다.

indexes:

# AUTOGENERATED

그런 다음 위와 같이 명령을 실행하십시오.


  /appcfg.py vacuum_indexes /path/to/myproj/

2019 년 2 월 현재 :

gcloud datastore indexes cleanup index.yaml

maven을 사용하는 경우 mvn appengine:vacuum_indexes. 필요하지 않습니다 mvn appengine:update.이 명령은 원격 서버를 업데이트합니다.

여기 에 maven 명령의 전체 목록이 있습니다 .


Java를 사용하는 Windows에서이 명령은 저에게 효과적이었습니다.

appcfg.cmd vacuum_indexes C:\Users\Name\AndroidStudioProjects\Project\backend\src\main\webapp\

참고 : 만들기 확실히 당신은이 datastore-indexes.xmlwebapp(이러한 인덱스가 절약됩니다) 폴더에 있습니다.


현재 버전의 gcloud를 사용하면 다음을 수행 할 수 있습니다.

gcloud datastore cleanup-indexes index.yaml

appcfg.cmd [...]를 호출하는 것보다 더 직관적입니다.


gcloud datastore cleanup-indexes /path/to/file/index.yaml

이 명령은 더 이상 작동하지 않습니다 .

gcloud datastore indexes cleanup /path/to/index.yaml

이것은 새로운 명령 입니다.

you should run them in google cloud console. normally you can upload the index.yaml file using file upload feature in google cloud console. your file goes to a directly called _admin you can cd to there and call,

gcloud datastore indexes cleanup index.yaml

Tip

if you are using datastore in a java project, you have datastore-indexes.xml instead of index.yaml. You might have some trouble finding the index.yaml file if you don't know where to look.

you can simply find the path of the index.yaml file by looking at the deploy console in your IDE.

참고URL : https://stackoverflow.com/questions/813839/how-can-i-remove-unused-indexes-in-google-application-engine

반응형