简体   繁体   English

我可以使用 GCP 快照进行数据或数据库备份吗? 我可以信任快照来恢复我的数据库数据吗?

[英]Can I use GCP Snapshot for data or database backup? can I trust the snapshot to restore my DB data?

I am using the Google cloud platform and compute engine for my project, Installed MongoDB into the instance server, what is the best way to take my database back-up and restore我正在为我的项目使用谷歌云平台和计算引擎,将 MongoDB 安装到实例服务器中,备份和恢复我的数据库的最佳方法是什么

my options:我的选择:

  1. create a custom script to dump -> zip -> upload to cloud storage.创建自定义脚本转储 -> zip -> 上传到云存储。
  2. Use GCP snapshot to back-up data and restore while a new instance creating.在创建新实例时使用 GCP 快照备份数据和恢复。

Let me know the best way of handling this.让我知道处理此问题的最佳方法。

Due to the non-reliable snapshot size got confused a bit.由于不可靠的快照大小有点混乱。

While schedule snapshot虽然计划快照

启用应用程序一致快照

Yes you can use snapshot.是的,您可以使用快照。 Also consider below suggestion也考虑下面的建议

Use additional data disk attached to Compute Instance for Database.使用附加到 Compute Instance for Database 的附加数据磁盘。 In case any failure detach the disk and attach to new vm instance.如果出现任何故障,请分离磁盘并附加到新的 vm 实例。 Snapshot will help you in regional failure or when you need to restore backup in another region.Also snapshot size seems confusing to you because snapshots are incremental in nature.快照将在区域故障或需要在另一个区域恢复备份时为您提供帮助。快照大小也让您感到困惑,因为快照本质上是增量的。 ex.前任。 snapshot-1 taken at 2:00 AM contains 10GB data.在凌晨 2:00 拍摄的快照 1 包含 10GB 数据。 now you added 1 GB data to the disk at 2:30 AM and taken snapshot again at 3:00 AM.现在您在凌晨 2:30 向磁盘添加了 1 GB 数据,并在凌晨 3:00 再次拍摄快照。 snapshot-2 at 3:00 AM will only contains 1 GB of data ( not 11 GB).凌晨 3:00 的快照 2 将仅包含 1 GB 的数据(不是 11 GB)。 but real magic is when you restore snapshot-2 , it will restore your complete 11GB of data as it contains reference to snapshot-1 with 10GB data.但真正神奇的是当您恢复 snapshot-2 时,它将恢复您完整的 11GB 数据,因为它包含对具有 10GB 数据的 snapshot-1 的引用。

Yes Snapshots are reliable.是的,快照是可靠的。 You can use snapshots to create point in time image for your disk.您可以使用快照为磁盘创建时间点映像。 In your case, you can take data disk snapshots.在您的情况下,您可以拍摄数据磁盘快照。 To recover data from snapshot create a disk from snapshot and attach to existing vm.要从快照中恢复数据,请从快照创建磁盘并附加到现有虚拟机。

To automate mounting this you can run the gcloud commands in a bash/python script.要自动安装它,您可以在 bash/python 脚本中运行 gcloud 命令。 https://cloud.google.com/compute/docs/disks/restore-snapshot#create-disk-from-snapshot https://cloud.google.com/compute/docs/disks/restore-snapshot#create-disk-from-snapshot

For taking regular snapshots you can setup snapshot schedule and how many times a day it should happen.对于定期拍摄快照,您可以设置快照计划以及一天应该发生多少次。 To save costs you can keep retention too.为了节省成本,您也可以保留保留。 https://cloud.google.com/compute/docs/disks/scheduled-snapshots https://cloud.google.com/compute/docs/disks/scheduled-snapshots

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 HTML 中显示快照数据? - How can I display the snapshot data in HTML? 如何从 firebase 数据快照中获取特定的 snapkey - How do I get a specific snapkey from firebase data snapshot AWD RDS 最终手动快照是完整的还是增量的? 可以恢复最终的手动快照,如果删除了事件,则您拍摄了所有其他手动快照 - AWD RDS final manual snapshot are full or incremental ? final manual snapshot can be restore, event if deleted you taken all other manual snapshots Flutter:更新 Firebase 快照数据 - Flutter: update Firebase snapshot data 接收数据快照的次数 - Number of times data snapshot is received GCP:如何备份安装到文件存储的实例,或者基本上我想备份谷歌云平台中的文件存储 - GCP: How can I take backup of an instance that is mount to the file store or basically I want to take a backup of file store in google cloud platform 如何在 AWS 上没有快照备份的情况下恢复意外删除的 AMI? - How do I recover an accidentally deleted AMI without a snapshot backup on AWS? 我可以从 S3 中的本地快照启动 MariaDB RDS 实例吗? - Can I launch a MariaDB RDS instance from a local snapshot in S3? 如何在 DropdownButton flutter 中的数组中放置 String 的 snapShot 列表 - How can I put a list of snapShot of String in array inside the DropdownButton flutter 从 Firebase 数据快照中提取数据 - Extracting data from Firebase data snapshot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM