CSEP 590A: Distributed Systems
Spring 2006

Unix/Linux Tools, Tutorials, Etc.

If you choose to use PlanetLab to test your programming projects, you will be using a Unix/Linux environment. The following are resources about using and developing in this environment.

Accessing a Terminal

As you should avoid developing on PlanetLab (as well as EmuLab), you will want access to a Unix/Linux Terminal. You can use SSH Telnet (SSH Secure Shell is my program of choice) to log in to the following departmental machines:

You will need to use your CSENetID to log in to these machines. Also, we have no idea what happened to unicycle.

Using the Unix Environment

Our CSE undergraduates have produced multiple guides and tutorials for using the computer services available through the department. Most of their advice translates directly (just change iws to gws). The following tutorials will be of the most relevance:

EmuLab

Most of your setup and use of EmuLab will start from their main website. After signing up for an account (see the mailing list archive for details on how to do this), you will manage the nodes you plan to use, the topology, etc. from the website. Your account will have local root permissions and will allow you to create/destroy experiments in the course's project space. You will also have root privileges on machines in your experiments. EmuLab will let you decide which OS you want to use on the machines, with choices of FreeBSD, RedHat Linux, and Windows XP.

Installing RPMs

Quite a bit of software is already installed on the Emulab machines, such as gcc/g++. However, some items are not installed, like Java. To install these, the easiest way on non-Windows machines (such as the default OS RHL90-STD) is through rpms automatically during the setup.

All rpms should be placed in the directory /proj/CSEP590A/rpms/. I've already placed rpms there for the Java SDK and the Java JRE. You have write-access to this directory, so should be able to add files to it. If not, ask Kate to add a particular rpm.

To have an RPM automatically load, you need to add the following to the NS file when you create an experiment. The NetBuild GUI will NOT do this for you, you must enter this manually:

tb-set-node-rpms $node1 /proj/CSEP590A/rpms/jre-1_5_0_06-linux-i586.rpm

The above will cause EmuLab to automatically install the JRE on the node named node1. You will need to repeat the above code for all nodes that you want the RPM installed on.

Important Links

EmuLab has extensive documentation available on their site:

PlanetLab

To use PlanetLab, you will need to sign up for a PlanetLab account on their site. You will be ready to use PlanetLab when a slice has been created for you. If you experience problems with registration, contact Mike Piatek (piatek AT cs...).

Connecting to your Slice

The important thing to remember about PlanetLab is that you always connect through your slice. If joeuser is using the slice uw_joe and said slice includes the node planetlab01.cs.washington.edu, then he would log in as:

ssh uw_joe@planetlab01.cs.washington.edu

Creating a Hosts File

For convenience, we recommend that you create a file of all the hosts in your slice. This will be a simple text file with one host per line. For example, a file named slice.hosts would contain:

planetlab01.cs.washington.edu
planetlab02.cs.washington.edu
planet2.seattle.intel-research.net

Doing Things on Many Nodes

The vxargs command allows you to execute commands simultaneously on multiple nodes. The following is a script that makes using vxargs easier:

#!/bin/bash
vxargs --timeout=900 -P 40 -o /tmp/result -y -a ~/slice.hosts ssh -o StrictHostKeyChecking=no sliceName@{} "$@"

You should replace sliceName with the name of the slice you are using. Be certain that when you copy the code that the second line is contained all on one line.

This script uses rsync to, with 40 nodes at a time, run whatever command you pass (e.g. bash script.bash 'hostname' would ssh to all hosts in ~/slice.hosts and put the output from stderr and stdout in /tmp/result). The timeout value is straightforward. Set the parallelism based on the maximum number of processes your machine can support and the maximum amount of pain you want to put your shell through. Beware the curses interface if you want speed.

Installing things

There are probably two things you want to install: java, at, maybe libpcap. This is how to go about this. Assume the above script using vxargs is called lspl.bash.

Use wget to get the java RPM from deltron:

lspl.bash "wget http://deltron.dyn.cs.washington.edu.nyud.net:8080/jre-1_5_0_06-linux-i586.rpm"

This uses the Coral CDN (http://www.coralcdn.org/) in order to avoid overloading poor old deltron. Once all these have finished, you can install java with the command:

lspl.bash "sudo rpm -ivh jre-1_5_0_06-linux-i586.rpm"

This won't fix the path though, so future invocations of java should be of the form:

/usr/java/jre1.5.0_06/bin/java

To install useful things through yum (the package manager on Plab), you can use the yum command. To install the make and gcc packages, for example, you would use the command:

lspl.bash "sudo yum -y install gcc make"

You need sudo to do things, and you need -y so it doesn't prompt you for with questions like 'do you want to install these dependencies?'

Dealing with Errors

The following command will find hosts with no java installed after running /usr/java/jre1.5.0_06/bin/java -version on all nodes:

grep -l directory * | sed -e 's/.err//' > ~/planetlab/no_java.hosts

Important Links

If the above has not been helpful, the other sites might be of help: