简体   繁体   English

如果写入并行进行,则计划快照在Google Cloud中是否会对(实例磁盘/快照磁盘)有影响?

[英]In Google Cloud does Schedule Snapshots have any impact on (instance disk/snapshot disk) if writes are going on parallely?

I am trying to schedule snapshots for my GCP instances and I just wanted to know is there any possibility that my snapshot data or actual disk data can get corrupted/ OR will be impacted by any way. 我正在尝试为我的GCP实例安排快照,我只是想知道快照数据或实际磁盘数据是否有可能损坏/或将受到任何影响。 I mean suppose I am creating snapshot and at the same time some writes are going on how can I ensure that this will not cause any error on my actual disk or in my snapshots? 我的意思是假设我正在创建快照,同时正在进行一些写操作,如何确保这不会在实际磁盘或快照中引起任何错误?

The answer depends on your operating system. 答案取决于您的操作系统。

Microsoft Windows Server support snapshots. Microsoft Windows Server支持快照。 Windows will stop file system activity and prepare for the snapshot. Windows将停止文件系统活动并准备快照。 This is a safe operation while the OS is running. 在操作系统运行时,这是一种安全的操作。

Linux does not do anything special when a snapshot is taken (without adding third-party software). 拍摄快照时,Linux并没有做任何特别的事情(不添加第三方软件)。 This means that snapshots on Linux are NOT safe while the OS is running. 这意味着在操作系统运行时,Linux上的快照并不安全。 Shutdown the OS, then snapshot or image the disk and restart the instance. 关闭操作系统,然后对磁盘进行快照或映像并重新启动实例。

Unless an operating system does special things for a snapshot, open files, caching, database handles, etc. are in memory. 除非操作系统对快照进行特殊处理,否则打开的文件,缓存,数据库句柄等将存储在内存中。 This data is not part of the snapshot. 此数据不是快照的一部分。 Therefore, this will cause, in some cases, inconsistent snapshots. 因此,在某些情况下,这将导致快照不一致。 This means data corruption. 这意味着数据损坏。

Google does NOT recommend snapshotting live systems. Google不建议使用实时系统快照。 Neither does AWS or Azure. AWS或Azure都没有。

Since the snapshotting of a persistent disk is not instantaneous, having writes in parallel could potentially corrupt the operation. 由于持久性磁盘的快照不是瞬时的,因此并行写入可能会破坏操作。

A safe snapshotting process is typically made following these steps: 通常,请按照以下步骤进行安全的快照过程:

  1. Flush your disk's buffers before a snapshot 快照前刷新磁盘缓冲区
  2. Freeze and unmount your filesystem 冻结和卸载文件系统
  3. Take the snapshot 拍摄快照
  4. Remount the persistent disk 重新安装永久磁盘

These best practices are directly recommended by Google Cloud and described as follows: https://cloud.google.com/compute/docs/disks/snapshot-best-practices 这些最佳做法由Google Cloud直接推荐,并描述如下: https : //cloud.google.com/compute/docs/disks/snapshot-best-practices

Yeap, it is recommended to stop your instance before you take the snapshot, but in my experience, if the instance is still running; 是的,建议您在创建快照之前先停止实例,但是根据我的经验,如果实例仍在运行; the I/O from it doesn't seem affected. 它的I / O似乎没有受到影响。 But the actual information in the snapshot may be corrupted. 但是快照中的实际信息可能已损坏。

Remember to review the quotas of your project on schedule snapshots and the cost will be related around the network traffic. 切记要按计划快照查看项目的配额,而成本将与网络流量有关。

I let you a link with more info about schedule snapshots: https://cloud.google.com/compute/docs/disks/scheduled-snapshots 我为您提供了有关时间表快照的更多信息的链接: https : //cloud.google.com/compute/docs/disks/scheduled-snapshots

No. 没有。

There is no impact on Persistent Disk performance while snapshot is taken. 拍摄快照时对永久磁盘性能没有影响。

Snapshot will persist all completed IO operations up to a point in time when snapshot was taken. 快照将保留所有已完成的IO操作,直到拍摄快照的时间点为止。 However, depending on application you are using, it may be in inconsistent state. 但是,根据您使用的应用程序,它可能处于不一致状态。 Eg if you run MySQL with innodb_flush_log_at_trx_commit = 2 you may lose some data as some transactions may not be flushed to PD before they are acknowledged to application. 例如,如果您使用innodb_flush_log_at_trx_commit = 2运行MySQL,则可能会丢失一些数据,因为某些事务在被确认为应用程序之前可能未刷新为PD。

If you run MySQL with innodb_flush_log_at_trx_commit = 0 (default) then theoretically it should be able to do a crash recovery and restore all committed translations. 如果使用innodb_flush_log_at_trx_commit = 0 (默认值)运行MySQL,则理论上它应该能够进行崩溃恢复并还原所有提交的转换。 In practice bugs in applications and filesystems are possible, so I'd advice to test your recovery procedures periodically. 实际上,应用程序和文件系统中可能存在错误,因此建议您定期测试恢复过程。

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

相关问题 谷歌云磁盘快照默认区域? - Google Cloud disk snapshots default region? 即使谷歌云中的磁盘已满,快照大小是否小于实际磁盘大小? - Does snapshot size is less than actual disk size even disk is full in google cloud? Google Cloud - 将永久性磁盘快照复制到另一个项目 - Google Cloud - Copy Persistent Disk Snapshots To Another Project Google Engine计算实例-实例磁盘与快照的大小 - Google engine compute instance - size of instance disk vs snapshot 使用Google Cloud Python API客户端创建磁盘快照 - Create disk snapshot using google cloud python api client 如何从Google Cloud Function中的快照创建磁盘-Node.js - How to create disk from snapshot in google cloud function - node js 无法使用Google Cloud Engine API从快照创建磁盘 - Unable to create disk from snapshot using google cloud engine API 将Google-Cloud磁盘快照获取到本地存储(内部部署) - Getting Google-Cloud Disk Snapshots to Local-Storage (on-premise) 使用具有抢占式谷歌计算实例的持久谷歌云磁盘时磁盘损坏的风险? - Risk of disk corruption when using a persistent google cloud disk with a preemptible google compute instance? Google云端:无法将磁盘添加到具有写许可权的实例模板 - Google Cloud: can't add disk to instance template with write permission
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM