Skip to content

Instantly share code, notes, and snippets.

@claj
Created September 19, 2012 11:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claj/3749074 to your computer and use it in GitHub Desktop.
Save claj/3749074 to your computer and use it in GitHub Desktop.
Swarm on EC-2
How to get started with a swarm-setup on EC-2
=============================================
Launch instance
---------------
Switch to the close region (EU West for us).
Start an EC-2 instance, I selected Ubuntu 12 server, Small instance type.
I created a new key pair, downloaded it and installed them on my Mac by
doing
mac:$chmod 600 swarm.pem (ssh is a bit picky on access settings of the .pem-files)
mac:$ssh-add swarm.pem
Now launch the instance - no other special options needed.
Check the instance in the control panel
make a host lookup on
mac:$host ec2-46-51-160-208.eu-west-1.compute.amazonaws.com
ec2-46-51-160-208.eu-west-1.compute.amazonaws.com has address 46.51.160.208
Aha, the server runs at IP 46.51.160.208!
Add a username-password user on the instance
--------------------------------------------
Since you have the key on your computer already installed, it's easy to get into the instance via ssh
mac:$ssh -i swarm2.pem ubuntu@ec2-46-51-160-208.eu-west-1.compute.amazonaws.com
ec2:$sudo add-apt-repository -y ppa:webupd8team/java
ec2:$sudo add-apt-repository -y ppa:cassou/emacs
ec2:$sudo apt-get update
ec2:$sudo apt-get install -y git oracle-java7-installer emacs24 emacs24-el
Here you have to click OK and YES to two licence questions (haven't dared to test standardjava yet).
ec2:$sudo useradd -d /home/swarm -m swarm -s /bin/bash
ec2:$sudo passwd swarm
set a practical password here, please.
ec2:$sudo sed -i .backup 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
ec2:$sudo restart ssh
or distribute the swarm key to everyone
Back on Mac:
------------
mac:$ ssh swarm@ec...
and the password will work just fine!
awsum.
now as the swarm-user, get lein by downloading the swarm-repo
swarm$:
mkdir bin
export PATH=$(pwd)/bin:${PATH}
export EDITOR=emacs24
git clone git://github.com/nuclearsandwich/swarming.git
swarming/swarmup.sh
in the emacs scratch buffer, run the following (C-x C-e with cursor after each s-expression below
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
and then run:
M-x package-install [RET] nrepl [RET]
The apple terminal with swedish computer can't make M- work in standard, but there's a convenient terminal preference for that (use alt as Meta key). Then the [] and {} won't work. Use US-keyboard-layout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment