12.08.2006

Build Our First Cluster(Simple Ver)

1、Prepare our cluster hosts(at least 2 hosts,U can use Vmware).
Our example is based on 2 hosts because of my poor pc env. to slow for more hosts.
2、Set the cluster hosts, our hosts are linux
PC1 ip:192.168.0.150 netmask 255.255.255.0
PC2 ip:192.168.0.160 netmask 255.255.255.0
#service sshd start (both the hosts)
Note: we should set the ssh service for logging into each other without password.
do as follow:
a. pc1$ssh 192.168.0.160 if ok then b
b. pc1$ssh-keygen rsa (passphrse u can type : yourpassword (twice of course))
c. pc1$scp -p .ssh/id_rsa.pub pc2:.ssh/authorized_keys
d. pc1$ssh-agent $SHELL
e. pc1$ssh-add (input the : "yourpassword" u just input in step b)
f. pc1$ssh 192.168.0.160 will need no password if not check with the follow web site
http://kimmo.suominen.com/docs/ssh/
3、Get the code and make it.
the taskmaster code offered by ClusterMonkey
Put the code for task.c and its Makefile in a subdirectory on your system(s) and build it (just entering "make" should do it, if gcc and make are installed and correctly set up).
Put the resulting "task" binary on a consistent path on all the systems. This might be someplace like /tmp/task.
Put the taskmaster script in a convenient place -- probably your working subdirectory where you have the task.c source. If you execute the taskmaster script without arguments (be sure to set its executable bits) it will also tell you its argument list. If it complains about not knowing about threads, you will need to update your version of perl to one that includes thread support.
4、Test the cluster
$vi hostfile ( had better in the taskmaster directory:-)
$cat hostfile
192.168.0.160
192.168.0.150
$chmod +x taskmaster
$./taskmaster 1 10 1
$./taskmaster 2 10 1 ( comp the time consume by the task)
$./taskmaster 1 10 10
$./taskmaster 2 10 10 ( comp the time consume by the task)
Will You find something different. Then We succeed! Congratulations!

Reference:
ClusterMonkey Web Site http://www.clustermonkey.net

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home