简体   繁体   English

亚马逊ec2 -ebs-mySql-CouchDB-ldap

[英]Amazon ec2 -ebs-mySql-CouchDB-ldap

I already have a system running on amazon ec2 . 我已经在亚马逊ec2上运行了一个系统。 The system use three database MySql,CouchDB and ldap. 系统使用三个数据库MySql,CouchDB和ldap。 But now i want to use amazon ebs. 但现在我想用亚马逊ebs。 Can anyone please help me. 谁能帮帮我吗。 I am new to Linux. 我是Linux新手。 And do i need to change code which connect with these databases after i move databases in different ebs volumes?. 我在不同的ebs卷中移动数据库后,是否需要更改与这些数据库连接的代码?

EBS is Amazon's distributed storage solution for EC2 instances. EBS是亚马逊针对EC2实例的分布式存储解决方案。 Adding a new EBS volume to your instance is roughly the equivalent of adding a new hard disk to a physical server. 向您的实例添加新的EBS卷大致相当于将新硬盘添加到物理服务器。 It makes more storage space available but it's not a different server or anything, so you should not need to change the code that's responsible for connecting to your databases. 它提供了更多的存储空间,但它不是一个不同的服务器或任何东西,因此您不需要更改负责连接到您的数据库的代码。

I'd suggest you get started by reading this tutorial on installing MySQL on EBS: 我建议您先阅读本教程,了解如何在EBS上安装MySQL:
http://aws.amazon.com/articles/1663 Instead of using the command-line tools, you can also use the web management console at http://aws-portal.amazon.com/ to create and attach your EBS volume if you're unfamiliar with working from the command line. http://aws.amazon.com/articles/1663您也可以使用http://aws-portal.amazon.com/上的Web管理控制台来创建和附加您的EBS卷,而不是使用命令行工具。如果你不熟悉从命令行工作。 It'll still take a bit of command-line work to get MySQL up and running on a new EBS volume, though. 尽管如此,仍需要一些命令行工作才能让MySQL在新的EBS卷上运行。

The procedure for CouchDB and IDAP should be roughly similar: you shut down the database services, and create a backup of your data files. CouchDB和IDAP的过程大致相似:关闭数据库服务,并创建数据文件的备份。 In the meantime, you create a new EBS volume, attach it to your instance, use mkfs to prepare it for use, and mount it. 在此期间,您创建一个新的EBS卷,将其附加到您的实例,使用mkfs准备使用,然后安装它。 Then, you copy the data files to the new EBS volume, you change the configuration to let the servers know where the data files are now stored (ie the path to the directory on the EBS volume) and you restart your database services. 然后,将数据文件复制到新的EBS卷,更改配置以让服务器知道数据文件现在存储的位置(即EBS卷上目录的路径),然后重新启动数据库服务。 This should do the trick. 这应该可以解决问题。

You can either use one single EBS volume and put all of your data files on that volume, or use three separate volumes, one for each database. 您可以使用一个EBS卷并将所有数据文件放在该卷上,也可以使用三个单独的卷,每个卷对应一个数据库。 The latter option may be slightly faster. 后一种选择可能会稍快一些。

Hope this helps a bit. 希望这个对你有帮助。 It may take a bit of experimentation but it shouldn't be too hard. 这可能需要一些实验,但不应该太难。 Of course, don't test this on a production system :) 当然,不要在生产系统上测试这个:)

Adding to what @Daan stated, you should consider striping multiple EBS volumes into a software RAID configuration. 除了@Daan所说的,您应该考虑将多个EBS卷分离为软件RAID配置。

If you do not, you may well find that the EBS IO performance is too poor for a modestly busy MySQL instance. 如果不这样做,您可能会发现EBS IO性能对于适度繁忙的MySQL实例来说太差了。

For details on how to do that, check out 有关如何操作的详细信息,请查看

http://alestic.com/2009/06/ec2-ebs-raid http://alestic.com/2009/06/ec2-ebs-raid

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM