talkative, friendly, programmer

Taming the Cloud With Juju and Raspberry Pi

The idea

We’re going to use a raspberry pi and juju to setup a wordpress blog on aws.

The raspberry pi is an amazing little gadget. Low power enough that I don’t feel guilty about leaving it turned on overnight, but flexible enough that I can shove leds into it to grab my attention if needed.

Juju is ubuntu’s answer to setting up services in the cloud. Once installed you simply setup your credentials with an existing cloud provider like aws or hp cloud and then deploy things into it. Setting up wordpress for example is as simple as

The Plan

Install go onto the raspberry pi

Install juju

Deploy a wordpress blog

We’re going to be installing the latest version of juju which is written in go.

Installing Go

Dave Cheney has written an excellent article on Installing go on the raspberry pi. On my model B (1.0 revision) I had to update raspi-config so that I could select the 240M/16M memory split, but you might have to see how you get on here. I choose to skip the tests and just ran ./make.bash to build go rather than all.bash.

I was unable to build juju using go 1.0.3. I ended up building go 1.1.1 from source, which seemed to work fine. From memory I believe you need to setup a folder to be your GOPATH before you can install the latest version of go.

Installing Juju

Getting the latest tip of juju-core is easy using the go get command, it grabs all the dependencies for you, it does mean we’re grabbing tip, but there are ways to fix that later if we need to. juju-core is hosted on launchpad.net which uses bazaar for source control. This means you need to install it before you can run go get. I was able to install it on raspian using

12

sudo apt-get update
sudo apt-get bzr

Without doing the update I was unable to grab all of bzr’s dependencies, so I recommend running the update first.

When it’s finished you should find a juju binary installed. Mine ended up in my GOPATH, I think because I had something setup wrong somewhere. But if you’ve got this far I’m sure you’ll be able to find it.

Setting up Juju

There’s much better instructions for setting up juju here The basic steps come down to