简体   繁体   中英

Change GAE application location

I am trying to create a Google Cloud SQL Instance and I have chosen the Asia region. However, the system told me that the Google Cloud SQL Instance must be in the same location as the Google App Engine (GAE) application.

I never specified the location of my GAE application and I couldn't find any ways to change my application location.

Can anyone tell me how to do that? Thank you very much.

Currently it is not possible to create an App in the Asia region or migrate app after its creation. Apps can only be created in the US and Europe. Europe App creation is reserved for Premier accounts and accounts whitelisted as per 1 .

If you really require to host an App in the Asia region, you can consider hosting it on GCE, however you'll lose automated scaling. You may also have a look at Managed VM's at [2] in case you need to use Service APIs, however keep in mind it is a new feature that is in Limited Preview and not yet recommended for production use.

1 - https://developers.google.com/appengine/docs/premier/#location
[2] - https://developers.google.com/appengine/docs/managed-vms/

Update: No whitelist is currently necessary for projects created via the new developers console. App location change is still not possible, hence it's necessary to migrate the data (eg Datastore admin for Datastore) and deploy to a new app. Update2: Can create apps in Asia now. Location change still unavailable. Autoscaling on GCE possible .

App Engine (GAE) by now is available also in the Asia regions .
But unfortunately you cannot change an app's region after you set it.

So we can do by setting new project as we have up to 24 projects allowed in one account.
By default GAE region will follow our setting of Compute Engine. So there are 2 options:

  • change region/zone in your console
    go to https://console.cloud.google.com/compute/settings

  • do it with gcloud config set compute command, for example:

     gcloud config set compute/region asia-northeast1 gcloud config set compute/zone asia-northeast1-a 

You may then check the setting by initializing gcloud init

$ gcloud init
Pick configuration to use:
 [1] Re-initialize this configuration [default] with new settings
 [2] Create a new configuration
 [3] Switch to and re-initialize existing configuration: [restart]

Please enter your numeric choice: 1, then choose your project and account.
Output will automatically be default region/zone that refers to the setting above.

* Commands will reference project `[PROJECT_ID]` by default
* Compute Engine commands will use region `asia-northeast1` by default
* Compute Engine commands will use zone `asia-northeast1-a` by default 

Deploy your application and check the location as below:

$ gcloud app deply version=[VERSION_ID]
$ gcloud app describe
authDomain: ..
codeBucket: ..
..
..
locationId: asia-northeast1   <------ SEE HERE
name: apps/[PROJECT_ID]
servingStatus: SERVING

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM