Setup Blog on EC2


April 9, 2008 by Tom (0 Comments)

Ok, so I moved to Amazon EC2 from the old host, www.apthost.com. Apthost was great (and I still have them of course for a while), but oddly enough my sessions started having issues and I couldn't log in to the admin back end of my application...I thought I broke my code...naturally I check it locally then on another server of mine. It worked. So I'm going to assume (without spending a ton of time) that Apthost did something to their php.ini or other settings that created and issue.

There's a lot of problems like this with shared hosting and that's ultimately the reason why I'll never go back...after I start moving off all my things from Apthost, Lunarpages, and some other host that I really shouldn't have. Now, EC2 has it's drawbacks of course as well. I hope to outline some of these and other topics related to EC2 in this blog along with posting updates about what I'm doing with Minervablog, which is of course a media blog. Maybe I'll even have some screencasts. Important to note though is that Minervablog isn't dead in the water (for the very few that have seen it so far) and it is probably going to take on some new changes due to EC2...I can now program it to infinitely scale and test that ability out without incurring a ton of charges. Then who knows, you might see an AMI out there of Minervablog =)

MySQL Master - Slave


April 11, 2008 by Tom (0 Comments)

Blah. Finally get the master - slave setup working here. It's just two instances of mysql writing to two different locations on the EC2 instance. The next step will be to move the location of the datadir over to an S3 mount.

That I'll save for the weekend though because I am simply out of steam for tonight. Too many late nights lately. The cool thing is I figured out how to setup the replication after many many bad tutorials and carelessly reading tutorials meant for mysql 4. MySQL 5 is much different and, in my opinion from what I saw, is much easier to setup master - slave replication.

I simply made a new cnf file for the slave, setup new datadir, different port to run on, told it was the 2nd mysql server, installed base tables, did a dump from the current db to sync up this blog's database. Setup user on the master...and after a few easy SQL queries (in phpMyAdmin actually since I also setup a new admin for the slave) I was able to start the slave and voila.

What can I do with a master slave? Well I may actually want to setup another slave for the application. This slave is for backup purposes to S3. If for whatever crazy reason S3 has a problem (because THAT never happened before hehe) then I wouldn't be able to read from it...so we want to read from the instance I think...but if I want to be efficient I may write to the master only and ALWAYS read from one fo the slaves (the one on the EC2 intance). This is SUPER easy with CakePHP, there's a great post on the CakePHP Google Groups for master - slave database. This type of setup probably wouldn't matter too much for me since I don't really do a ton of writing. I don't have to balance and disperse the load between writes and reads...Unless I started getting millions of comments every day I guess.

More to come...and if changing the datadir to an S3 mount through ElasticDrive is as easy as I think it is...I'll have some great news soon. 

Simpe Test...


April 11, 2008 by Tom (0 Comments)

So my first attmept here to write data to the master database while the slave's config is pointed to an S3 mount using ElasticDrive...The slave database started...and the status shows it as being on and awaiting data. So here's some data.

We'll see what the delay is (if I can tell without any kind of exact measurement provisions in place) and if it works period. 

Edit: Looks like it worked exactly how I'd hope it would. The slave database picked up the change and I double checked the old directory where the mysql sock file and data was vs the new location on the S3 mount and sure enough a mysql sock file is on the S3 mount directory. So I'm assuming (without removing the slave data on the EC2 directory) that it's working. Though I will probably turn off S3 and check out some other backup solutions since I don't make a whole lot of changes to my site...I don't need an instant backup. I also have to make sure my files are backed up anyway, part of which I'm hoping I can use a simple command for in the SVN post-commit hook script. 

Game Plan for This Playground


April 15, 2008 by Tom (0 Comments)

Ok so the game plan here. This is a version of my application, Minevablog. It needs some cleaning up though. Once I get that all set, I'm going to start stress testing. Well backup...First, well, a backup. Just to be safe. After that, I'll be setting up multiple instances and setting them up to be all load balanced and clustered.

Ok once that multi-instance environment is setup, THEN I'll stress test. Probably running load testing from another instance actually. I will hammer the ever living christ out of this blog and push it. I hope I can get an instance to crash. I want to see how I can keep the site alive under extreme conditions...How I might be able to turn on more instances for support, etc. I also want to benchmark things to see how speedy everything is.  

Mmmm, exciting. 

Thank God for EC2


April 17, 2008 by Tom (0 Comments)

Just posting to vent my frustrations about Media Temple...Thank God for EC2...It's sooooo much better. I'm unsure why so many people use Media Temple (and even more confused about why they put logos on their site like it's something trendy or to be proud of...my feelings? Fuck you, I'm paying you, you can take your logo elsewhere because you sure as hell don't do anything great for me)...

Anyway, back to more configuration issues implementing code on those stupid crummy ass Media Temple servers that works just fine on EC2 and other shared hosts like Apthost, Lunarpages, etc. PROOF (in my mind) that MT has some serious issues they need to address.

Categories