home

Archive for April, 2009

Installing And Mounting Network Drives Using NFS In Ubuntu (And Generally)

Sunday, April 12th, 2009

This is another piece in an Ubuntu puzzle that, when assembled, will describe how to set up an MPI (message passing interface) computer cluster for running parallel calculations (upcoming).  As a brief explanation of what’s going on, many of the MPI (OpenMPI, MPICH, MPICH2) set-up procedures you may stumble across online describe how to use the network file system (NFS) protocol to set up one directory on a host node (head node/server node/master node/whatever) of your cluster so that, by mounting a directory on a guest node (client node/slave node/whatever) to this network-accessible drive, the head and guest nodes all see the same work directory and executables (both MPI and your program of choice).  There are more clever ways to set the cluster up that will likely run at a slightly faster pace than NFS may allow, but we’ll ignore that at the moment.  The install procedure below is Ubuntu-specific only in the apt-get stage (NFS support is not part of the default installation).  After all of the components are installed (post-apt-get), the setup should be Linux-universal.

LEGEND

Text in black – my ramblings.

Text in bold red – things you will type in the Terminal

Text in green – text you will either see or will type into files (using pico, my preference)

Below is all I need to do in Ubuntu to do what I need it to do.  I’ll be dividing the installation procedure into HOST and GUEST sections for organizational purposes.

1. HOST Node Installation

a. sudo apt-get install nfs-kernel-server nfs-common portmap

My apt-get list is becoming gigantic as part of the cluster work, but I’m only focusing on NFS right now (if you intend on running any MPI-based code, you also need to include SSH), so we only need to deal with these three packages (they will also install libevent1, libgssglue1, libnfsidmap2, and librpcsecgss3, but that’s the beauty of letting apt-get do the dirty work.  You can see this previous post if you intend on finding yourself installing any programs in Ubuntu while [shiver] not online).  You’ll see plenty of output and, hopefully, no errors.

b. sudo dpkg-reconfigure portmap

Installing packages with NFS in the title makes sense.  What’s the deal with portmap?  NFS uses remote procedure calls (RPCs) for communication.  Portmap is a server/service that maps these RPCs to their proper services (as a translator between RPC numbers and DARPA port numbers. Yup.), thereby directing cluster traffic.

The portmap configuration file (/etc/default/portmap) looks as below:

# Portmap configuration file
#
# Note: if you manually edit this configuration file,
# portmap configuration scripts will avoid modifying it
# (for example, by running ‘dpkg-reconfigure portmap’).

# If you want portmap to listen only to the loopback
# interface, uncomment the following line (it will be
# uncommented automatically if you configure this
# through debconf).
#OPTIONS=”-i 127.0.0.1″

For the purposes of the cluster work to be done in upcoming posts, you do NOT want to uncomment the OPTIONS line (which would then bind loopback), not that you would start randomly uncommenting lines in the first place.

c. sudo /etc/init.d/portmap restart

If you make changes to the /etc/default/portmap configuration file, reconfigure portmap, etc., you’ll need to restart portmap for the changes to be implemented.  It is recommended that you run this restart upon installation regardless (especially having run dpkg-reconfigure portmap above).

d. sudo mkdir /[work_directory]

This makes the directory to be shared among all of the other cluster machines.  Call it what you will.

e. sudo chmod a+wrx /[work_directory]

We now provide carte blanche to this directory so anyone can read, write, and execute programs in this directory.

f. sudo pico /etc/exports

The last file modification step on the HOST node will mount the /[work_directory] as an NFS-accessible directory to the GUEST machines and preserve this NFS accessibility until you change the settings (or the directory), preserving the accessibility upon reboot.

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes  gss/krb5i(rw,sync)
#
/[work_directory] *(rw,sync)

To translate:  * = open up to all clients; rw = read-write priviledges to specified clients; sync = commit all changes to the disk before the server responds to some request making a change to the disk.  It is also worded as “read/write and all transfers to disk are committed to the disk before the write request by the client is completed” and “this option does not allow the server to reply to requests before the changes made by the request are written to the disk,” which may or may not help to enlighten.  Basically, it makes sure the NEXT modification to some file doesn’t occur until the CURRENT operation on that file is complete.

This only scratches the surface of all things /etc/exports but is enough for my purposes (anyone can mount the drive and read/write.  If your machine is online, let SSH take care of the rest of it).

g. sudo /etc/init.d/nfs-kernel-server restart

Having made the changes to /etc/exports, we restart the NFS server to commit those changes to the operating system.

h. sudo exportfs -a

If you RTFM, you know “the exportfs command is used to maintain the current table of exported file systems for NFS. This list is kept in a separate file named /var/lib/nfs/xtab which is read by mountd when a remote host requests access to mount a file tree, and parts of the list which are active are kept in the kernel’s export table.” (see HERE for more info).

With all of that completed, you will now have a network-accessible drive /[work_directory] sitting on the HEAD node.

Before moving on to the GUEST nodes, now what?  Again, based on other MPI and cross-network installation descriptions, a completely reasonable thing to do is build ALL of your cluster-specific programs (MPI and calculation programs) into /[work_directory].  You will then mount this directory on the client machines and set the PATHs on these machines to include /[work_directory]. Everyone then sees the same programs.

2. GUEST Node Installation

a. sudo apt-get install portmap nfs-common

This installs portmap and the NFS command files (but not the server) and also “starts up” the client NFS tools.  You should be ready to mount network drives immediately.

b. sudo mkdir /[work_directory]

We make the directory that will have the network drive mounted (the same name as the directory on the HOST node).  I’ve placed it in the same location in the directory hierarchy as it exists on the HEAD node (sitting right in /, not in /mnt or whatever).

For immediate access -> c1. sudo mount HOST_MACHINE:/[work_directory] /[work_directory]

Here, HOST_MACHINE may be an IP address (often something like 192.168.nn.nn or 10.1.nn.nn if you’ve set up your cluster on a switch, the actual IP address for the HOST machine if you know it (type ifconfig on the HOST machine to find out)) or a domain name (head.campus.edu, for instance).  It’s that simple (if everything installed properly).

For long-term, automated access -> c2a. sudo pico /etc/fstab

If you want to make this connection permanent (and this is a very good idea on a cluster), you can modify /etc/fstab by adding the following line:

HOST_MACHINE:/[work_directory] /[work_directory] nfs   rw   0   0

Then type

c2b. sudo mount /[work_directory]

As for additional information and discussion, there is quite a bit online already (as you might expect), with a long Ubuntu thread on the subject at ubuntuforums.org/showthread.php?t=249889.  For a bit more technical information on the subject, check out www.troubleshooters.com/linux/nfs.htm.

www.ubuntu.com
en.wikipedia.org/wiki/Message_Passing_Interface
www.open-mpi.org
www.mcs.anl.gov/research/projects/mpi/mpich1
www.mcs.anl.gov/research/projects/mpich2
en.wikipedia.org/wiki/Network_file_system
www.debian.org/doc/manuals/apt-howto
en.wikipedia.org/wiki/Secure_Shell
www.somewhereville.com/?p=616
en.wikipedia.org/wiki/Remote_procedure_call
www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Deployment_Guide-en-US/s1-nfs-server-config-exports.html
www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-nfs-server-export.html
linux.about.com/library/cmd/blcmdl8_exportfs.htm
ubuntuforums.org/showthread.php?t=249889
www.troubleshooters.com/linux/nfs.htm

Two Degrees Of Installation – How To Offline Apt-Get In Ubuntu (and Debian-Related)

Sunday, April 12th, 2009

Here’s a possible situation leading to your stumbling on this post.  You’ve installed and updated Ubuntu on a machine (or 11) in a room with its one IP address already dedicated to another machine (and the building sys admin doesn’t take kindly to you sitting on a dozen or more dedicated IP addresses), you didn’t set up any NAT to feed the connection of one dedicated machine to the rest of the machines in the room, you don’t want to switch cables around because you’ve already zip-tied everything down with a Vulcan death grip and don’t want to start cutting because you can’t find free CAT6, and you don’t feel like opening /etc/network/interfaces a dozen times to reset the IP addresses and gateways on 11 machines to install one #&$@*ing piece of software you forgot on your initial install + upgrade (or, as was my case, I didn’t know that one piece of software WASN’T installed as part of the standard package).

You are in luck, with the dirty work made much, much easier if you already have an Ubuntu box online.

Installing packages in Ubuntu while offline involves (1) determining which programs and assorted libraries are required for what you want to install, (2) collecting all of the necessary install files from either the intertubes or an online Ubuntu box you can apt-get with (what I will assume here) and (3) using the Debian dpkg program instead of apt-get (which, to the best of my knowledge, is basically the same difference) to perform the installation on the offline box.  If you’ve an online Ubuntu box, then step (1) involves installing the program you want to install on the other computers so that all of the necessary install files are downloaded, sitting locally, and ready for flashdrive (or LAN) transfer (and I assume you’re running either all 32- or all 64-bit on the machines, such that the offline machine is the same as the online machine).

LEGEND

Text in black – my ramblings.

Text in bold red – things you will type in the Terminal

Text in green – text you will either see or will type into files (using pico, my preference)

I’ll be using the installation of NFS (network file system) as my example.  You’ll get a handle for what needs to be done for your own installs this way.

(1 – Online Box) Installing Program [X] On An Online Ubuntu Box With apt-get

For some programs, only one install file may be required.  Generally, however, your apt-get install will list several additional “new” and “extra” packages, often missing libraries and system files required for the installed program to run.  As you should suspect, you will need ALL of these files to install your programs on offline machines.  Fortunately, all of these packages are downloaded and saved in their installation format (.deb) locally.

For NFS, the three core installed packages I ran my initial apt-get for…

a. sudo apt-get install nfs-kernel-server nfs-common portmap

Yielded the following output

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libevent1 libgssglue1 libnfsidmap2 librpcsecgss3
The following NEW packages will be installed:
libevent1 libgssglue1 libnfsidmap2 librpcsecgss3 nfs-common nfs-kernel-server portmap
0 upgraded, 7 newly installed, 0 to remove and 96 not upgraded.
Need to get 530kB of archives.
After this operation, 1642kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://us.archive.ubuntu.com hardy/main libevent1 1.3e-1 [49.3kB]
Get:2 http://us.archive.ubuntu.com hardy/main libgssglue1 0.1-1 [22.2kB]
Get:3 http://us.archive.ubuntu.com hardy/main libnfsidmap2 0.20-0build1 [24.7kB]
Get:4 http://us.archive.ubuntu.com hardy-updates/main librpcsecgss3 0.17-1ubuntu2 [33.8kB]
Get:5 http://us.archive.ubuntu.com hardy/main portmap 6.0-4 [34.6kB]
Get:6 http://us.archive.ubuntu.com hardy-updates/main nfs-common 1:1.1.2-2ubuntu2.2 [203kB]
Get:7 http://us.archive.ubuntu.com hardy-updates/main nfs-kernel-server 1:1.1.2-2ubuntu2.2 [162kB]
Fetched 530kB in 1s (378kB/s)
Preconfiguring packages …
Selecting previously deselected package libevent1.
(Reading database … 31771 files and directories currently installed.)
Unpacking libevent1 (from …/libevent1_1.3e-1_amd64.deb) …
Selecting previously deselected package libgssglue1.
Unpacking libgssglue1 (from …/libgssglue1_0.1-1_amd64.deb) …
Selecting previously deselected package libnfsidmap2.
Unpacking libnfsidmap2 (from …/libnfsidmap2_0.20-0build1_amd64.deb) …
Selecting previously deselected package librpcsecgss3.
Unpacking librpcsecgss3 (from …/librpcsecgss3_0.17-1ubuntu2_amd64.deb) …
Selecting previously deselected package portmap.
Unpacking portmap (from …/portmap_6.0-4_amd64.deb) …
Selecting previously deselected package nfs-common.
Unpacking nfs-common (from …/nfs-common_1%3a1.1.2-2ubuntu2.2_amd64.deb) …
Selecting previously deselected package nfs-kernel-server.
Unpacking nfs-kernel-server (from …/nfs-kernel-server_1%3a1.1.2-2ubuntu2.2_amd64.deb) …
Setting up libevent1 (1.3e-1) …

Setting up libgssglue1 (0.1-1) …

Setting up libnfsidmap2 (0.20-0build1) …

Setting up librpcsecgss3 (0.17-1ubuntu2) …

Setting up portmap (6.0-4) …
* Starting portmap daemon…
…done.

Setting up nfs-common (1:1.1.2-2ubuntu2.2) …

Creating config file /etc/idmapd.conf with new version

Creating config file /etc/default/nfs-common with new version
Adding system user `statd’ (UID 104) …
Adding new user `statd’ (UID 104) with group `nogroup’ …
Not creating home directory `/var/lib/nfs’.
* Starting NFS common utilities
…done.

Setting up nfs-kernel-server (1:1.1.2-2ubuntu2.2) …

Creating config file /etc/exports with new version

Creating config file /etc/default/nfs-kernel-server with new version
* Starting NFS common utilities
…done.
* Exporting directories for NFS kernel daemon…
…done.
* Starting NFS kernel daemon
…done.

Processing triggers for libc6 …
ldconfig deferred processing now taking place

So, from the three programs I knew I needed…

nfs-kernel-server nfs-common portmap

The following list of packages were downloaded and installed…

nfs-kernel-server nfs-common portmap libevent1 libgssglue1 libnfsidmap2 librpcsecgss3

As for NFS, the installation does not perform configuration (NFS is part of an upcoming post if interested).

Now for the .deb collection…

The default apt-get behavior is to download .deb package files and place them into /var/cache/apt/archives/, thereby greatly simplifying the offline installation process.  As of April 2009, the NFS install list is the following (version numbers will change and ignore the _amd64 if you’re on a 32-bit machine).

libevent1_1.3e-1_amd64.deb
libgssglue1_0.1-1_amd64.deb
libnfsidmap2_0.20-0build1_amd64.deb
librpcsecgss3_0.17-1ubuntu2_amd64.deb
nfs-common_1%3a1.1.2-2ubuntu2.2_amd64.deb
nfs-kernel-server_1%3a1.1.2-2ubuntu2.2_amd64.deb
portmap_6.0-4_amd64.deb

This directory may be quite full (especially if you’ve apt-get update’d lately).  You can make the search a little easier on your eyes by sorting by date (assuming the install on the “online” machine is recent and by itself).  I will assume you’re doing the transport by flashdrive.

b. ls /media
Note the [name of flashdrive] sitting in this directory
c. cd /var/cache/apt/archives/
d. ls –tl
e. cp [filename.deb] /media/[name of flashdisk]

z. umount /media/[name of flashdrive]

(2 – Offline Box) From-Flashdrive Installation

Once the flashdrive is plugged into the offline box and the terminal window is open, you’re going to copy the .deb files to a directory (I will assume your home directory, ~/) on the hard drive and then run dpkg to install them.

