2

I've been running a successful Wordpress install on Google Compute Engine with LEMP (Linux, NGINX, MySQL and PHP) stack, and Cloud SQL (Generation 2 MYSQL) and tried to tie in the domain last night using Cloud DNS.

I added the A record and CNAME and adjusted the nameservers in Google Domains, but nothing is loading.

At first, I was getting a 504 Bad Gateway NGINX/Ubuntu error, but now nothing happens.

However, I noticed that my IP address for Compute Engine changed, not sure how probably misunderstood something that I was reading and said yes.

Is there a way to change the Cloud SQL to see the new IP address? If so what is the process?

Trying to avoid having to rebuild everything, but I guess that's how you learn what not to do in the future.

Jason Lee
  • 21
  • 3

2 Answers2

2

Every Google Compute virtual machine has assigned by default an ephemeral IP address, which gets changed every time you restart it. You can read more about IPs, however I recommend you just promote the current ephemeral address as a static one and update your Wordpress config settings.

Please keep in mind that you could be in a security risk at this moment, because the old IP address that you granted access to your database might be assigned to another user.

Alex Palcuie
  • 4,434
  • 3
  • 22
  • 27
  • Thanks for the information on the IP's, but how do you actually change the WordPress config settings when you can't get into your WordPress site through the VM. – Jason Lee Apr 17 '17 at 17:15
  • It should be possible to SSH into the VM, even though it changed it's IP address. You can go to the [instances](https://console.cloud.google.com/compute/instances) page, find your VM and click the `SSH` URL under `Connect`. – Alex Palcuie Apr 18 '17 at 10:28
0

In addition to Alex Palcuie's great answer re promoting a VM's ephemeral IP to a static IP, here's how you reconfigure Cloud SQL to allow only the new IP address.

Alex
  • 661
  • 1
  • 5
  • 18