Wordpress-HA: CloudSQL & Storage Bucket Regions should reflect VM region selection
The Wordpress-HA deployment defaults to US region for the CloudSQL instance, even if you pick say, Sydney for the VMs as part of the setup. The result is very slow db calls from the proxy instances.
Fix: Either add another selection to the deployment to allow a choice for the CloudSQL region, or infer it from the chosen VM region.
In a similar vein, the Storage Bucket region does the same thing - it needs to be Regional (or at least multi-region but in the same part of the world!) in the same region as the VMs otherwise the file sync is much slower than it needs to be.
[BTW - really awesome work on this deployment. It has some quirks but it's been a really interesting way to learn about WP through a load balancer.]
Expected behaviour as described by @kythin - deriving region from zone preference asked for during setup.
Note: Cloud SQL setup will follow default project settings.
Hi @YaguraStation I have followed your hit but bucket and cloud sql still install in the USA (I want to install all in Europe server). I have create a new project and run the following command in console as mentioned in the guide but it does't made effects during installations. What is the correct way to do it? Thank you!
gcloud compute project-info add-metadata \
--metadata google-compute-default-region=europe-west1,google-compute-default-zone=europe-west1-b
What do your project settings show in https://console.cloud.google.com/compute/settings ?
Set default Region and Zone easily in above compute settings link of GCP Cloud Console or follow the instructions of the section "Set default zone and region in your local client" which is referenced by the article of my 27 Jan comment (ie. gcloud config set compute/zone and gcloud config set compute/region).
PS: 27 Jan comment was confirming @kythin experience. Project default zone will only work for Cloud SQL. My expected behaviour would've also been to set Zones explicitly.
Well, accessing /compute/settings Region and Zone are not configured. So bucket will be always created in US zone. (But is not a big problem, after installation I could mirate it manually).
Hi @YaguraStation , setting up default compute zone/region doesn't work. Cloud SQL still be created in US zone. Any suggestions? Thank you
@AleeeKoi No, sorry, setting default zone worked for my Cloud SQL setup in two projects.
I am experiencing the same issue. In my project, the default Compute Region and Zone were not set (set to 'None' in the console) before deploying wordpress-ha. I would have expected that the database and file buckets be deployed in the Region specified at install time (i.e the same as the Worpdress VMs) but instead they got deployed in US region. This seems like a bug to me. I have tried working around this issue by setting the Compute Region/Zone preference ahead of the wordpress-ha deployment (as instructed by @YaguraStation) but as for @AleeeKoi it does not seem to have the desired effect. Cloud SQL still get deployed in US, same goes for Cloud Storage Buckets. Help please ...
I ended up tweaking the deployment source file. The 3 following changes did the trick for me: (the zip file contains the diff to apply to the actual source files)