如何减少 Google Cloud SQL 实例大小? [英] How to reduce Google Cloud SQL instance size?

查看:32
本文介绍了如何减少 Google Cloud SQL 实例大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 70GB 未使用存储空间的 Google Cloud SQL MySQL 第二代 5.7 实例.我想减少实例的未使用存储,因为这是主要的托管成本之一.

I have a Google Cloud SQL MySQL 2nd Gen 5.7 instance with 70GB of unused storage. I want to reduce the unused storage of my instance as this is one of the major hosting costs.

我认为唯一可行的方法是将所有数据库转储到使用正确存储容量创建的新 Google Cloud SQL 实例中.然而,这种方法有几个缺陷:

The only way that I'm seeing as a possibility is dumping all the database to a new Google Cloud SQL instance created with the right storage capacity. However this approach has several pitfalls:

  • 转储和加载数据库需要大量时间(这将需要使用数据库的网站严重停机)
  • 我将不得不更改所有使用该数据库的网站,因为数据库的 IP 会发生变化

我有哪些选择?

推荐答案

正如 官方文档,不能减少 Cloud SQL 实例的存储容量.如果需要,您可以为实例提供更多容量,但更改是永久性的,无法回滚.

As it is indicated in the official documentation, it is not possible to reduce the storage capacity of a Cloud SQL instance. You can give more capacity to an instance if needed, but the change is permanent and cannot be rolled back.

现在对您来说最好的选择是创建一个 SQL 转储文件 并将您当前的数据导出到其中.然后,在具有所需容量的新 Cloud SQL 实例中,导入SQL 转储文件,以便您的所有数据都存储在新实例中.为了减少此过程的时间和成本,请遵循这些最佳做法,包括使用适当的标志、压缩数据和其他可用于更快、更便宜的导入和导出的技巧.

The best option for you right now would be to create a SQL dump file and export your current data into it. Then, in a new Cloud SQL instance with the desired capacity, import the SQL dump file so that all your data is stored in the new instance. To reduce time and costs for this process, please follow these best practices, including the use of the appropriate flags, compressing your data and other tips available for faster and less expensive imports and exports.

但是,已要求将减少 Cloud SQL 实例容量的可能性作为一项新功能 目前正在开发中.前往链接并点击左上角的星形图标,以获取有关此请求取得的任何进展的电子邮件通知.

However, the possibility of reducing the capacity of a Cloud SQL instance has been requested as a new feature and is currently being worked on. Head to the link and click on the star icon on the top left corner to get email notifications on any progress made on this request.

这篇关于如何减少 Google Cloud SQL 实例大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