我应该使用常规服务器而不是 AWS 吗?

发布于 2024-10-11 13:48:44 字数 482 浏览 1 评论 0原文

在阅读和使用亚马逊网络服务时,我并不能真正掌握如何正确使用它。对于这个长问题抱歉:

我有一个 EC2 实例,它主要完成 Web 服务器的工作(用于文件共享的 apache 和用于 Web 应用程序的带有 Play Framework 的 Tomcat)。由于它是一个 Web 服务器,因此该实例全天候 (24/7) 运行。

我刚刚注意到 EC2 实例上的数据是非持久性的。这意味着如果停止,我会丢失数据库和文件。但我想这也意味着我的服务器设置和安装的应用程序丢失了,因为它们只是与其他数据相同的文件。

这意味着我要么必须重写整个应用程序才能使用亚马逊 CloudDB,要么编写一些将数据库存储在 S3 上的代码,并使用安装和配置的正确应用程序创建我自己的 AMI。或者可以通过使用 EBS 以某种方式快速解决这个问题吗?

我的问题是1.我对aws的理解是否正确? 2.值得吗?正如您所期望的,可以只设置一个常规的专用服务器,其中所有内容都是持久的。不过我希望拥有 aws 的可扩展性..

Reading about and using the Amazon Web Services, I'm not really able to grasp how to use it correctly. Sorry about the long question:

I have a EC2 instance which mostly does the work of a web server (apache for file sharing and Tomcat with Play Framework for the web app). As it's a web server, the instance is running 24/7.

It just came to my attention that the data on the EC2 instance is non persistent. This means I lose my database and files if it's stopped. But I guess it also means my server settings and installed applications are lost as they are just files in the same way as the other data.

This means that I will either have to rewrite the whole app to use amazon CloudDB or write some code which stores the db on S3 and make my own AMI with the correct applications installed and configured. Or can this be quick-fixed by using EBS somehow?

My question is 1. is my understanding of aws is correct? and 2. is it's worth it? It could be a possibility to just set up a regular dedicated server where everything is persistent, as you would expect. Would love to have the scaleability of aws though..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

左耳近心 2024-10-18 13:48:44

如果您将 EBS 卷与 EC2 实例一起使用,则可以安装/卸载它们以获得持久存储。您还可以使用 Amazon RDS 来处理您的数据库,这很方便(但价格可能会稍高一些)。

因此,考虑它的一种方法是:

您的 EC2 实例:完全按照您想要的方式设置操作系统与您的 Web 应用程序一起 - 基本上,将您的静态内容全部就位。

EBS 卷:可以安装并用于用户上传等操作。

RDS 实例:这是一个没有麻烦的专用数据库服务器。这很好 - 我使用 MySQL RDS,它每天自动进行两次备份,并且像 EC2 实例一样可扩展。

If you use an EBS volume with your EC2 instance, you can mount/dismount them to have persistent storage. You can also use Amazon RDS to handle your database too which is handy (but can be slightly on the pricier side.)

So a way to think of it is:

Your EC2 instance: Get the OS set up exactly like you'd like it along with your web application - basically, get your static stuff all in place.

EBS volume: That can be mounted and can be used for things like user uploads.

RDS instance: This is a dedicated database server with no hassles. It's nice - I use a MySQL RDS and it automatically makes two daily backups, and is scalable like EC2 instances.

蓝梦月影 2024-10-18 13:48:44

Amazon Web Service 是托管应用程序的更好方法 Jon。您对 AWS 有基本的了解,但您需要知道您还可以启动持久实例。只需启动一个持久性 AMI 实例即可。您还可以像常规服务器一样在实例上安装数据库、网络服务器。运行 Ec2 实例和专用服务器可能只有很小的差异。如果您还有其他问题可以联系我。

Amazon Web Service is a better approach at hosting your applications Jon. You have a basic understand of AWS but you need to know that you can also launch an instance that is persistent. Just launch an instance of a persistence AMI. Also you can install you database,webs server on the instance like a regular server. There is probably just minimal differences from running an Ec2 instance and a dedicated server. If you have any other questions you can contact me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文