LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how do I make a cluster? (https://www.linuxquestions.org/questions/linux-networking-3/how-do-i-make-a-cluster-64063/)

randomx 06-06-2003 03:07 PM

how do I make a cluster?
 
Hi,

how do I make my two machines (both with different hardware) run RedHat 9 like one big powerful machine? Somebody recommended MSC.Linux to make my clustering experience less painful. :confused: --any thoughts on that one?

I guess I'm looking for a quick and dirty solution, a HOWTO type of thing on Beowulf or some other type of clustering solution using RedHat 9. :study:

Thanks, Randomx

acid_kewpie 06-06-2003 03:11 PM

well if you want a kinda cluster kinda HOWTO, how about the cluster HOWTO at http://tldp.org ;)

ranger_nemo 06-09-2003 06:26 PM

As a_k pointed out, there's HOW-TOs at TLDP. Another good site to check out is << openmosix.sourceforge.net >>.

Putting a network together and running software isn't too hard. Unfortunately, unless you are a good programmer, there's not going to be much you can do with a home cluster. Programs have to be specially written to take advantage of multiple processors in a single computer. Imagine how much more it takes to write a program to take advantage of several computers.

For example, let's look at SETI@home. It's a program that can take several hours to several days to compute the results from one work unit. If you could split it up to two computers, it would take a bit more than half the time, because you have to spend a little time assembling the two results at the end. If you have two identical computers clustered, and it takes one 8 hours to compute a result, it could 4.01 hours to compute the same result. In 8.02 hours, you could have two results. But, if you just had the two separate computers each computing separate results, then you would have two results in 8 hours. Maybe even less than 8, if one gets an easier work unit... If you split a work unit in half, and one half is easier, the one computer will be sitting idle while the other computer finishes so they can return one complete result. Otherwise, the cluster nodes would need to be constantly comparing cpu-load and re-splitting the work unit to even it out, and waste even more time.

If you are looking at it as a project, by all means, have at it. But, a cluster of computers isn't going to be a single super-computer for day-to-day programs.

The OpenMosix cluster is a simple cluster... The nodes compare cpu-loads and suffle processes around to the best computer. It doesn't split a single process up, it just finds the computer best able to handle it.

ranger_nemo 06-09-2003 07:31 PM

<< http://bofh.be/clusterknoppix/ >> might be a simple solution.

randomx 10-23-2003 05:06 PM

got it.
 
hey you guys, I finally got my cluster to work.

Here's what I did. Reply if you get stuck somewhere.
I got inputs here and there, nothing really helped me so I decided to do it on my own HOWTO using MOSIX to setup my cluster. :study:

Mosix Linux Clustering

Ingredients:
1. Two computes running any linux distribution. I'm using Red Hat 9.0.
2. A crossover cable or a regular CAT-5 network cable if using a hub-switch.
3. Go to hxxp://www.mosix.org and get latest Mosix Kernel and User Tool files. In my situation, I downloaded MOSKRN-1.10.1.tar.gz and MOSIX-1.10.1.tar.gz. Please note that those two files work only on kernel-2.4.22. Mosix does not archive old distributions -as soon as a new kernel comes up, they upgrade both MOSKRN kernel patch file and MOSIX user tools file.
4. Get kernel-2.4.22 (or whatever Mosix has patches for) from hxxp://www.kernel.org

Steps:
1. Turn on linux computers . All configuration steps will done as root except the testings.

2. Since I'm using a crossover cable, I will assign 192.168.0.1 to node1 (computer 1) and 192.168.0.2 to node2 (computer 2).

3. edit /etc/hosts file and add the following entry on computer 1.
Code:


    127.0.0.1                localhost.localdomain  locahost
    192.168.0.1                node1                      localhost

4. edit /etc/hosts file and add the following entry on computer 2.
Code:

      127.0.0.1                localhost.localdomain  locahost
    192.168.0.2                node2                      localhost

-------------------------------------------------------------------------------------------
REPEAT STEPS 5 to 24 on both machines before you start the testings
--------------------------------------------------------------------------------

5. Type #neat and input there the IP address you picked for your machine. Subtnet Mask: 255.255.255.0 Gateway address: I put the other machine's IP address. So if I'm working on computer1 I typed 192.168.0.2. If working on computer 2, I typed 192.168.0.1

6. Put MOSKRN-1.10.1.tar.gz, MOSIX-1.10.1.tar.gz, and Kernel-2.4.22.tar.bzip2 in /usr/src directory.

7. #cd /usr/src

8. Untar MOSKRN-1.10.1.tar.gz and MOSIX-1.10.1.tar.gz.
#tar xvzpf MOSKRN-1.10.1.tar.gz
#tar xvzpf MOSIX-1.10.1.tar.gz

9. #cd /usr/src/MOSKRN-1.10.1

10. # ./mosix-install

11. A wizard will start.
a)"Specify the [unpacked] kernel path: " /usr/src/kernel-2.4.22.tar.bzip2
b)"add to grub?" Y
c) "Create symbolic links?" Y
d) "...run-level tools installation?" press enter for all
e) Create MFS mount point? Y
f) User for favorite kernel configuration method. Type here whatever config method you want . [I personally prefer xconfig]

The xconfig window will pop up.

On the top left, you will see MOSIX. Click there and select the following options.

Code:

                                                                       
Y[*]    M[ ]  N [ ]    MOSIX process migration support.  [required]
Y [ ]    M[ ]  N[*]    Support clusters with a complex network topology.
Y [ ]    M[ ]  N[*]    MOSIX kernel debugger off.
Y[*]    M[ ]  N [ ]    Mosix Kernel diagnostics.
Y[*]    M[ ]  N [ ]    Direct File-System Access.
Y[*]    M[ ]  N [ ]    Stricter security on MOSIX options.
Y [ ]    M[ ]  N[*]      Create kernel with -mosix extension
Y[*]    M[ ]  N [ ]    MOSIX file system
Y [ ]    M[ ]  N[*]    Poll/Select exceptions on pipes.

Then click OK and move on to other sections such as "network device support" subsection "ethernet (10 or 100 Mbit)", find your network card and select "Y" to load the modules to the kernel at boot time.

When you are all done click on "Save and Exit". A window saying next you need to do 'make dep'. Ignore the message and click OK. We are not doing a manual kernel compilation. ./mosix-install command is doing it for us.

In case you missed it on the kernel config file set up, the wizard might ask you to add ext3 support for the kernel. Say "Y" to that one.

You can also select "Y" when the installation asks you if you want to watch what's going on. I always do that just in case I spot some errors.

At this point you should see a message that says "Kernel compilation will start...."

When the process is all done you will see a message that says the everything is
beautiful.

12. # cd /usr/src/kernel-2.4.22

13. # make install

14. #vi /etc/grub.conf

You will see something like

Code:

default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title **node1 kernel 2.4.22**
        root (hd0,0)
        kernel /vmlinuz-2.4.22 ro root=LABEL=/ hdb=ide-scsi
        initrd /initrd-2.4.22.img
#title Red Hat Linux (2.4.20-8)
#      root (hd0,0)
#      kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ hdb=ide-scsi
#      initrd /initrd-2.4.20-8.img

NOTE: on the line "kernel /vmlinuz-2.4.22 ro root=LABEL=/ hdb=ide-scsi"

get rid of the part that says "ro root=LABEL=/". Or just specify the right path to the kernel image. If you leave it like that, you will get a kernel panic error at boot time. If you don't believe me, try it and fix it later if you want.


15. #reboot [don't forget to select **node1 kernel 2.4.22** or change /etc/grub.conf "default=0" instead of "default=1".

16. When the kernel boots up, you will see the message:
"You have no MOSIX configuration -please edit your now: Editor to use [q to quit] -vi
type vi and add the following entry to the /etc/mosix.map

Code:

                                                                       
1      192.168.0.1    1
2      192.168.0.2    1

First column indicates the node number. Right next to it, is the IP address you
assigned to it. "1" at the end is the 'span' argument. Since we are setting up a small cluster, just type "1".

Note that /etc/mosix.map file should look exactly the same, with the same entries and everything, ON EACH NODE OF YOUR CLUSTER. Do not forget about that one. :tisk:

After you are done editing that file, the boot process will continue normally.
You can make any modifications to /etc/mosix.map after your computer boots up, but make sure to make those same changes on every /etc/mosix.map that's going to
be on every node.

17. vi /etc/rc.d/rc.local [your distro might have a different "start up" file. ]
Add the following line:

Code:

                                                                               
/sbin/setpe -W -f /etc/mosix.map touch /var/lock/subsys/mosix

18. # cd /

19. #mkdir cluster [or whatever name you prefer]

20. vi /etc/fstab and change the "/mfs" line to specify a mount point

Code:

                                             
cluster        /mfs            mfs            dfsa=1          0 0

21. # reboot

22. #/sbin/service mosix start

23. #/sbin/chkconfig mosix on [select all runlevels if you want to]

24. To shut down a node in the cluster, make sure you create a shell script or something, with the following code. Execute it before you bring the node down:

echo 0 > /proc/mosix/admin/mospe rm -f /var/locl/subsys/mosix umount /mfs

That line of commands remove the node from the cluster and unmounts the /mfs filesystem. Some distributions don't understand that MFS is a network file system
and will try to unmount at the wrong time.

TESTING

1. type #mod on any node. You will see a graph bar type of indicating what process have been migrated to the other node in the cluster.

2. Open two or three consoles and type:

awk 'BEGIN {for(i=0;i<100000;i++) for (j=0;j<100000;j++);}'

3. Go back to the console where you typed #mon

You are going to be witnessing your own cluster in action. Migrating processes to each other and everything.

enjoy.

randomX
:cool:

mrde50garfield 01-05-2004 05:51 PM

Linux Central has a Scyld Beowuld CD for sale for only a few bucks. It's an excellent start for anyone interested in Beowulf clustering. I set up a 13-node cluster using this software in minutes.

chakk_lo 01-23-2004 05:06 AM

Re: got it.
 
solved :p

chakk_lo 01-25-2004 11:16 PM

no one replied :(

jing 06-07-2004 07:51 PM

I kinda have the same problem as chakk_lo. After setting up my cluster (which consisted of only two PCs), My frontend doesn't show my compute node being added. I'm using BioBrew which is derived from ROCKS. How can I check if they are successfully connected? And if thy are not, does anyone knows why?

jing 06-08-2004 12:23 AM

One more stupid question. Does compute nodes have xwindows?

utopicdog 07-29-2004 05:00 PM

if you want to know if your network works, then use ping from one host to another, ie if your file /etc/mosix.map says:

1 fred 1
2 eric 1

then type 'ping fred' from eric, and conversly type 'ping eric' from fred
both will tell you if you have a route to the other.

mosix didn't work for me until I had run 'setpe' on both machines, and setpe needs lots of perl extensions to work.
I have not verified timings for mosix, but it does not seem to be an instant solution, even if processes DO migrate after a while.

if you ever write a unix application use 'fork()' and let the children do dome work, a monolthic program cannot take advantage of mosix. some programs (staroffice?) can, the thing to do is zgrep the source packages for 'fork(' and try to use those for clusters.

I have spent a while trying to get mosix to work because I think it is elegant but I have not noticed any real speed advantage, even when one of the other nodes is a much faster machine with a good network card on both ends. still I try from time to time as I think mosix is the futre.

good luck,

uyopicdog

JCdude2525 09-14-2004 05:42 PM

I found that openMosix is very easy to install, and if you have a Redhat Distro you can use the RPM to get it done in like five minutes. MOSIX didn't work to well for me, that's why I used openMosix.

siyadahmed 10-31-2004 11:56 PM

Hi,
Here i setup LAM-MPI based cluster. It able to run programs written in C. But my actual need is to write something in Perl or Python. I tried Parallel::MPI::Simple in perl but it is not running, i think it is not properly installed. but Make process doesn't show any error. Same with the Python. Make process is success full but when try some sripts it says cannpt import 'mpi'. is there anyone worked on these before.


All times are GMT -5. The time now is 02:39 PM.