Menu

AddingNodes

Daniel Povey Carl Pupa

Adding nodes to your cluster

If you want to add a node to your kluster you can do so as follows. Assuming you have sourced config.sh and vars.sh, you can do something like the following: from your local machine, do

kl-add-nodes c3.large c3-01 c3-02

This will add the nodes for you. In order for you to understand what is really going on here, we will explain what this script does for each node. Say for the node c3-01, it does something like the following. First it creates a file foo that will become the user-data that will be made available to the instance:

## Don't run this! It's part of an explanation ##
cat >foo <<EOF                                                                                                                        
#hostname c3-01
#hosts_entry 10.206.106.228 master                                                                                                        
EOF

This file will be parsed by the init-script /etc/init.d/kluster-set-hostname. If node gets user-data like this it becomes a node; by default it becomes the master. Next, kl-add-nodes will run a command like the following:

## Don't run this! It's part of an explanation ##
ec2run ami-b4158ddd -g testcluster -k testcluster -z us-east-1c -t c3.large --user-data-file foo

This spawns the node, and the init scripts on the node do most of the rest of the configuration. The script kl-add-nodes now has to tag the new node, which is now the kluster scripts on your local machine know which cluster it belongs to. The script does something like:

## Don't run this! It's part of an explanation ##
ec2tag i-947f1afa --tag Name=testcluster-c3-01

OK, explanation over. Next, from our local machine, let's list the nodes in the cluster:

# kl-list-nodes 
   master        c3.large      i-50b80a31
    c3-01        c3.large      i-6d05cd0d
    c3-02        c3.large      i-7705cd17

We can ssh to one of the nodes (as root) as follows: from the local machine,

kl-sshnode c3-01

The reader familiar with MIT StarCluster might notice a similarity with some of the command names in that software. We were inspired by that software, but chose to design our scripts in a simpler way that is intended to be easier to modify.

Once you are on node m1-01, you can do a couple of things to check whether things are up:

root@c3-01:~# ls /export/master
lost+found
root@c3-01:~# ls /export/c3-01
lost+found
root@c3-01:~# ls /export/c3-02
lost+found
root@c3-01:~# qhost -q
HOSTNAME                ARCH         NCPU  LOAD  MEMTOT  MEMUSE  SWAPTO  SWAPUS
-------------------------------------------------------------------------------
global                  -               -     -       -       -       -       -
c3-01                   lx26-amd64      2  0.11   3.75G  267.8M    1.4G     0.0
   all.q                BIP   0/0/2         
c3-02                   lx26-amd64      2  0.54   3.75G  262.3M    1.4G     0.0
   all.q                BIP   0/0/2         
master                  lx26-amd64      2  0.00   3.75G  267.1M    1.4G     0.0
   all.q                BIP   0/0/1

We tested this a few minutes after launching the nodes. These export directories are the last thing to come up, because the local disk has to be formatted first and this takes some time.

Previous: Setting up your Kluster config
Next: Adding a user
Up: Kluster Wiki


Related

Wiki: AddingUser
Wiki: AttachingEBS
Wiki: Home
Wiki: SettingConfig

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.