Tag Archives: Amazon

Secure your Minecraft server with offsite backups

Keeping incremental backups of your world folder may not be enough to prevent the loss of the your Minecraft server data. This guide will show you how to backup your entire server director to Amazon’s cloud storage solution, S3.  I chose S3 mainly because it was cheap, and had fast access speeds with redundant storage.  If you backup a 500MB world folder, you will probably spend less than $1 per month on your AWS bill.  My previous 6 bills have all been under 15 cents. S3 was also easier to use than some of the other offsite backup services I tried.

The tools I will show you how to use in this tutorial were s3fs and rsync.  The software s3fs will enable you to mount an Amazon S3 bucket directly to your linux filesystem. Please note this tutorial requires a moderate knowledge of linux command line interfacing. This tutorial was written for a system using Ubuntu 10.10 Server x86, but could be modified to fit any linux operating system.

The first step is to make sure you have the required dependencies for s3fs.  If using Ubuntu, your required packages are build-essential, libcurl14-openssl-dev, libxml2-dev and libfuse-dev.  Note that this tutorial will install s3fs version 1.33, which requires FUSE 2.8.4, which is a higher version than the 2.8.1 version currently supplied in the Ubuntu repositories. To install the packages in the repositories execute the following commands as root/sudo:

apt-get install build-essential libcurl4-openssl-dev libxml2-dev

To install the latest version of FUSE (currently 2.8.5), retrieve this package from sourceforge. Once you have the package, installation is typical of what you’d expect from source.

tar -xzf fuse-2.8.5.tar.gz && rm fuse-2.8.5.tar.gz
cd fuse-2.8.5
./configure
make
make install

Now that you have the dependencies installed, it’s time to install s3fs. Again, installation will be from source, as root/sudo.

wget http://s3fs.googlecode.com/files/s3fs-1.33.tar.gz
tar -xvf s3fs-1.33.tar.gz && rm s3fs-1.33.tar.gz
cd s3fs
./configure --prefix=/usr
make
make install

You now have all the necessary tools installed to automate your offsite backups. Next we will create a directory to mount our S3 bucket to. As root:

mkdir /mnt/backup
chown your_username_here:your_username_here /mnt/backup

For the next few steps, you will need your accessKeyID and secretAccessKey from Amazon. These can be located by navigating to http://aws.amazon.com, logging in and clicking “Account” from the top menu bar, and then “Security Credentials”. The required information is listed under “Access Credentials”. Once you have this information, it would be good to create a bucket for your backup. This can be accomplished easily from the AWS Management Console.

Now we will create the backup script that will rsync files to your bucket. The way the script will work by mounting the bucket, copying files and then unmounting the bucket. Keep in mind for minecraft, you may want to back up your entire server folder as opposed to simply your world folder.  Especially if you’re using Hey0 mod, you may need to backup plugin information from stuff like iConomy. Create the following script called backup.sh

#!/bin/bash
#backup.sh - Script by CheeseJaguar
/usr/bin/s3fs yourbucketname -o accessKeyId=your_access_key_ID -o secretAccessKey=your_secret_key /mnt/backup
/usr/bin/rsync -av --delete /path/to/folder/that/you/want/backed/up /mnt/backup
/bin/umount /mnt/backup

Save the script and make sure to chmod the script so that it is executable.

chmod +x backup.sh

Now all you need to do to backup your server is run

./backup.sh

If you’d like to automate the task, add a cronjob to your crontab. As root:

crontab -e

And add the line:

0 0 * * 0 /wherever/you/saved/it/backup.sh

This example line will backup your server every Sunday at 12:00AM. The 5 characters preceding your command tell the crontab how often to execute the command. The first character tells it which minute to execute, the second character tells it which hour to execute, the third character tells it which day of the month to execute, the fourth character tells it which month to execute, and the fifth character tells it the day of the week. Asterisks indicate every minute or hour or day,etc, and you can use commas to indicate multiple times. For example, 0,15,30,45 * * * * would execute every 15 minutes. For further reading, consult the Wikipedia article on Cron.

