技巧,让一个AWS现货实例"持续性和QUOT;? [英] Tricks to make an AWS spot instance "persistent"?

查看:133
本文介绍了技巧,让一个AWS现货实例"持续性和QUOT;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户使用AWS他个VPS。一件事情是他具有一个问题是,如果该出价当场实例越过他出价,则他的实例被终止。没有这样一个大问题,这似乎只是现货实例不是持久的,所以我们必须从图像中每出现这种情况的时间恢复。

My client uses AWS for his VPSes. One thing he is having a problem with is that if the bids for the spot instance go above his bids, then his instances are terminated. Not such a big deal, it would seem, except that spot instances aren't persistent, so we have to restore from an image every time this happens.

他是什么要我做的是写东西,将检查终止的实例时每X量,并自动重新启动它们。更重要的是,他想要某种方式假装持久性。最好的办法我是直接从每个服务器从该映像创建图像的时候每ÿ量再开机(如果/当该实例终止)。

What he is wanting me to do is write something that will check for terminated instances every X amount of time, and restart them automatically. More importantly, he wants some sort of way to feign "persistence". The best idea I have is to simply create an image from each server every Y amount of time and then boot from that image (if/when that instance is terminated).

任何其他的想法将是很好听。我想我的问题是,我是在正确的轨道在这里,做你们知道的,可能已存在的任何解决办法吗?

Any other ideas would be nice to hear. I guess my question is, am I on the right track here, and do you guys know of any solutions for this that may already exist?

更新:差不多一年后,我回到这里找到所有这些奇妙的反应和更多的关注比我所期待的话题。很多下面的答案,而信息和乐于助人,质疑我的推理。我想指出,即使在那个时候,我同意了100%,这不是一个明智的想法,但什么我的客户要求,尽管对我的一部分的任何企图,把事情向好的方向发展。

UPDATE: Almost a year later, I come back here to find all these wonderful responses and much more attention to the topic than I'd ever anticipated. A lot of the below answers, while informative and helpful, question my reasoning. I want to state that, even at that time, I agreed 100% that this was not a wise idea, but was what my client demanded, despite any attempt on my part, to turn things in a better direction.

感谢大家非常的帮助。我没有最终搞清楚如何做的正是我想要的,并能写一些code,它会自动重新登场终止的实例。这是很不容易的,但通过我转移到一个新的客户端的时候效果很好。

Thank you all very much for your help. I did end up figuring out how to do exactly what I wanted, and was able to write some code that automatically relaunches terminated instances. It was never easy, but it worked well by the time I moved on to a new client.

祝你们任何人有同样的问题,你承担(可能通过武力,因为是我的情况)的东西,并不容易。现货请求是便宜,因为有些人在这里提到在他们的反应,特别的,因为的持久性不提供。否则,我想象中的点要求的市场会定价多少不同。

Good luck to any of you with the same problem, you're undertaking (possibly by force, as was my case) something that won't be easy. Spot requests are cheaper, as some folks here alluded in their responses, specifically because persistence is not offered. Otherwise, I imagine the "spot request" market would be priced much differently.

都是一样的,它的的可能,我做到了,这是一个很好的经验。当没有办法,你必须建立它!如果你不这样做,别人会。

All the same, it is possible, I did it, and it was a great experience. When there isn't a way, you have to forge it! If you don't, someone else will.

更新二:我只是想提醒大家,这是我的东西基本上负责。虽然很多人只是驳回了整个概念的时候,我结束了与更多或更少的功能的SaaS允许人们轻松地管理和监控所有的人现货实例,其中包括能够启用元/禁用自动持久重新开张例如,计划时间为单个实例(他们应该或不应该永远不会启动,)等。

UPDATE II: I just want to remind everybody that this is something I was essentially tasked with. While many people just dismissed the entire concept at the time, I ended up with an more-or-less functional SaaS allowing one to easily manage and monitor all of ones' spot instances, including the ability to enable/disable auto-persistent relaunch per instance, schedule times for individual instances (that they should or should not ever be started,) etc.

虽然我绝对同意,从开发商的角度来看,它是一个不雅的需求,并在当时,我做的没有的要做到这一点,我还是会说,这是一种不错的方式,被要求进行这项工作,因为我不仅学到的很多的,我不仅收获了很多信心,我的能力和我的code,但我公司生产的真正有用的,而且据我所知,很有价值的软件为我的客户(即使他们要求对错误的东西,因为他们不知道更好)。

While I absolutely agree that, from a developer's point of view, it is an inelegant demand, and at the time, I did not want to do it, I'd still say that it was kind of nice in a way, being demanded to work on it, because not only did I learn a lot, not only did I gain a lot of confidence in my ability and my code, but I produced a really useful and, as far as I know, very valuable piece of software for my client (even if they were asking for the wrong things because they didn't know better).

我试图说服他离开,但他坚持认为,既然他是一个付出,我集中了我的注意那里,不仅实现了许多在这里斥为愚蠢,但使得它的盈利的有人。

I tried to talk him out of it, but he insisted, and since he was the one paying, I focused my attention there and not only accomplished what many here dismissed as silly but made it profitable for someone.

如果它是的的愚蠢,就不会保存任何人的钱。

If it were that silly, it wouldn't have saved anyone money.

你看,我现在读这篇文章,并畏缩了一点。我多了很多幼稚的话。我知道一个AWS的很多的更好,现在,我codeA的很多的现在好了,等自然。

Look, I read this post now and cringe a little. I was a lot more naive, then. I know AWS a lot better, now, I code a lot better now, etc. Naturally.

但是,我还是感到自豪解决这一块,特别是因为它是这些家伙的,年龄大了,更多的经验,毫无疑问的伟大的程序员谁是那些告诉我,它不能或不应该 T为完成。你是那些谁做的一个挑战,我,所以谢谢!

But I am still proud of solving this one, especially since it was these fellow, older, and much more experienced, undoubtedly great programmers who were the ones telling me it couldn't or shouldn't be done. You were the ones who made it a challenge to me, so thank you!

如果可以盈利呢?你肯定不应该?

What if it can be done profitably? Are you sure that it shouldn't?

推荐答案

我们最终找到一个解决办法,这里是我们必须做的。我要列出了这一点,一步一步,使重建这更容易为那些谁可能会寻找一个相似类型的解决方案...

We ended up finding a solution, and here is what we had to do. I'm going to list this out step-by-step, to make recreating this easier for those who may be looking for a similar type of solution...

  1. 创建一个新的点请求实例。确保取消选中删除关于终止为根设备,使体积留下的下一步。请务必注意架构(我们总是用x86_64的),并且您的实例正在使用内核ID(很重要!)
  2. 现在,SSH到新的实例,使文件什么的,所以你可以看到的持久性第一手的效果。作出一些改变文件系统后,继续前进,SSH连接的退出和终止的实例。
  3. 真棒。现在,转到您的EC2的Web控制台,发现正被用于我们刚刚终止的实例的新卷。右键单击卷,然后选择创建图像。按照向导,使得一定要选择相同的架构和内核的ID,我们前面提到的。
  4. 现在,用你的新形象启动点请求向导。按照向导,又使某些取消选中删除关于终止。此外,这是最简单的一步错过,一定要展开折叠的标题为高级选项,然后重新设置正确的内核ID。

如果您按照到T上面的步骤,你将不得不在同一点上,你的旧的实例是,在它被终止,当一个新的实例。因此,我们已经取得了一定形式的持久性。

If you follow the above steps to the T, you will have a new instance at the same point that your old instance was at when it was terminated. Therefore, we have achieved some form of persistence.

这篇关于技巧,让一个AWS现货实例"持续性和QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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