As already mentioned by @justbeez, I believe the best way to go is using second generation instances and Cloud SQL Proxy. In case this is not possible, first generation instances can be setup to only allow SSL connections and whitelisting any origin as explained here.
A more complex approach would be to create an instance template so that a startup-...
I was able to connect to Cloud SQL Postgres by creating a VPC-native cluster as suggested by @patrick-w.
My VPC subnetwork creation was modified to include two secondary ranges:
gcloud compute networks subnets create stg-vpc-us-central1 \
--network stg-vpc \
--region us-central1 \
--range 10.10.0.0/16 \
Using Developers Console, you can check the sa username's password in two different places :
under Compute Engine > VM instances, click on your deployed ASP.NET
instance and look for c2d-property-saPassword value under Custom metadata.
under Deployment Manager > Deployments , click on your deployment.
In right pane look for SQL Server Express ...
The purpose of Google Cloud Storage is to allow to store and retrieve any amount of data at any time, but you cannot modify data directly in Google Cloud Storage.
You can keep your scheme by using Google Compute VM instances and resizing or adding persistent disks when it requires more storage space .
However, if it is not required to keep your scheme, ...
Short answer “No”, it is not possible to set the 'gtid_mode' to off on a Cloud SQL 2nd Generation instance. In fact, modifying this parameter requires the “Super” privileges which are disabled for Cloud SQL instances as stated on this MySQL root user account FAQ.
Note that 'gtid_mode' is used when binary logging is enabled to prevent data loss during ...
Container-Optimized OS mounts the majority of the file-system with "noexec" flags.
This can be see by running the following:
mount | grep noexec
The 'noexec' option doesn't allow direct execution of any binaries on the mounted filesystem. This is because of the default security lock-down implementation on COS.
There are however some writable locations (...
I haven't specifically attempted to configured a application the way you are describing but I know those are not the takeaways that Google intends. To address some specifics:
Connecting to Cloud SQL specifically says the following to suggest storing passwords is not what they intend and provide a separate solution for secrets.
# Remember - storing secrets ...
So long no one responded, so I'll tell how I've overcome this.
Connect to your instance as postgres user, connect to template1 DB and install required extensions (if they're in the list of supported ones).
Drop and recreate your DB from Cloud SQL UI. Maybe manual works too, but I decided not to test. UI tells you that new DB will be created using template1.
Google Cloud SQL will skip doing a backup if it knows that no backup is needed. This will be the case if the instance was idle since the last backup.
Try connecting to you instance and having some activity, and see if a backup runs in the next 24 hours.
No, your read replica is a read-only, so it cannot take writes during downtime of the master. There's no good solutions to avoiding the downtime, but if you have a small database, it should come back in order seconds (most come back within 5 seconds or so).
As per the official documentation1:
You cannot access a Cloud SQL instance on its private IP addresses
from another network using a Cloud VPN tunnel, instance based VPN, or
Cloud Interconnect. This limit applies to both on-premises networks
and other VPC networks.
There is a feature request to get this implemented2.
My suggestion is to use Cloud SQL Proxy3,...
In my experience, this has been due to one of the services in Requires not being found. If you're able to enable your service but starting your service returns Unit not found then examine the services under Requires. In my case, I had a Requires: rpcbind.service but that service was not installed on my system.
As far as I know there is effectively no limit to what number of replica's native MySQL can theoretically support. Although the required server_id might provide a hard upper limit of 4294967295 replica's you'll likely run into other resource limits well before that.
Barring an actual upper limit enforced by the Cloud SQL service specific to the number ...
is there any need for me to export both Datastore & Cloud SQL data, and store in either in my local machine, or non Google server? - Do you trust Google with your data? Does Google guarantee that they won't lose your data?
Or, my current app settings (high replication on datastore, and backups enabled in Cloud SQL) are good enough for me to be in peace ...
OK, I found the sa password. I took screenshots during the setup process and it was there in the 'Google Cloud Developers Console - Deploy ASP.NET Framework to Google Compute Engine' screen. I'm not sure where I could find this if I didn't take screenshots though. I've added san admin account and my windows account as an admin now so I shouldn't get locked ...
This happens because the IP you are connecting from isn't authorized in the console, as stated in the docs:
If Google Cloud SQL rejects the connection, for example, because the
IP address your client is connecting from is not authorized, the error
you receive will be: ERROR 2013 (HY000): Lost connection to MySQL
server at 'reading initial ...
An instance is the basic building block of your App Engine application and refers to a machine running a version of your code on one of the services that make up your App Engine application. One of the features of App Engine is the ability to scale your application up or down to meet the demand. This is done by creating and shutting down instances according ...
To restore a backup from the same instance:
gcloud sql backups restore [BACKUP_ID] --restore-instance=[INSTANCE_NAME]
To restore a backup from a different instance:
gcloud sql backups restore [BACKUP_ID] --restore-instance=[TARGET_INSTANCE_NAME] \
Before you do the above, ...
Looking at your error trace, it seems that the socket is created successfully toward the end. Make sure to verify if you are getting any additional error messages and check if you’re experience any observable problems with your application connecting to your Cloud SQL instance.
You can refer to Using Cloud SQL with Node.js tutorial for further information.
I wanted to do the same thing but I didn't find a way to do it with the gcloud command. You can do it with the api. I ended up doing a nodejs script cause it's easier to deal with json. My use case is to keep whitelisting the hq ip which change everyday on our multiple gcloud projects.
const got = require('got')
const token = process.env.ACCESS_TOKEN
If someone is still struggling with this issue, don't forget to use quotation marks around cloud_sql_instances:"CONNECTION_NAME" and also don't forget to use quotation marks around any environment variables in your app.yaml.
Additionally make sure that you have both Cloud SQL and Cloud SQL Admin API enabled (normally only the first one is enabled in your ...
The issue has been resolved by google tech support. Basically there has been an unscheduled (outside of maintenance window) update that for some reason has crashed/disabled our database instance. Took a really long time and stress (as this was a production database) to resolve.
Posted as answer the OP comment, to prevent community bumping as it's resolved.
If you have binary logging enable you will see an increase in the storage size because Binary logs use storage space (not backup space), and are charged as storage.
To find if you have binary logging enabled, on your instance details view, in the Configuration section, click Edit configuration > Enable auto backups (dropdown) and you will see if Enable ...
As stipulated on GCP public documentation at this link in the network requirements paragraph:
To access a Cloud SQL instance on its private IP addresses, you must use a GCP resource in the same region.
Please make sure that the app is in the same region as the cloudSQL instance.