Once you have this setup, you will be automatically backing up cheaply and securely. Now let’s say for whatever reason someone took your server and threw it out the window of a high-rise. To get your world back, simply create a script with the source and destination parameters of the previous script, but switched. Like so:

#!/bin/bash
#restore.sh - Script by CheeseJaguar
/usr/bin/s3fs yourbucketname -o accessKeyId=your_access_key_ID -o secretAccessKey=your_secret_key /mnt/backup
/usr/bin/rsync -av /mnt/backup /path/to/put/your/files/in
/bin/umount /mnt/backup

This will bring your files back to your server, like nothing had happened (since the last backup, at least).

Useful Links for Building A Computer

There are several websites I use frequently for researching and purchasing computer parts.  Some are obvious and well  known, and some you may have missed.  I hope you’ll find these links helpful, there is a lot of information out there and not a lot of it is helpful.

Google

http://www.google.com

Google is a pretty obvious resource.  I feel like I shouldn’t even have to mention it, but then again I often see people with questions that google can answer very quickly.  Knowing how to use google isn’t terribly difficult but you do know how to phrase search terms.  When comparing two purchase options, it’s often helpful to search “Option A vs Option B”, as chances are you’re not the first to have thought of such a mystery.

Newegg

http://www.newegg.com

One of the most popular websites out there for buying computer parts, Newegg will always be my favorite simply because of the way you can filter out different products when searching for something.  Once you have an idea of what motherboard or processor you want, it becomes very easy to search for exactly what time of memory you need, or what size case, etc.  I’ve spent hours just surfing Newegg and looking at different combinations and reading reviews on different products.  While Newegg may not be the best place to start, it’s definitely the best place to finalize your build.  Newegg is also awesome for their Shell Shocker deals, which I subscribe to on

Amazon

http://www.amazon.com

Amazon is not often the first choice for some computer building enthusiasts, but I’ve grown pretty fond of it.  If you’re an Amazon Prime account holder, you can get Prime Eligible items to your doorstep in 2 days, and next day for only $3.99 per item.   Amazon’s prime eligible selection is not as large as you may need, but you’ll probably find that most popular hardware is prime eligible.  Furthermore, if you live in California like me Newegg has sales tax, while Amazon doesn’t.

eXtreme Power Supply Calculator

http://extreme.outervision.com/psucalculatorlite.jsp

When choosing power supply size, it takes a lot of research to be able to find the exact power requirements of most items.  Often finding the TDP (Thermal Design Power) rating of most devices is difficult for anything besides CPU’s.  This handy calculator will let you know if your power supply will be able to manage your upgrade, or just tell you what size you need to buy for your new computer.  Don’t take the results as gospel however, for example if you get a result of 630W you should probably buy something more than a 650W PSU. In engineering we use what’s called a factor of safety, and I tend to prefer to use a factor of safety of at least 1.2 when buying power supplies.  Basically a FoS of 1.2 on a 600W requirement would mean you buy at least a 720W PSU. (600 * 1.2).

Reddit

http://www.reddit.com/r/buildapc

Even I’ve stopped by this awesome little reddit for advice on building a new computer.  It never hurts to ask questions when considering a new build.  There are a lot of knowledgeable people that post there, just remember to take all advice with a grain of salt.

AnandTech

http://www.anandtech.com/

AnandTech is in my opinion the best place to get information about hardware.  I used to be fond of Tom’s Hardware, but recently I’ve become very disenfranchised with that site.  AnandTech has very in-depth reviews and has a plethora of benchmarks when they review new hardware.  Their benchmark charts can make comparison shopping much easier.

Passmark CPU Benchmarks

http://www.cpubenchmark.net/high_end_cpus.html

Is one CPU “better” than another? It’s often hard to tell.  Often different processors be better suited for different tasks, however the theoretical processing power any given processor is useful when making decisions. Synthetic benchmarks should never be used to say “Processor A is better than Processor B, but can often show you how much better a certain $200 processor is than a certain $100 processor.

