Thursday, March 15, 2018

[google-cloud-sql-discuss] Re: Connecting to 2nd Generation MySQL from a Tomcat webapp context running in load-balanced Compute instances?

You can use the Compute Engine page to understand how to use the proxy from Compute Engine. Then, instead of invoking the mysql client, use the same host address for your application.

On Wednesday, March 14, 2018 at 5:41:37 PM UTC-7, James Lampert wrote:
As I get closer to getting a pilot system operational, I'm now running into something I'm having trouble making sense of.

Given:

The application is in Java, a webapp context running in a Tomcat server, on what is intended to be a load-balanced cluster of GCE instances.

And all of these instances share several common storage buckets, and a common Second Generation MySQL instance for their database.

Now, the developer who's in charge of the webapp ran an experimental cluster in his own private Google Cloud project, in which he just opened up the SQL server to the world, and didn't bother with any SSL. But obviously that's not going to fly as we get closer to the real thing.

I'm trying to get closer to the real thing. But how am I supposed to set up the database connections, when I don't know what IP addresses the GCE instances will have?

Looking at the "Authorization" tab for my MySQL instance, I see:
App Engine authorization

All apps in this project are authorized by default. To authorize apps in other projects, follow the steps below.

 Apps in this project: All authorized.
But that's "App Engine." Not Google Compute Engine.

And I see something called "JDBC Socket Factory," but it's on a page about connecting from applications running outside of Google Cloud.

And I see a page on connecting the MySQL Client on a Google Compute instance (which begs the question, "why would I want to do that, when I can connect from my desktop, via something a bit more user-friendly?"). Not connecting a Tomcat webapp context running on a dynamically created instance.

What am I missing here?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/33eeca1b-e582-49d5-b539-5a0456ce7d47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment