开发者

How do I point Apache at a separate EC2 instance with MySQL?

So...I want to put the Web Server on one EC2 instance and the MySQL database on a separate EC2 instance. Which I can do, but how would I point the web server over to the ot开发者_Python百科her instance that I am using for MySQL?


You know Amazon do offer a specialized MySQL instance instead of standard instances, just gives backups, etc.

I'm not sure whether you mean how do you expose MySQL service as a port, or how to identify the database instance.

You can expose MYSQL on a machine port as service and access through telnet or SSH (usually SSH). The default is 3306, I believe.

To get the IP of the database instance, create and assign an elastic IP to the DB instance and use that.


Every instance of EC2 that is spun up has a number of domain names associated with it.

You probably want to use the internal address for communication (saves you money). It looks something like domU-12-31-39-00-86-35.compute-1.internal and is treated like any other hostname.

The issue with using such internal addresses, rather than elastic IP, is that if things reboot, you need to update the internal addresses. Your mileage may vary, but I was part of a project that ran for months and saw no EC2 reboots (other than what the team rebooted themselves).

See http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?concepts-instance-addressing.html for more on addressing (look for "Using Instance IP Addresses" -- Amazon doesn't like deep linking, apparently).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