Saving battery power when shooting

After making the shot, we either want to see what we have. Or run further for the following pictures, there is no time to look. In both cases, the camera’s usually settings to show the picture for 2…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Google Cloud SQL proxy with Autoscaling

One of the best feature of GCP is Autoscaling in Managed instance group.

Nowadays all applications need auto scaling feature as one can predict the traffic all the time and we do need our application ready for any type of traffic and also not pay extra when there is no traffic.

A managed instance group uses an template to create a group of identical instances. You control a managed instance group as a single entity. If you wanted to make changes to instances that are part of a managed instance group, you would make the change to the whole instance group.

In case of high traffic autoscaling will use this instance template and launch a new server to handle the requests in the instance group and also scale down when needed.

Till now all seems good and easy.

Now your application needs a database.

Google Cloud SQL is a fully-managed database service that makes it easy to set up, maintain, manage, and administer your relational databases on Google Cloud Platform. You can use Cloud SQL with either MySQL or PostgreSQL.

My application is a wordpress application on GCE and database on Google Cloud SQL. As we know Google Cloud SQL allows connection from authorized IP only. But all the new instances created in managed instance group have new external IP which are not static. So in order to allow all my new instances connect to my Google Cloud SQL instance what i can use is Cloud SQL proxy.

The Cloud SQL Proxy provides secure access to your Cloud SQL Second Generation instances without having to whitelist IP addresses or configure SSL.

Cloud SQL Proxy Installation on GCE

These steps are performed on instances but as our instances are created on demand the solution to this would be to add these steps in startup scripts.

Eg:

This will allow every new instance created in that instance group able to connect to google cloud SQL.

You can also use service accounts to authenticate the instance . The service account for that instance can be grabbed from default instance metadata values.

Add a comment

Related posts:

The 5 Best Podcasts on Tech in China

With 772 million internet users and 717 million smartphone users, China accounts for 19% of the world’s internet users and 26% of the world’s smartphone users. In 2018, the average adult in China…

Why I left Austin for St Louis

You left Austin for St Louis (STL)? You left the coolest city in America for one of the most dangerous? It doesn’t make sense on the surface. It really doesn’t. Austin is a great city. It was a smart…

Ikaw lang

Salamat sa lahat ng ginawa mo. “Ikaw lang” is published by Johncesar Caalem.