如何将 AWS 托管网站与 EBS 上的数据库连接?
我工作的初创公司正在构建一个网站,我们希望使用 AWS 来运行和托管我们的网站以及随附的 mysql 数据库。显然,当您终止 AWS 实例时,存储在其上的所有数据都会丢失,因此我们会将数据库保留在 EBS 系统上。但我不明白的是如何连接在这两个不同平台上运行的东西。我如何告诉 Web 服务器数据库在哪里?
抱歉,如果这真的是一个菜鸟问题。仍在尝试掌握整个云服务的工作原理。
The startup I'm working for is constructing a website, and we want to use AWS to run and host our site and the accompanying mysql database. Apparently when you terminate an AWS instance, any data stored on it is lost, so we would be keeping the database on the EBS system. The thing I can't figure out, though, is how to interface things running on these two different platforms. How do I tell the web server where the database is?
Sorry if this is a really noob question. Still trying to grasp how this whole cloud service works.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没看错,您的数据库位于安装在同一台机器上的 EBS 上,如果是这种情况,您必须确保告诉 MySQL (my.cnf) 将其
datadir
指向 EBS目录。休息如常。您的
主机
是localhost
和您的用户凭据。顺便说一句,仅供参考,亚马逊的数据库还有一个选择,那就是 RDS (http://aws.amazon.com/rds/),它提供了很多功能和优势,请看一下。
If I am reading correct, your DB is on the EBS mounted on the same machine, if that is the case, you have to make sure you tell MySQL (my.cnf) to point it's
datadir
to EBS directory.Rest is as usual. Your
host
islocalhost
and your user credentials.BTW, FYI, there is one more option from Amazon for DB that is RDS (http://aws.amazon.com/rds/) which provides lots of functionality + advantages, take a look at it.