a. cp /media/[name of flashdrive]/*.deb ~/
b. cd ~/
c. dpkg –I *.deb

The proper output should be as follows:

Selecting previously deselected package libevent1.
(Reading database … 115620 files and directories currently installed.)
Unpacking libevent1 (from libevent1_1.3e-1_amd64.deb) …
Selecting previously deselected package libgssglue1.
Unpacking libgssglue1 (from libgssglue1_0.1-1_amd64.deb) …
Selecting previously deselected package libnfsidmap2.
Unpacking libnfsidmap2 (from libnfsidmap2_0.20-0build1_amd64.deb) …
Selecting previously deselected package librpcsecgss3.
Unpacking librpcsecgss3 (from librpcsecgss3_0.17-1ubuntu2_amd64.deb) …
Selecting previously deselected package nfs-common.
Unpacking nfs-common (from nfs-common_1%3a1.1.2-2ubuntu2.2_amd64.deb) …
Selecting previously deselected package nfs-kernel-server.
Unpacking nfs-kernel-server (from nfs-kernel-server_1%3a1.1.2-2ubuntu2.2_amd64.deb) …
Selecting previously deselected package portmap.
Unpacking portmap (from portmap_6.0-4_amd64.deb) …
Setting up libevent1 (1.3e-1) …

Setting up libgssglue1 (0.1-1) …

Setting up libnfsidmap2 (0.20-0build1) …

Setting up librpcsecgss3 (0.17-1ubuntu2) …

Setting up portmap (6.0-4) …
* Starting portmap daemon…
…done.

Processing triggers for man-db …
Setting up nfs-common (1:1.1.2-2ubuntu2.2) …

Creating config file /etc/idmapd.conf with new version

Creating config file /etc/default/nfs-common with new version
Adding system user `statd’ (UID 113) …
Adding new user `statd’ (UID 113) with group `nogroup’ …
Not creating home directory `/var/lib/nfs’.
* Starting NFS common utilities
…done.

Setting up nfs-kernel-server (1:1.1.2-2ubuntu2.2) …

Creating config file /etc/exports with new version

Creating config file /etc/default/nfs-kernel-server with new version
* Starting NFS common utilities
…done.
* Exporting directories for NFS kernel daemon…
…done.
* Starting NFS kernel daemon
…done.

Processing triggers for libc6 …
ldconfig deferred processing now taking place

And, if you happen to miss a package during the transfer, dpkg will be kind enough to tell you.  Here’s the output from my forgetting to transport libevent1_1.3e-1_amd64.deb

Selecting previously deselected package libgssglue1.
(Reading database … 115620 files and directories currently installed.)
Unpacking libgssglue1 (from libgssglue1_0.1-1_amd64.deb) …
Selecting previously deselected package libnfsidmap2.
Unpacking libnfsidmap2 (from libnfsidmap2_0.20-0build1_amd64.deb) …
Selecting previously deselected package librpcsecgss3.
Unpacking librpcsecgss3 (from librpcsecgss3_0.17-1ubuntu2_amd64.deb) …
Selecting previously deselected package nfs-common.
Unpacking nfs-common (from nfs-common_1%3a1.1.2-2ubuntu2.2_amd64.deb) …
Selecting previously deselected package nfs-kernel-server.
Unpacking nfs-kernel-server (from nfs-kernel-server_1%3a1.1.2-2ubuntu2.2_amd64.deb) …
Selecting previously deselected package portmap.
Unpacking portmap (from portmap_6.0-4_amd64.deb) …
Setting up libgssglue1 (0.1-1) …

Setting up libnfsidmap2 (0.20-0build1) …

Setting up librpcsecgss3 (0.17-1ubuntu2) …

dpkg: dependency problems prevent configuration of nfs-common:
nfs-common depends on libevent1 (>= 1.3e); however:
Package libevent1 is not installed.
dpkg: error processing nfs-common (–install):
dependency problems – leaving unconfigured
dpkg: dependency problems prevent configuration of nfs-kernel-server:
nfs-kernel-server depends on nfs-common (>= 1:1.0.8-1); however:
Package nfs-common is not configured yet.
dpkg: error processing nfs-kernel-server (–install):
dependency problems – leaving unconfigured
Setting up portmap (6.0-4) …
* Starting portmap daemon…
…done.

Processing triggers for man-db …
Processing triggers for libc6 …
ldconfig deferred processing now taking place
Errors were encountered while processing:
nfs-common
nfs-kernel-server

To review:

(1) Install Program [X] On An Online Ubuntu Box

a. sudo apt-get install [program list]
b. ls /media
c. cd /var/cache/apt/archives/
d. ls –tl
e. cp [filename.deb] /media/[name of flashdrive]

z. umount /media/[name of flashdrive]

(2) To The “Offline” Machine…

a. cp /media/[name of flashdrive]/*.deb ~/
b. cd ~/
c. dpkg –I *.deb

www.ubuntu.com
en.wikipedia.org/wiki/Network_address_translation
en.wikipedia.org/wiki/Vulcan_nerve_pinch
www.debian.org
en.wikipedia.org/wiki/Dpkg
en.wikipedia.org/wiki/Apt-get
en.wikipedia.org/wiki/Network_File_System_(protocol)

Fuse Box Description and Amperage Settings For “New” Volkswagen Beetles

Friday, April 10th, 2009

The Volkswagen New Beetle.  You can get a full-sized drum set into these things (although a 24″ kick’s going to require a padded case), a fact I learned after I bought the car in 2002, as my old Pearl Prestige Session drums had, at the time, been stolen by an antiquities-dealing crack addict who was part of a police sting operation to catch a drug lord on Syracuse‘s West Side.  One of my better band stories and proof that people on drugs are not in their right state of mind.  Also handy for transporting computer clusters across state lines.

The old Nanorex cluster and my Al Foster-phase Pearl Prestige Session kit.  Click on either for a larger image.

Just so no one else has to spend as much time looking around for this information as I did to figure out a problem with my Blinker/Hazard Relay, I provide the fuse box diagram below (for google and beyond).  Click on the image for a larger view.

If you lost this card, print and shove into the glove box.  You will eventually find it handy.

www.vw.com
www.vw.com/newbeetle/en/us
www.pearldrum.com
www.syracuse.com
www.nanorex.com
en.wikipedia.org/wiki/Al_Foster

Obligatory


T R P Nanosys


Syracuse Astro


Ubuntu 4 Nano


N-Fact. Collab.

Nano Gallery

  • nano gallery
  • nano gallery
  • nano gallery
  • nano gallery
  • nano gallery
  • nano gallery
  • nano gallery
  • nano gallery
  • nano gallery
  • nano gallery
  • more...
  • Aerial Photos

  • aerial photos
  • aerial photos
  • aerial photos
  • aerial photos
  • aerial photos
  • aerial photos
  • aerial photos
  • aerial photos
  • aerial photos
  • aerial photos
  • more...
  • Syracuse Scenes

  • syracuse scenes
  • syracuse scenes
  • syracuse scenes
  • syracuse scenes
  • syracuse scenes
  • syracuse scenes
  • syracuse scenes
  • syracuse scenes
  • syracuse scenes
  • syracuse scenes
  • more...