These aren’t the only websites I use, but the ones that I think you may find the most helpful in starting out your research.  There are many good forums out there which have a lot of advice, and Google is a great place to find those forums.  Of course, don’t forget you can always just ask me for advice.

Free Amazon Prime for Students

Last night Amazon debuted a free service to all students with a .edu email address: free Amazon Prime for one year. I was ecstatic to hear this, because I have always preferred to use Amazon whenever possible to order computer parts online. Sure, Newegg has the best information, is the best way to search, sort and filter, but Newegg often just can’t compete with Amazon’s pricing. I’m one of those unlucky people who live in California (or New Jersey), and we have to pay sales tax on everything we buy on Newegg. Not Amazon.

My new computer (upcoming post, stay tuned) will cost an estimated $1200. At a tax rate of 8.25% that’s an extra $100! So parts on Amazon basically have to be more than an 8% markup from Newegg prices for them to be more expensive. Furthermore there is the issue of shipping. Amazon has free shipping on all orders greater than $25, and the shipping while not the fastest is not bad. Amazon’s free shipping is 5-9 business days, as opposed to select items on Newegg, which ship free in 2 business days. For this reason, sometimes I would buy from Amazon and sometimes I would buy from Newegg. If I was in a hurry and didn’t want to wait 2 weeks, maybe I’d spend a couple more bucks and order from Newegg. Now I have an Amazon Prime account, and I can get anything Prime-eligible to my door the next day for $3.99, or the day after for free.

The selection of Prime-eligible computer parts isn’t amazing, but most mainstream components are Prime-eligible. But seriously, $3.99 per item next day shipping for any student is amazing. As long as you place your order by 6:30pm EST, your order will arrive the very next day. For $3.99. If you haven’t noticed, this makes me ecstatic. I hate having to wait 2 weeks for something I spent so much money on to arrive.

Amazon is a very interesting company, and I hope to see them continue to thrive.

ASmallOrange + S3 hosting guide

I made a tutorial video that shows you how to integrate Amazon Simple Storage Service (s3) with A Small Orange web hosting for a grand total of less than $50 a year.  The software I used for Amazon S3 access in this video is CyberDuck for Mac OS X, however a cross-platform tool that is just as good is S3Fox for Mozilla Firefox.

Please feel free to ask any questions.  If anything is unclear, I’d be glad to help.  If you guys would like any more tutorial videos concerning this setup, just let me know.

Video requires Safari 4 to play in browser.
Direct link to video for download

Also available is a YouTube version of the video:

Amazon AWS is pretty awesome

After getting S3 setup, I am very happy with it.  Pay as you go service couldn’t get better than this.  It has some interesting “features” though, which are kind of weird.  I wanted to setup a static html index at the base of my S3 storage, but it doesn’t let you do that.  If you type in http://s3.cheesejaguar.com, then you get an access denied page.  However, if you type in http://s3.cheesejaguar.com/index.html then you go to the static page I wanted.  Small fun things like that, but I guess it’s aimed to prevent you from hosting dynamic HTML/PHP/CGI pages on S3, instead of using their Elastic Cloud Compute (EC2).  If I had more money, I’d definitely be playing around with EC2, but as it is it’s currently $70 a month for pay as you go.

Cheesejaguar.com is now in the cloud!

Well, sort of.  At least all static multimedia such as images, audio and video will now be hosted in the cloud.  It’s pretty awesome, and it’s pretty cheap.  I’m using Amazon’s S3, and using their bill calculator it should only be about 30-50 cents a month to host.  Pretty nifty and high tech, yes?

Eta Carinae

That image is hosted in the cloud.  Click for the 17 megapixel version.  I chose this image, because cloud computing gives me access to “infinite” data storage, kind of like the near-infinite expanse of space.  Of course I don’t have an infinite wallet, but still for what I’m doing it’s never going to cost more than a dollar a month.