From mboxrd@z Thu Jan 1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
by finch.gentoo.org with esmtp (Exim 4.60)
(envelope-from
Gentoo Linux =C3=A8 una speciale distribuzione di Linux che pu=C3=B2 esse=
re facilmente
ottimizzata e personalizzata per qualsiasi applicazione o necessit=C3=A0.=
L'estrema
velocit=C3=A0, la grande configurabilit=C3=A0 e l'ottima collaborazione f=
ra gli sviluppatori
e gli utenti sono i grandi punti di forza di gentoo.
Grazie a portage, Gentoo Linux pi=C3=B9 diventare un server sicuro, una w=
orkstation
per lo sviluppo, una postazione desktop professionale, una piattaforma di=
gioco,
un sistema embedded o - come spiega questa guida - un sistema di computin=
g ad
alta performance. Le varie personalizzazioni di Gentoo Linux sono
quasi infinite, perci=C3=B2 il sistema viene anche definito una metadistr=
ibuzione.
Questa guida spiega come installare un sistema basato su Gentoo in un sis=
tema di
computing al alta performance. Passo dopo passo spiega quali pacchetti so=
no necessari
e come configurarli correttamente.
Se non sei ancora in possesso di Gentoo Linux puoi procurartene una copia=
dal sito web
Durante l'installazione di Gentoo bisogna attivare alcune variabili USE i=
n
o pi=C3=B9 semplicemente
Nelle sezioni 7 e 9 (Configurazione del Kernel e Installazione degli stru=
menti di
sistema) per ragioni di stabilit=C3=A0 raccomandiamo l'installazione di v=
anilla-sources,
la versione ufficiale del kernel (quella di
Quando in seguito installerete altri pacchetti vi consigliamo di emergere=
pure questi:
Un cluster necessita di un communication layer ("strato per le comunicazi=
one") per
connettere i nodi principali ai nodi secondari. Normalmente delle schede =
di rete come
FastEthernet o GigaEthernet hanno un buon rapporto qualit=C3=A0/prezzo. U=
n'altra
possibilit=C3=A0 =C3=A8 l'uso di prodotti come
Un cluster =C3=A8 composto da due tipi di nodi: master (primari) o slave =
(secondari).
Normalmente da un solo nodo master e da molti nodi slaves.
Il nodo master =C3=A8 il server del cluster e il suo compito =C3=A8 di co=
ordinare i nodi slaves
dicendogli che cosa fare. Normalmente ha quindi dei demoni come dhcpd, nf=
s, pbs
server, e pbs-sched. Il nodo master deve quindi garantire sessioni intera=
ttive e
accettare esecuzioni di processi.
I nodi slaves invece attendono di ricevere istruzioni (ad esempio via ssh=
/rsh) dal
nodo master. Il loro unico compito =C3=A8 di elaborare le istruzioni rice=
vute, quindi non
dovrebbero avere installati servizi inutili.
Ogni nodo dovrebbe avere nel file host (
Per configurare la LAN dedicata del vostro cluster editate il file
Infine configurate il demone DHCP del vostro server, in maniera da poter =
evitare
di dover mantenere manualmente la configurazione della rete su ogni nodo =
slave.
Il Netsork File System (NFS) =C3=A8 stato sviluppato per permettere a del=
le macchine di
montare una partizione del disco su una macchina in rete, come se fosse r=
ealmente un
suo disco. Ci=C3=B2 permette quindi di condividere velocemente e simultan=
eamente dei files
nella rete.
Ci sono anche altri sistemi che hanno funzionalit=C3=A0 simili a NFS e ch=
e possono essere
usati in un cluster. Il
Configura e installa un kernel che supporti NFS v3 in tutti i nodi:
Nel server modifica il file
Modifica il file
Aggiungi nfs al runlevel come default sul server:
Per montare sui nodi slaves il filesystem nfs del nodo master dovete modi=
ficare
il file
Dovete anche fare in modo che i nodi slaves montino il filesystem ntfs:
SSH =C3=A8 un protocollo per effettuare login remoti e altri operazioni i=
n una rete
insicura, ma maniera sicura. Infatti OpenSSH usa la crittografia a chiave=
pubblica per
garantire un'autenticazione e una comunicazione sicura. Prima di configur=
are ssh
bisogna generare una chiave pubblica, che sar=C3=A0 poi condivisa con il =
sistema remoto,
e una chiave privata che sar=C3=A0 conosciuta solo dal sistema locale.
Per un uso pulito di ssh devono essere usate le chiavi pubbliche/private.=
Ci=C3=B2 va
fatto con due passaggi:
Per un'autenticazione basata sugli utenti, bisogna eseguire qualcosa del =
genere:
Per l'autenticazione basata sugli hosts devi modificare il file
Sono necessarie anche alcune modifiche al file
Se la tua applicazione richiede comunicazioni via RSH =C3=A8 necessario e=
mergere
net-misc/netkit-rsh e sys-apps/xinetd.
Adesso configura il demone rsh editando il file
USE=3D"-oss 3dnow -apm -arts -avi -berkdb -crypt -cups -encode -gdbm
-gif gpm -gtk -imlib -java -jpeg -kde -gnome -libg++ -libwww -mikmod
mmx -motif -mpeg ncurses -nls -oggvorbis -opengl pam -pdflib -png
-python -qt -qtmt -quicktime -readline -sdl -slang -spell -ssl
-svga tcpd -truetype -X -xml2 -xmms -xv -zlib"
USE=3D"-* 3dnow gpm mmx ncurses pam sse tcpd"
# emerge -p syslog-ng vanilla-sources
# emerge -p nfs-utils portmap tcpdump ssmtp iptables xinetd
# Adelie Linux Research & Development Center
# /etc/hosts
127.0.0.1 localhost
192.168.1.100 master.adelie master
192.168.1.1 node01.adelie node01
192.168.1.2 node02.adelie node02
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or la=
ter
# Global config file for net.* rc-scripts
# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth0=3D"192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0=
"
# Network Connection to the outside world using dhcp -- configure as requ=
ired for you network
iface_eth1=3D"dhcp"
# Adelie Linux Research & Development Center
# /etc/dhcp/dhcpd.conf
log-facility local7;
ddns-update-style none;
use-host-decl-names on;
subnet 192.168.1.0 netmask 255.255.255.0 {
option domain-name "adelie";
range 192.168.1.10 192.168.1.99;
option routers 192.168.1.100;
host node01.adelie {
# MAC address of network card on node 01
hardware ethernet 00:07:e9:0f:e2:d4;
fixed-address 192.168.1.1;
}
host node02.adelie {
# MAC address of network card on node 02
hardware ethernet 00:07:e9:0f:e2:6b;
fixed-address 192.168.1.2;
}
}
# emerge -p nfs-utils portmap
# emerge nfs-utils portmap
CONFIG_NFS_FS=3Dy
CONFIG_NFSD=3Dy
CONFIG_SUNRPC=3Dy
CONFIG_LOCKD=3Dy
CONFIG_NFSD_V3=3Dy
CONFIG_LOCKD_V4=3Dy
portmap:192.168.1.0/255.255.255.0
/home/ *(rw)
# rc-update add nfs default
master:/home/ /home nfs rw,exec,noauto,nouser,async 0 0
# rc-update add nfsmount default
# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): /root/.ssh/id_ds=
a
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
f1:45:15:40:fd:3c:2d:f7:9f:ea:55:df:76:2f:a4:1f root@master
node01.adelie
node02.adelie
master.adelie
# $OpenBSD: sshd_config,v 1.42 2001/09/20 20:57:51 mouring Exp $
# This sshd was compiled with PATH=3D/usr/bin:/bin:/usr/sbin:/sbin
# This is the sshd server system-wide configuration file. See sshd(8)
# for more information.
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
# emerge -p xinetd
# emerge xinetd
# emerge -p netkit-rsh
# emerge netkit-rsh
# Adelie Linux Research & Development Center # /etc/xinetd.d/rsh service shell { socket_type =3D stream protocol =3D tcp wait =3D no user =3D root group =3D tty server =3D /usr/sbin/in.rshd log_type =3D FILE /var/log/rsh log_on_success =3D PID HOST USERID EXIT DURATION log_on_failure =3D USERID ATTEMPT disable =3D no }
Modifica anche il file
# Adelie Linux Research & Development Center # /etc/hosts.allow in.rshd:192.168.1.0/255.255.255.0
O potete semplicemente avere fiducia nella vostra LAN:
# Adelie Linux Research & Development Center # /etc/hosts.allow =20 ALL:192.168.1.0/255.255.255.0
Per finire configura l'autenticazione degli host editando il file
# Adelie Linux Research & Development Center # /etc/hosts.equiv master node01 node02
E imposta il runlevel di xinetd su default:
# rc-update add xinetd default
Il Network Time Protocol (NTP) =C3=A8 usato per sincronizzare l'ora di un= computer (client o server) con quella di un altro server o di un altra macchina ch= e ha un orologio, ad esempio una radio, un ricevitore satellitare o un modem. Generalmente la precisione in una rete LAN =C3=A8 di un millisecondo e in= una rete WAN =C3=A8 di una decina di millisecondi utilizzando ad esempio UTC (Coor= dinated Universal Time) con un GPS (Global Positioning Service). Solitamente le configurazi= oni di NTP utilizzano molti servers ridondanti e diversi percorsi della rete = per raggiungere un'ottima precisione e un'ottima attendibilit=C3=A0.
Scegli un server NTP geograficamente abbastanza vicino a te da
# Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # /etc/conf.d/ntpd # NOTES: # - NTPDATE variables below are used if you wish to set your # clock when you start the ntp init.d script # - make sure that the NTPDATE_CMD will close by itself ... # the init.d script will not attempt to kill/stop it # - ntpd will be used to maintain synchronization with a time # server regardless of what NTPDATE is set to # - read each of the comments above each of the variable # Comment this out if you dont want the init script to warn # about not having ntpdate setup NTPDATE_WARN=3D"n" # Command to run to set the clock initially # Most people should just uncomment this line ... # however, if you know what you're doing, and you # want to use ntpd to set the clock, change this to 'ntpd' NTPDATE_CMD=3D"ntpdate" # Options to pass to the above command # Most people should just uncomment this variable and # change 'someserver' to a valid hostname which you # can aquire from the URL's below NTPDATE_OPTS=3D"-b ntp1.cmc.ec.gc.ca" ## # A list of available servers is available here: # http://www.eecis.udel.edu/~mills/ntp/servers.html # Please follow the rules of engagement and use a # Stratum 2 server (unless you qualify for Stratum 1) ## # Options to pass to the ntpd process that will *always* be run # Most people should not uncomment this line ... # however, if you know what you're doing, feel free to tweak #NTPD_OPTS=3D""
Modifica il file
# Adelie Linux Research & Development Center # /etc/ntp.conf # Synchronization source #1 server ntp1.cmc.ec.gc.ca restrict ntp1.cmc.ec.gc.ca # Synchronization source #2 server ntp2.cmc.ec.gc.ca restrict ntp2.cmc.ec.gc.ca stratum 10 driftfile /etc/ntp.drift.server logfile /var/log/ntp broadcast 192.168.1.255 restrict default kod restrict 127.0.0.1 restrict 192.168.1.0 mask 255.255.255.0
E imposta in tutti i nodi slaves, come fonte per la sincronizzazione, il = tuo nodo master.
# 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # /etc/conf.d/ntpd NTPDATE_WARN=3D"n" NTPDATE_CMD=3D"ntpdate" NTPDATE_OPTS=3D"-b master"
# Adelie Linux Research & Development Center # /etc/ntp.conf # Synchronization source #1 server master restrict master stratum 11 driftfile /etc/ntp.drift.server logfile /var/log/ntp restrict default kod restrict 127.0.0.1
Per finire aggiungi ntpd al runlevel di tutti i nodi:
# rc-update add ntpd default
Per configurare un firewall sul vostro cluster dovete installare iptables= =2E
# emerge -p iptables # emerge iptables
Configurazione del kernel richiesta:
CONFIG_NETFILTER=3Dy CONFIG_IP_NF_CONNTRACK=3Dy CONFIG_IP_NF_IPTABLES=3Dy CONFIG_IP_NF_MATCH_STATE=3Dy CONFIG_IP_NF_FILTER=3Dy CONFIG_IP_NF_TARGET_REJECT=3Dy CONFIG_IP_NF_NAT=3Dy CONFIG_IP_NF_NAT_NEEDED=3Dy CONFIG_IP_NF_TARGET_MASQUERADE=3Dy CONFIG_IP_NF_TARGET_LOG=3Dy
Le regole che questo tipo di firewall necessita sono:
# Adelie Linux Research & Development Center # /var/lib/iptbles/rule-save *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -s 192.168.1.0/255.255.255.0 -i eth1 -j ACCEPT -A INPUT -s 127.0.0.1 -i lo -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -j LOG -A INPUT -j REJECT --reject-with icmp-port-unreachable COMMIT *nat :PREROUTING ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A POSTROUTING -s 192.168.1.0/255.255.255.0 -j MASQUERADE COMMIT
Infine aggiungi anche iptables al runlevel di tutti i nodi:
# rc-update add iptables default
Il Portable Batch System (PBS) =C3=A8 un sistema flessibile per la gestio= ne delle code di batch; originariamente =C3=A8 stato sviluppato dalla NASA. Funziona bene = con networked e sistemi UNIX multi-piattaforma, come clusters, workstations, supercompute= rs e molti sistemi paralleli. Attualmente =C3=A8 la Altair Grid Technologies che con= tinua lo sviluppo di PBS.
# emerge -p openpbs
Prima di iniziare a usare OpenPBS sono necessarie alcune configurazioni p= articolari. I files da personalizzare sono:
Questo =C3=A8 un esempio di sched_config:
# # Create queues and set their attributes. # # # Create and define queue upto4nodes # create queue upto4nodes set queue upto4nodes queue_type =3D Execution set queue upto4nodes Priority =3D 100 set queue upto4nodes resources_max.nodect =3D 4 set queue upto4nodes resources_min.nodect =3D 1 set queue upto4nodes enabled =3D True set queue upto4nodes started =3D True # # Create and define queue default # create queue default set queue default queue_type =3D Route set queue default route_destinations =3D upto4nodes set queue default enabled =3D True set queue default started =3D True # # Set server attributes. # set server scheduling =3D True set server acl_host_enable =3D True set server default_queue =3D default set server log_events =3D 511 set server mail_from =3D adm set server query_other_jobs =3D True set server resources_default.neednodes =3D 1 set server resources_default.nodect =3D 1 set server resources_default.nodes =3D 1 set server scheduler_iteration =3D 60
Per mandare un processo (job) a OpenPBS, il comando
manda la richiesta a OpenpPBS di eseguire myscript in 2 nodi # qsub -l nodes=3D2 -j oe -m abe myscript
Normalmente le istruzioni sono mandate a OpenPBS sotto forma di scripts. = Se qualche volta aveste bisogno di eseguire delle operazioni manualmente potete rich= iedere una shell interattiva a OpenPBS, con il parametro "-I".
# qsub -I
Per vedere lo stato dei vostri jobs potete usare il comando:
# qstat Job id Name User Time Use S Queue ------ ---- ---- -------- - ----- 2.geist STDIN adelie 0 R upto1nodes
Message passing (scambio di messaggi) =C3=A8 una libreria usata frequente= mente in certi tipi di parallel machines, specialmente nelle architetture a memoria distribui= ta. MPICH =C3=A8 un'implementazione di MPI (lo standard per lo scambio di messaggi) distri= buita liberamente.
L'ebuild di mpich scritto da Adelie Linux ha due USE flags:
# emerge -p mpich # emerge mpich
Potreste avere la necessit=C3=A0 di esportare una directory di lavoro per=
mpich in tutti
i vostri nodi slaves in
/home *(rw)
Most massively parallel processors (MPPs) mette a disposizione un modo pe=
r fare
partire un programma su un determinato numero di processori; quando =C3=A8=
possibile
Modifica questo file per specificare le macchine del tuo cluster:
# Change this file to contain the machines that you want to use # to run MPI jobs on. The format is one host name per line, with either # hostname # or # hostname:n # where n is the number of processors in an SMP. The hostname should # be the same as the result from the command "hostname" master node01 node02 # node03 # node04 # ...
Puoi usare lo script
L'unico argomento di
# /usr/local/mpich/sbin/tstmachines LINUX
# /usr/local/mpich/sbin/tstmachines -v LINUX
L'output di questo comando sar=C3=A0 qualcosa del genere:
Trying true on host1.uoffoo.edu ... Trying true on host2.uoffoo.edu ... Trying ls on host1.uoffoo.edu ... Trying ls on host2.uoffoo.edu ... Trying user program on host1.uoffoo.edu ... Trying user program on host2.uoffoo.edu ...
Se
Anche questo test =C3=A8 necessario per tutti i tools di sviluppo:
# cd ~ # cp /usr/share/mpich/examples1/hello++.c ~ # make hello++ # mpirun -machinefile /usr/share/mpich/machines.LINUX -np 1 hello++
Per ulteriori informazioni su MPICH consulta la documentazione sul sito
(in arrivo)
(in arrivo)
Il documento originale (in inglese) =C3=A8 pubblicato sul sito