Version 5 (modified by 16 years ago) (diff) | ,
---|
Deploying a BOINC server on the Amazon Elastic Computing Cloud
What is Cloud Computing?
Cloud Computing is a form of computation and storage that hides the complexity of hardware and software management from a user. Typically, cloud computing services allow you to rent computing or storage services. These services charge on a pay-per-use basis (roughly, about 0.10 per CPU hour or per GB/month). Cloud computing services such as Amazon's Elastic Compute Cloud (EC2) also allow one to tailor a computing environment through the use of virtual machines. In addition, Amazon offers a Simple Storage Service (S3) for enabling remote storage.
Why use a Cloud?
Hosting a BOINC server on a cloud is useful for the following reasons:
- It's cheaper for small to medium projects to rent time on a cloud versus paying for hardware, bandwidth, and electric power on one's own.
- It's easier and faster to use an existing OS image with the BOINC server already installed than to compile and configure it on one's own.
How to use a Cloud for a BOINC server?
We have created a custom virtual machine with a BOINC server installed and configured. This includes all server software prerequisites and the correct permissions and accounts already setup. All you need to do is to deploy this virtual machine image on the cloud and your server should be up and running. This guide describes how to deploy this Amazon Machine Image (AMI) over Amazon's EC2 cloud. This can be done in minutes.
Prerequisites
Create and setup an account with Amazon's EC2.
Deploying the BOINC Server Image
Start the instance (ami-ab9374c2) with the BOINC server (stable 6.3.14 JAN 28 2009) installed on Debian Etch:
ec2-run-instances ami-ab9374c2 -k [key-pair]
Show the instance deployment status:
ec2-describe-instances
After the instance status goes from pending to running (takes a few minutes), you should see the hostname of the form ec2-XXX-XXX-XXX-XXX.z-2.compute-1.amazonaws.com.
If you haven't already, open ports 22 and 80:
ec2-authorize default -p 22
ec2-authorize default -p 80
At this point, you should be able to access the web server
at the URL:
http://ec2-XXX-XXX-XXX-XXX.z-2.compute-1.amazonaws.com/
Then login to the instance:
ssh -i [private_key] root@ec2-XXX-XXX-XXX-XXX.z-2.compute-1.amazonaws.com
In the home directory is a README.txt file with important information.
Setting Up a Test Project
Here we describe how to create a test project using the uppercase application.
As root,
sudo boincadm; cd
Create a test project uppercase:
~/boinc/tools/make_project --url_base http://ec2-XXX-XXX-XXX-XXX.z-2.compute-1.amazonaws.com --test_app cplan
Answer yes to all questions.
cd ~/projects/cplan
bin/xadd
bin/update_version
bin/start
To check that all daemons are running:
bin/status
Now any BOINC client should be able to attach to the project and download workunits.
Technical Notes
Below is not required reading, but we describe how and why the image was built.
Why Xen?
The general approach was to build a Debian EC2 AMI from a Xen image. (The alternative approach was to use an existing Debian AMI.) However, we chose the Xen approach primarily to be able to install and test things without having to worry about EC2 hourly costs. As a side-effect, one can use the Xen image either as a standalone server or over EC2 (as it's Xen based).
These links describe the setup involved: Debian from Xen Images, Bundle Debian AMI using Ubuntu
If you would like to use the Xen image directly, you can download the Xen image disk.img.tgz (MB) and swap.img.tgz (MB) and go from there.
Configuration
The hostname can change each time an instance is started.
As such, the start-up script rc.local
was modified to query
Amazon for the hostname and to set it at each boot.
rc.local
is also configured to randomly change the root
password at each boot, and to download your ssh public key
and cat it to the authorized_keys file to allow remote
passwordless access.
The server intentionally does not have ssh hostkeys, and /etc/sshd_config has been updated to reflect this.
IP Address
The IP address could change each time the instance is created. To associate a fixed address (regardless of the instance), one should use Amazon's Elastic IP Addresses.
In addition, one can configure the image to use dynamic DNS to associate a domain name with the instance. See the following links. Dynamic DNS with ZoneEdit Dynamic DNS Setup
To do
- Consider setting up dynamic DNS by default in the bundle
Questions?
Email Derrick Kondo (derrick.kondo :: inria fr)