Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support MySQL 2nd gen to set up HA #5567

Closed
wants to merge 1 commit into from

Conversation

ozashu
Copy link

@ozashu ozashu commented Feb 3, 2020

#5286
Confirmed that MySQL(Cloud SQL) 2nd generation 5.7 is also able to set up for high availability. 

The documentation needs to be fixed as:Availability type - (Optional) This specifies whether a PostgreSQL instance should be set up for high availability (REGIONAL) or single zone (ZONAL). It can be also applied for MySQL 2nd Gen. For MySQL, it should be set up for high availability (REGIONAL)without creating Failover replica instance using terraform apply command.

@ghost ghost added the size/xs label Feb 3, 2020
@ghost ghost requested review from rileykarson February 3, 2020 11:01
@ghost ghost added the documentation label Feb 3, 2020
Copy link
Collaborator

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM- I'll upstream this so the fix gets applied to the google-beta docs as well.

Copy link
Collaborator

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I was unable to configure this in MySQL failing for the same reason as the linked issue. Can you share your repro?

@ozashu
Copy link
Author

ozashu commented Feb 5, 2020

Here is terraform plan result .

      ~ settings {
            activation_policy           = "ALWAYS"
            authorized_gae_applications = []
          + availability_type           = "REGIONAL"

And here is terraform apply result.

Apply complete! Resources: 1 added, 1 changed, 0 destroyed.

It failed when I created failover replica instance.
I destroyed it and applied terraform setup MySQL HA.

@rileykarson
Copy link
Collaborator

That's a failure for me as well, through both Terraform and the console. Can you share the actual config you're using? It's possible I'm missing some required setting on my instance.

@ozashu
Copy link
Author

ozashu commented Feb 6, 2020

@rileykarson
Here is terraform plan's result of Excerpt.

      ~ settings {
            activation_policy           = "ALWAYS"
            authorized_gae_applications = []
          ~ availability_type           = "ZONAL" -> "REGIONAL"
            crash_safe_replication      = false
            disk_autoresize             = true
            disk_size                   = 10
            disk_type                   = "PD_SSD"
            pricing_plan                = "PER_USE"
            replication_type            = "SYNCHRONOUS"
            tier                        = "db-n1-standard-2"
            user_labels                 = {}
            version                     = 16

            backup_configuration {
                binary_log_enabled = true
                enabled            = true
                start_time         = "18:00"
            }

Couldn't you create MySQL HA instances by GCP console?
MySQL HA needs "The Automate backups and Enable binary logging checkboxes enabled"
and "Selecting the High availability (regional) checkbox"

@ozashu ozashu requested a review from rileykarson February 19, 2020 04:24
@aharelick
Copy link

As @ozashu mentioned it looks like there is an API restriction and in order to use a REGIONAL instance you have to enable backups and binary logs (which share a setting with point in time backups). That restriction should probably be added to both the CloudSQL API docs and these terraform docs.

terraform-google-modules/terraform-google-sql-db#71 (comment)

@ozashu
Copy link
Author

ozashu commented Jun 1, 2020

#6254

@ozashu ozashu closed this Jun 1, 2020
@ozashu ozashu deleted the fix/clousql_mysql_2nd_gen_HA branch June 1, 2020 09:31
@ghost
Copy link

ghost commented Jul 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants