Sunday, August 23, 2009

New Topics for a New School Year!

All the topics or threads I've written on so far focus primarily on last school year 2008-2009 at Baldwin High School and Nassau Community College. Some of these threads also referenced issues from years prior to that. So, I think I need some new topics:

General will remain unchanged

"LinuxCluster" will become "Clusters 2009-2010" relating to the work of my Computer Science IndependentStudy students (CSI).

"Scientific Computing" will become "Learning with Technology 2009-2010" focusing on my new Calculus Research Lab (CRL).

"SmartBoards" will become "Teaching with Technology 2009-2010" discussing technology issues from my end as the teacher delivering content with technology.

Generally Speaking,


calcpage@aol.com

Friday, August 21, 2009

Poor Man's Cluster - Step 9

This is going to be my last entry to this topic. I'll be making new topics for the 2009-2010 school year. Anyway, I thought you'd be interested in a couple scripts we used from time to time. These are not entirely necessary, but proved helpful:

biscuit.sh:
./povray +i./scenes/advanced/biscuit.pov -f +d +p +v +w1024 +h768 +a0.1 +L./include

addkey.sh:
#ssh root@10.5.129.$1 "useradd -m cluster && passwd cluster"
#ssh cluster@10.5.129.$1 "mkdir -p /home/cluster/.ssh;echo 1; ssh-keygen -N \"\" -f /home/cluster/.ssh/id_rsa -t rsa;echo 2;"
#scp -v cluster@10.5.129.$1:/home/cluster/.ssh/id_rsa.pub cluster@10.5.129.7:/home/cluster/id_rsa.pub$1;echo 3;
for ((a=1;a<26;a++));do echo trying $a; ssh -x cluster@10.5.129.$a "ssh-keygen -N \"\" -f /home/cluster/.ssh/id_rsa" ; scp cluster@10.5.129.$a:/home/cluster/.ssh/id_rsa.pub /home/cluster/id_rsa.pub$a ;done
#ssh -x cluster@10.5.129.$1 "mkdir -p /home/cluster/.ssh; ssh-keygen -N \"\" -f /home/cluster/.ssh/id_rsa -t rsa; scp /home/cluster/.ssh/id_rsa.pub cluster@10.5.129.7:/home/cluster/id_rsa.pub$1"

populate.sh:
for ((i=1;i<26;i++));do scp .ssh/authorized_keys 10.5.129.$i:/home/cluster/.ssh; scp .ssh/known_hosts 10.5.129.$i:/home/cluster/.ssh; scp .vimrc 10.5.129.$i:/home/cluster; ssh 10.5.129.$i ln .ssh/authorized_keys .ssh/authorized_keys2; echo done $i; done

