Hi Jun, thanks for your response, but I am a little confused here. When deployed, GAE uses a built in cloud sql proxy connection with Cloud SQL so there is no way to specify the instance or any other parameter for cloud sql proxy. I think any fix will need to use app.yaml but please correct me if I'm wrong. Would love to solve this.
On Friday, November 17, 2017 at 12:59:04 PM UTC-8, Jun (Cloud Platform Support) wrote: > > Hi Mike, > > You should be able to connect to multiple Cloud SQL instances through > Cloud SQL Proxy, and you can specify multiple instances in the instances > parameter (comma separated). Please take a look at these two posts for more > details: "A GCE instance connecting to two (or more) Cloud SQL databases > via multiple cloud-sql-proxy-instances > <https://groups.google.com/forum/#!msg/google-cloud-sql-discuss/_GH4b6Uxz9I/pRE0Z9aTAgAJ>" > > and "Connecting to multiple CloudSQL instances using Cloud sql proxy? > <https://stackoverflow.com/questions/40793222/connecting-to-multiple-cloudsql-instances-using-cloud-sql-proxy>", > > which have the similar questions. > > - Jun > > > On Friday, November 17, 2017 at 12:06:49 AM UTC-5, Mike Hardy wrote: >> >> Hi, we have an app that utilizes two databases. Previously, we had the >> two databases on the same instance in Cloud SQL, but we want to split the >> databases into separate instances. We're having issues connecting the >> databases to our Django app engine service. Is this even possible? If so, >> how would the app.yaml look? >> >> old app.yaml >> runtime: custom >> env: flex >> entrypoint: gunicorn --timeout 360 --graceful-timeout 360 -b :$8080 >> localinsights.wsgi >> >> beta_settings: >> cloud_sql_instances: <CONNECTION> >> >> runtime_config: >> python_version: 3.6 >> >> env_variables: >> SQLALCHEMY_DATABASE_URI: >- >> >> postgresql+psycopg2://<USER>:<PASSWORD>/<DB>?host=/cloudsql/<CONNECTION> >> >> >> settings.py >> DATABASES['default'] = { >> 'HOST': '/cloudsql/<CONNECTION>', >> 'ENGINE': 'psqlextra.backend', >> 'NAME': '<USER_DB>', >> 'USER': '<USER>', >> 'PASSWORD': '<PASSWORD>' >> } >> DATABASES['NUMBER_2'] = { >> 'HOST': '/cloudsql/<CONNECTION>', >> 'ENGINE': 'psqlextra.backend', >> 'NAME': 'NUMBER_2', >> 'USER': '<USER>', >> 'PASSWORD': '<PW>' >> } >> >> >> -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/ca645dae-b554-494b-a638-e2f6acdab6a0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
