Quantcast

EC2 Amazon Beanstalk - mySQL + Redis on EBS?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

EC2 Amazon Beanstalk - mySQL + Redis on EBS?

Daxon
I'm about to launch my app on Beanstalk but I need a mySQL and Redis on the AMI

So I found this great tutorial on building a custom AMI from the beanstalk template

http://blog.jetztgrad.net/2011/02/how-to-customize-an-amazon-elastic-beanstalk-instance/

I'm going to install mySQL and Redis server on the Beanstalk AMI and then launch the app.

How can I start the redis-server before I load the war on beanstalk? Would i have to add a script file
somewhere on the AMI to run it upon booting the instance.

Also with mySQL what happens when more nodes get added? does it just copy the EBS instance with the data. As I'm not too sure whats going on with the database upon scaling out nodes.

Or would I just be better off using Terracotta? or how could i mix that in?
Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: EC2 Amazon Beanstalk - mySQL + Redis on EBS?

Wolfgang Schell
Hi Daxon,

Daxon wrote
So I found this great tutorial on building a custom AMI from the beanstalk template

http://blog.jetztgrad.net/2011/02/how-to-customize-an-amazon-elastic-beanstalk-instance/
Thanks, I'm flattered :-)

Daxon wrote
I'm going to install mySQL and Redis server on the Beanstalk AMI and then launch the app.

How can I start the redis-server before I load the war on beanstalk? Would i have to add a script file
somewhere on the AMI to run it upon booting the instance.
You can create a start script, move it to /etc/init.d/ and activate it using chkconfig like this:

chkconfig myredisscript on

See this blog (random search result) for an example.

Daxon wrote
Also with mySQL what happens when more nodes get added? does it just copy the EBS instance with the data. As I'm not too sure whats going on with the database upon scaling out nodes.

Or would I just be better off using Terracotta? or how could i mix that in?
If you install MySQL on your Beanstalk instance, you will get one MySQL database per instance, which is probably not what you want. You'll rather want one, possibly clustered or replicated, MySQL instance.

You could either run MySQL on another EC2 instance (outside Beanstalk!) or use Amazon RDS, which is a managed MySQL (and soon Oracle) service, which handles all the details and scaling.

You might want the same for your Redis instance, but in this case there is no managed service available, so you need to roll your own.

BTW: the new CloudFormation service might help you there. Check it out on the Amazon homepage.

Regards,

Wolfgang
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: EC2 Amazon Beanstalk - mySQL + Redis on EBS?

Wolfgang Schell
Wolfgang Schell wrote
You could either run MySQL on another EC2 instance (outside Beanstalk!) or use Amazon RDS, which is a managed MySQL (and soon Oracle) service, which handles all the details and scaling.
See this post for an example on how to replicate MySQL on EC2: http://www.nonhostile.com/howto-mysql-replication-amazon-ec2-aws.asp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: EC2 Amazon Beanstalk - mySQL + Redis on EBS?

Daxon
Thanks wolfgang,

Yea I've switched over to RDS, seems pricey, Might have to go with a Reserved Instance.
Seems like most people are saying that RDS is a lot slower than a MySQL EC2.
http://www.dotdeb.org/2010/05/04/mysql-on-amazon-benchmarks-rds-vs-ec2/

I've tried it out. Seems to work. I'm interested in the upcoming Oracle versions. Think i should wait it out
get a reserved instance on release?

Regarding the redis you're right. I'll have to host it on a EC2 outside of the beanstalk.
Loading...