povkill.sh:
#!/bin/bash
for a in $@; do
addr="10.5.129."${a#10.5.129.}
addr=${addr/10.5.129.self/127.0.0.1}
addr=${addr/10.5.129.localhost/127.0.0.1}
addr=${addr/10.5.129.127.0.0.1/127.0.0.1}
ssh cluster@$addr pkill -u cluster povray
echo $a done
done

shutdown.sh:
for a in $@; do
ssh root@10.5.129.$a reboot
done

Enjoy,
A. Jorge Garcia,
calcpage@aol.com,
http://calcpage.tripod.com/,
http://www.zazzle.com/cistheta2008,
http://cistheta2007.deviantart.com/,
http://www.youtube.com/cistheta2007

Poor Man's Cluster - Step 9

This is going to be my last entry to this topic. I'll be making new topics for the 2009-2010 school year. Anyway, I thought you'd be interested in a couple scripts we used from time to time. These are not entirely necessary, but proved helpful:

biscuit.sh:
./povray +i./scenes/advanced/biscuit.pov -f +d +p +v +w1024 +h768 +a0.1 +L./include

addkey.sh:
#ssh root@10.5.129.$1 "useradd -m cluster && passwd cluster"
#ssh cluster@10.5.129.$1 "mkdir -p /home/cluster/.ssh;echo 1; ssh-keygen -N \"\" -f /home/cluster/.ssh/id_rsa -t rsa;echo 2;"
#scp -v cluster@10.5.129.$1:/home/cluster/.ssh/id_rsa.pub cluster@10.5.129.7:/home/cluster/id_rsa.pub$1;echo 3;
for ((a=1;a<26;a++));do echo trying $a; ssh -x cluster@10.5.129.$a "ssh-keygen -N \"\" -f /home/cluster/.ssh/id_rsa" ; scp cluster@10.5.129.$a:/home/cluster/.ssh/id_rsa.pub /home/cluster/id_rsa.pub$a ;done
#ssh -x cluster@10.5.129.$1 "mkdir -p /home/cluster/.ssh; ssh-keygen -N \"\" -f /home/cluster/.ssh/id_rsa -t rsa; scp /home/cluster/.ssh/id_rsa.pub cluster@10.5.129.7:/home/cluster/id_rsa.pub$1"

populate.sh:
for ((i=1;i<26;i++));do scp .ssh/authorized_keys 10.5.129.$i:/home/cluster/.ssh; scp .ssh/known_hosts 10.5.129.$i:/home/cluster/.ssh; scp .vimrc 10.5.129.$i:/home/cluster; ssh 10.5.129.$i ln .ssh/authorized_keys .ssh/authorized_keys2; echo done $i; done

povkill.sh:
#!/bin/bash
for a in $@; do
addr="10.5.129."${a#10.5.129.}
addr=${addr/10.5.129.self/127.0.0.1}
addr=${addr/10.5.129.localhost/127.0.0.1}
addr=${addr/10.5.129.127.0.0.1/127.0.0.1}
ssh cluster@$addr pkill -u cluster povray
echo $a done
done

shutdown.sh:
for a in $@; do
ssh root@10.5.129.$a reboot
done

Enjoy,
A. Jorge Garcia,
calcpage@aol.com,
http://calcpage.tripod.com/,
http://www.zazzle.com/cistheta2008,
http://cistheta2007.deviantart.com/,
http://www.youtube.com/cistheta2007

Thursday, August 20, 2009

A Little History

A Little History
Topic: LinuxClusters

Just thought I'd provide a little background:
Our First Cluster: 1995-2001, ethernet (10Mbps), Gateway PCs, 128MB RAM, Mixed Intel Pentium II 400MHz and Intel Pentium III 800MHz
Our Second Cluster: 2001-2007, fast ethernet (100Mbps), Dell PCs, 1GB RAM, Pentium IV 2.6 GHz
Our Current Cluster: 2007-now, gigabit ethernet (1000Mbps), HP PCs, 750MB RAM, AMD Athlon 64bit dualcore 2GHz
That's all folks,

A Little History

A Little History
Topic: LinuxClusters

Just thought I'd provide a little background:
Our First Cluster: 1995-2001, ethernet (10Mbps), Gateway PCs, 128MB RAM, Mixed Intel Pentium II 400MHz and Intel Pentium III 800MHz
Our Second Cluster: 2001-2007, fast ethernet (100Mbps), Dell PCs, 1GB RAM, Pentium IV 2.6 GHz
Our Current Cluster: 2007-now, gigabit ethernet (1000Mbps), HP PCs, 750MB RAM, AMD Athlon 64bit dualcore 2GHz
That's all folks,

Monday, August 17, 2009

Poor Man's Cluster - Step 8

Poor Man's Cluster
Topic: LinuxClusters

Now that I think about it, the title of this thread should not have been "Poor Man's Cluster" as the only thing cheap about it is the firmware and software which is free, but the hardware is state-of-the-art.  The topic should be something like: "Instant Cluster, Just add water!" 
Anyway, just to emphasize the public key ssh athentication, here is the thread from www.knoppix.net that I linked below:
Reply with quote

My students and I are interested in setting up a parallel java (PJ) cluster (http://www.cs.rit.edu/~ark/pj.shtml). These are my advanced independent study students who just spent a year working with MPI & OpenMosix using C & C++. MPI is getting a bit dated and the OpenMosix project just closed, so they want experience with a new kind of cluster/grid paradigm.

Anyway, we've complied with all the installation requirements for PJ (http://www.cs.rit.edu/~ark/pj/doc/edu/rit/pj/cluster/package-summary.html middle of page) except for the following:

Furthermore, it must be possible to do an SSH remote login from the frontend processor to each backend processor without the user having to type a password. This is done using public key authentication. SSH must have public key authentication enabled. Each user must set up SSH public and private keys in his or her account. For further information, refer to the SSH documentation.


I have sshd running, but I don't have any experience with "public key authentication." Anyone out there have any suggestions or tips for this?

TIA,
AJG
Reply with quote

BUMP!

OK, I figured it out. I simply started sshd and created a login on each PC with the same userid and passwd. I logged into each and issued the following commandline:

Code:
ssh-keygen -t rsa


This created a file called id_rsa.pub in the hidden .ssh folder of each user's home dir. Then I scp'ed these files to each machine (with diff filenames) to cut and past one large file calledauthorized_keys2 and that's it! I can now ssh to and from each PC using that userid and no passwd. In fact, as I was logged into each PC with the same userid, I don't think I even need the userid to ssh or fish!

See: 
http://www.petefreitag.com/item/532.cfm

HTH Some1,
AJG
Reply with quote

Correct, instead of fish://userid@xxx.xxx.xxx.xxx in konqueror with a passwd, I can fish without a passwd.

Also, I can simply 
fish://xxx.xxx.xxx.xxx - no need for a userid or passwd as long as I'm using the same userid on each PC.

You just have to have the one userid in common on all PCs, sshd running and the correct authorized_keys2 file on each home dir. Just log into one with a passwd normally, then fish or ssh away to your heart's content without userids or passwds!

HTH Some1 even though my application may be a bit unusual,
AJG

PS: any1 else out there setting up linux clusters?
Hope that helps,


Poor Man's Cluster - Step 8

Poor Man's Cluster
Topic: LinuxClusters

Now that I think about it, the title of this thread should not have been "Poor Man's Cluster" as the only thing cheap about it is the firmware and software which is free, but the hardware is state-of-the-art.  The topic should be something like: "Instant Cluster, Just add water!" 
Anyway, just to emphasize the public key ssh athentication, here is the thread from www.knoppix.net that I linked below:
Reply with quote

My students and I are interested in setting up a parallel java (PJ) cluster (http://www.cs.rit.edu/~ark/pj.shtml). These are my advanced independent study students who just spent a year working with MPI & OpenMosix using C & C++. MPI is getting a bit dated and the OpenMosix project just closed, so they want experience with a new kind of cluster/grid paradigm.

Anyway, we've complied with all the installation requirements for PJ (http://www.cs.rit.edu/~ark/pj/doc/edu/rit/pj/cluster/package-summary.html middle of page) except for the following:

Furthermore, it must be possible to do an SSH remote login from the frontend processor to each backend processor without the user having to type a password. This is done using public key authentication. SSH must have public key authentication enabled. Each user must set up SSH public and private keys in his or her account. For further information, refer to the SSH documentation.


I have sshd running, but I don't have any experience with "public key authentication." Anyone out there have any suggestions or tips for this?

TIA,
AJG
Reply with quote

BUMP!

OK, I figured it out. I simply started sshd and created a login on each PC with the same userid and passwd. I logged into each and issued the following commandline:

Code:
ssh-keygen -t rsa


This created a file called id_rsa.pub in the hidden .ssh folder of each user's home dir. Then I scp'ed these files to each machine (with diff filenames) to cut and past one large file calledauthorized_keys2 and that's it! I can now ssh to and from each PC using that userid and no passwd. In fact, as I was logged into each PC with the same userid, I don't think I even need the userid to ssh or fish!

See: 
http://www.petefreitag.com/item/532.cfm

HTH Some1,
AJG
Reply with quote

Correct, instead of fish://userid@xxx.xxx.xxx.xxx in konqueror with a passwd, I can fish without a passwd.

Also, I can simply 
fish://xxx.xxx.xxx.xxx - no need for a userid or passwd as long as I'm using the same userid on each PC.

You just have to have the one userid in common on all PCs, sshd running and the correct authorized_keys2 file on each home dir. Just log into one with a passwd normally, then fish or ssh away to your heart's content without userids or passwds!

HTH Some1 even though my application may be a bit unusual,
AJG

PS: any1 else out there setting up linux clusters?
Hope that helps,