亚马逊ec2 实例删除_自动化Amazon EC2实例备份和恢复,第一部分

亚马逊ec2 实例删除 第一部分:使用Cron计划快照 (Part One: Scheduling Snapshots Using Cron)Skill Level: IntermediateOperating System(s): Linux 技能级别:中级操作系统: Linux 哲学 (Philosophy)99.999% Uptime. That is a wonderful go...
摘要由CSDN通过智能技术生成

亚马逊ec2 实例删除

第一部分:使用Cron计划快照 (Part One: Scheduling Snapshots Using Cron)

Skill Level: IntermediateOperating System(s): Linux

技能级别:中级操作系统: Linux

哲学 (Philosophy)

99.999% Uptime. That is a wonderful goal, and in order to get there we must plan for the inevitable outages and problems that cause our servers to break.

正常运行时间为99.999%。 这是一个绝妙的目标,为了达到目标,我们必须为不可避免的停机和导致服务器故障的问题进行计划。

The best we can do is to be prepared with the Three P’s: Planning, Process, and Practice.

我们能做的最好的事情就是准备三个P:计划,流程和实践。

So how do we plan for the worst? Make backups, of course! The best kind are those that:

那么我们如何计划最坏的情况呢? 当然要备份! 最好的是:

  • Run automatically,

    自动运行
  • Are stored someplace other than the server that is being backed up,

    存储在备份服务器以外的其他地方,
  • Fast and easy to restore,

    快速简便地还原,
  • Don’t cost a fortune to run or keep.

    无需花费大量财富即可运行或保留。

Since we are on AWS, that is very easy to accomplish.

由于我们使用的是AWS,因此非常容易实现。

计划 (The Plan)

Configure a daily event to create a backup copy of our entire EC2 instance.

配置每日活动以创建整个EC2实例的备份副本。

We will use the cron command to schedule an AWS Elastic Block Store (EBS) snapshot, which makes a point-in-time image of the entire filesystem at the time the snapshot is run, and may be used later to recover the instance in the event of a failure. Note that only AWS instances that are EBS-backed may use this method.

我们将使用cron命令安排一个AWS Elastic Block Store(EBS)快照,该快照将在运行快照时为整个文件系统创建一个时间点映像,以后可用于在快照中恢复实例。故障事件。 请注意,只有具有EBS支持的AWS实例可以使用此方法。

先决条件: (Prerequisites:)

  • access to your AWS Account» Security Credentials page

    访问您的AWS账户 »“安全凭证”页面

  • access to the AWS Management Console Web GUI

    访问AWS管理控制台Web GUI

  • root access to a running AWS EC2 EBS-backed Linux instance – for example:

    对正在运行的由AWS EC2 EBS支持的Linux实例的root访问权限–例如:

    ssh -i AWSKeyPair.pem ec2-user@{yourInstance_FQDN_or_IP}
    % sudo su
    root@yourInstance#

安装所需的工具 (Install the Needed Tools)

In order to do this we will need the following things:

为此,我们需要执行以下操作:

AWS X.509证书和私钥文件 (AWS X.509 Certificate and Private Key Files)

These two files allow your server to execute AWS EC2 instance commands securely.

这两个文件使您的服务器可以安全地执行AWS EC2实例命令。

alt

They are obtained from the AWS Account » Security Credentials page. Towards the bottom of the page locate three tabs: “Access Keys”, “X.509 Certificates”, and “Key Pairs”. Once found, click the middle one, “

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值