User Tools

Site Tools


strutture:lnf:dr:calcolo:scientifico:configurazione_lsf_8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
strutture:lnf:dr:calcolo:scientifico:configurazione_lsf_8 [2012/07/24 11:07] pistoni@infn.itstrutture:lnf:dr:calcolo:scientifico:configurazione_lsf_8 [2012/10/19 12:53] (current) – [Installazione di LSF 8] tonto@infn.it
Line 1: Line 1:
 +====== Configurazione di LSF 8 ======
 +
 +
 +==== Operazioni preliminari all'installazione ====
 +
 +Creare l'utente lsf.alice in Kerberos/OpenAfs. A questo scopo va creato un keytab "krb5_alice.keytab" unico per tutti i nodi della farm  e posizionato nella /etc di tutte le macchine.
 +
 +Creare l'utente locale lsf.alice in ciascuno degli hosts(alicn1-10) del cluster Alice.
 +E' preferibile che l'utente lsf.alice abbia lo stesso UID(6935) sia in AFS che negli host.
 +  
 +  adduser -d /home/lsf.alice -m -s /sbin/nologin -u 6935 -g 44 -G lsfadmin lsf.alice
 +  
 +Cambiare owner e protezioni al file /etc/krb5_alice.keytab
 +
 +  chown lsf.alice /etc/krb5_alice.keytab
 +  chmod 400 /etc/krb5_alice.keytab
 +
 +Per poter leggere in AFS e scrivere nella cartella /usr/lnf/lsf/alice/work e mantenere il token tra le varie sessioni entrambi gli utenti root e lsf.alice prendono un ticket come lsf.alice.
 +L'aquisizione del token avviene al boot e ogni 12 ore (00:10; 12:10) tramite lo script get_ticket che è richiamato da inittab e crontab.
 +
 +Script /usr/custom/scripts/get_ticket:
 +
 +  #!/bin/sh
 +    /usr/kerberos/bin/kinit -k -t /etc/krb5_alice.keytab lsf/alice ; /usr/bin/aklog
 +    runuser -s /bin/bash lsf.alice -c "/usr/kerberos/bin/kinit -k -t /etc/krb5_alice.keytab lsf/alice ;  /usr/bin/aklog"
 +  exit
 +
 +Aggiungere le seguenti 2 righe al file /etc/inittab
 +
 +  # Run get_ticket at startup
 +  krb:35:once:/usr/custom/scripts/get_ticket
 +  
 +Aggiungere le seguenti 2 righe al file /etc/crontab
 +  
 +  10 0 * * * root /usr/custom/scripts/get_ticket
 +  10 12 * * * root /usr/custom/scripts/get_ticket
 +  
 +Eseguire lo script a mano
 +
 +  /usr/custom/scripts/get_ticket
 +
 +Opzionalmente, se si vuole fare il login da utente tramite ssh (non necessario per LSF) verificare che nel file /etc/pam.d/sshd la riga :
 +  pam_afs_session.so ignore_root minimum_uid=1000
 +sia sotituita con la seguente:
 +  pam_krb5afs.so minimum_uid=1000
 +
 +Esempio di file /etc/pam.d/sshd
 +
 +  #%PAM-1.0
 +  # This file is auto-generated.
 +  # User changes will be destroyed the next time authconfig is run.
 +  auth        sufficient    pam_krb5.so try_first_pass minimum_uid=1000
 +  auth        required      pam_env.so
 +  auth        sufficient    pam_unix.so nullok try_first_pass
 +  auth        requisite     pam_succeed_if.so uid >= 500 quiet
 +  auth        required      pam_deny.so
 +  auth       required     pam_nologin.so
 +  
 +  account     sufficient    pam_krb5.so minimum_uid=1000
 +  account     sufficient    pam_succeed_if.so uid < 500 quiet
 +  account     required      pam_permit.so
 +  account     required      pam_unix.so
 +  
 +  password    sufficient    pam_krb5.so minimum_uid=1000
 +  password    requisite     pam_cracklib.so try_first_pass retry=3
 +  password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
 +  password    required      pam_deny.so
 +  
 +  session     optional      pam_krb5.so minimum_uid=1000
 +  session     optional      pam_krb5afs.so minimum_uid=1000
 +  # session     optional      pam_afs_session.so ignore_root minimum_uid=1000
 +  session     optional      pam_keyinit.so revoke
 +  session     required      pam_limits.so
 +  session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
 +  session     required      pam_unix.so
 +
 +Creare le coppie di chiavi SSH per evitare la richiesta della password tra un nodo e l'altro.
 +Su tutte le macchine dare il comando:
 +  
 +  ssh-keygen -t rsa
 +  
 +Raccogliere in un unico file temporaneo (ad esempio keys.pub) l'insieme delle chiavi pubbliche di tutte le macchine e appendere questo file alle authorized_keys.
 +  
 +  ssh root@alicn* cat /root/.ssh/id_rsa.pub >> keys.pub
 +  cat keys.pub | ssh root@alicn* "cat >> /root/.ssh/authorized_keys"
 +  rm keys.pub
 +
 +Creare la directory /usr/lnf/lsf e inserirci lo script chiamato /usr/lnf/lsf/farm che prevede il login tramite ssh su tutti i sistemi e automatizza l'esecuzione dei vari comandi su tutti gli hosts. 
 +
 +  #!/bin/bash
 +  BaseName="alicn"
 +  LastNode=10
 +  i=1
 +  if [ "$*" == ""  ]; then 
 +    read -p "Command: " cmd;
 +  else
 +    cmd=$*
 +  fi
 +  echo $cmd
 +  #exit
 +  for (( k=i; k<=LastNode; k++))
 +    do
 +     echo
 +     echo "----------------> ssh root@$BaseName$k \"$cmd\""
 +     /usr/bin/ssh root@$BaseName$k "$cmd"
 +  done
 +
 +==== Installazione di LSF 8 ====
 +
 +Scaricare i tar file di LSF dal sito my.platform.com
 +  * lsf8.0.1_linux2.6-glibc2.3-x86_64.tar.Z  (tar con la distribuzione dei binari)
 +  * lsf8.0.1_lsfinstall.tar.Z                (tar con le procedure e gli script di installazione)
 +
 +Espandere il secondo nella directory di installazione e posizionare il primo tarball nella stessa directory (senza espanderlo): 
 +  /usr/lnf/lsf/lsf_distrib_8.0.1/
 +
 +Personalizzare il file "alice-install.config" contenente le opzioni di installazione modificando i seguenti parametri:
 +  LSF_TOP="/usr/lnf/lsf/alice/"
 +  LSF_ADMINS="lsf.alice"
 +  LSF_CLUSTER_NAME="alice"
 +  LSF_MASTER_LIST="alicn2 alicn3"
 +  LSF_LICENSE="/usr/lnf/lsf/lsf_distrib_8.0.1/license_lsf_8.0-aug12.dat"
 +  Disabilitati i riferimenti a EGO
 +  ENABLE_DYNAMIC_HOSTS="Y"
 +  PATCH_BACKUP_DIR="/usr/lnf/lsf/alice/patch/backup"
 +  PATCH_HISTORY_DIR="/usr/lnf/lsf/alice/patch"
 +  LSF_ADD_SERVERS=:alice-lsf_server_hosts
 +  #LSF_ADD_CLIENTS=:alice-lsf_client_hosts
 +  LSF_TARDIR="/usr/lnf/lsf/lsf_distrib_8.0.1/"
 +
 +  * Nota: per l'installazione si deve essere in possesso di un file di LICENZE DEMO in corso di validità
 +  
 +Eventualmente compilare il file "alice-lsf_client_hosts" (nel nostro caso la variabile LSF_ADD_CLIENTS e' commentata)
 +  alicn1
 +e il file "alice-lsf_server_hosts"
 +  alicn1
 +  alicn2
 +  alicn3
 +  alicn4
 +  alicn5
 +  alicn6
 +  alicn7
 +  alicn8
 +  alicn9
 +  alicn10
 +
 +
 +Avviare l'installazione locale con il comando:
 +  ./lsfinstall -f alice-install.config
 +  
 +Accertarsi che le ACL di AFS consentano la scrittura all'utente lsf.alice, ovvero da utente autorizzato di AFS dare il seguente comando:  
 +  fs sa -dir /afs/lnf.infn.it/system/lnflocal/amd64_linux26/lsf/ -acl lsf.alice rwlidwk
 +
 +Quindi, con il token di lsf.alice, copiare i file installati localmente su AFS
 +  cd ..
 +  cp -R alice /afs/lnf.infn.it/system/lnflocal/amd64_linux26/lsf/
 +  
 +Cancellare la directory /usr/lnf
 +  cd /usr
 +  rm  -rf lnf
 +  
 +Creare un link:
 +  ln -s /afs/lnf.infn.it/system/lnflocal/@sys lnf
 +  
 +Spostare i binary a un livello superiore del tree e creare il corrispondente link (sono indipendenti dal cluster)
 +  cd /usr/lnf/lsf/alice
 +  mv 8.0 ../
 +  ln -s ../8.0 8.0
 +
 +  * Nota: se non e' la prima installazione di LSF ai LNF, la directory con i binari esiste gia', quindi sostituire il precedente comando mv con
 +
 +  rm -rf 8.0  
 +
 +Modificare il file "conf/lsf.conf":
 +
 +  # This file is produced automatically by lsfconfig according to
 +  # installation setup. Refer to the "Administration Platform LSF"
 +  # before changing any parameters in this file.
 +  # Any changes to the path names of LSF files must be reflected
 +  # in this file. Make these changes with caution.
 +  LSB_SHAREDIR=/usr/lnf/lsf/alice/work
 +  ###LSB_SHAREDIR=/st1vol1/calcolo/work
 +  # Configuration directories
 +  LSF_CONFDIR=/usr/lnf/lsf/alice/conf
 +  LSB_CONFDIR=/usr/lnf/lsf/alice/conf/lsbatch
 +  # Daemon log messages
 +  #LSF_LOGDIR=/usr/lnf/lsf/alice/log
 +  ###LSF_LOG_MASK=LOG_WARNING
 +  LSF_LOG_MASK=LOG_DEBUG
 +  # Batch mail message handling
 +  LSB_MAILTO=!U
 +  # Miscellaneous
 +  LSF_AUTH=eauth
 +  # General lsfinstall variables
 +  LSF_MANDIR=/usr/lnf/lsf/alice/8.0/man
 +  LSF_INCLUDEDIR=/usr/lnf/lsf/alice/8.0/include
 +  LSF_MISC=/usr/lnf/lsf/alice/8.0/misc
 +  XLSF_APPDIR=/usr/lnf/lsf/alice/8.0/misc
 +  LSF_ENVDIR=/usr/lnf/lsf/alice/conf
 +  # Internal variable to distinguish Default Install
 +  LSF_DEFAULT_INSTALL=y
 +  # Internal variable indicating operation mode
 +  LSB_MODE=batch
 +  # Other variables
 +  LSF_LIM_PORT=7869
 +  LSF_RES_PORT=6878
 +  LSB_MBD_PORT=6881
 +  LSB_SBD_PORT=6882
 +  LSF_DYNAMIC_HOST_WAIT_TIME=60
 +  # WARNING: Please do not delete/modify next line!!
 +  LSF_LINK_PATH=n
 +  # LSF_MACHDEP and LSF_INDEP are reserved to maintain
 +  # backward compatibility with legacy lsfsetup.
 +  # They are not used in the new lsfinstall.
 +  LSF_INDEP=/usr/lnf/lsf/alice
 +  LSF_MACHDEP=/usr/lnf/lsf/alice/8.0
 +  LSF_TOP=/usr/lnf/lsf/alice
 +  LSF_VERSION=8.0
 +  LSF_ENABLE_EGO=N
 +  # LSF_EGO_ENVDIR=/usr/lnf/lsf/alice/conf/ego/alice/kernel
 +  EGO_WORKDIR=/usr/lnf/lsf/alice/work/alice/ego
 +  LSF_LIVE_CONFDIR=/usr/lnf/lsf/alice/work/alice/live_confdir
 +  LSF_SERVER_HOSTS="alicn3 alicn2"
 +  LSF_MASTER_LIST="alicn2 alicn3"
 +  LSF_EGO_DAEMON_CONTROL=N
 +  #LSF_LICENSE_FILE=/usr/lnf/lsf/alice/conf/license.dat
 +  LSF_LICENSE_FILE=1700@flexserver-1.cr.cnaf.infn.it:1700@flexserver-2.cr.cnaf.infn.it:1700@flexserver-3.cr.cnaf.infn.it
 +  LSF_RSH="ssh -o 'PasswordAuthentication no' -o 'StrictHostKeyChecking no'"
 +  LSF_LSLOGIN_SSH=yes
 +
 +  * Nota: Occorre configurare il file di configurazione del logserver centrale (host logsrv, file: /usr/custom/syslog-ng/etc/syslog-ng.conf) al fine di raccoglere il log di lsf di tutti i nodi della farm 
 +
 +
 +Modificare conf/lsbatch/alice/configdir/lsb.params
 +
 +  Begin Parameters
 +  DEFAULT_QUEUE  = normal   #default job queue name
 +  MBD_SLEEP_TIME = 20       #Time used for calculating parameter values (60 secs is default)
 +  SBD_SLEEP_TIME = 15       #sbatchd scheduling interval (30 secs is default)
 +  JOB_ACCEPT_INTERVAL = 1   #interval for any host to accept a job 
 +                            # (default is 1 (one-fold of MBD_SLEEP_TIME))
 +  ENABLE_EVENT_STREAM = n   #disable streaming of lsbatch system events
 +  JOB_SPOOL_DIR = /tmp
 +  End Parameters
 +
 +Modificare conf/lsbatch/alice/configdir/lsb.hosts (alicn1 con 0 slot per i jobs, ovvero macchina che non esegue batch)
 +
 +  Begin Host
 +  HOST_NAME MXJ   r1m     pg    ls    tmp  DISPATCH_WINDOW  # Keywords
 +  #hostA     () 3.5/4.5   15/   12/15  0      ()    # Example
 +  #hostB        3.5    15/18  12/    0/  (5:19:00-1:8:30 20:00-8:30)
 +  #hostC        3.5/5   18    15     ()     ()    # Example
 +  #hostD        ()      ()    ()     ()     ()    # Example
 +  #hostE        ()      ()    ()     ()     ()    # Example
 +  #SPARCIPC  () 4.0/5.0   18    16     ()     ()             # Example
 +  alicn1        ()      ()    ()     ()     ()    # Example
 +  default    !    ()      ()    ()     ()     ()    # Example
 +  End Host
 +  
 +  # Host groups can be referenced by the queue file.  Each line defines a host
 +  # group.  The first line contains key words; each subsequent line contains a 
 +  # group name, followed by white space, followed by the list of group members.
 +  # The list of members should be enclosed in parentheses and separated by white 
 +  # space.  This section is optional.
 +  
 +  # This example is commented out
 +  Begin HostGroup
 +  GROUP_NAME    GROUP_MEMBER #GROUP_ADMIN # Key words
 +  #hgroup1      (hostA hostD ) #()          # Define a host group
 +  End HostGroup
 +
 + 
 +Creare le code in conf/lsbatch/alice/configdir/lsb.queues
 + 
 +
 +  Begin Queue
 +  QUEUE_NAME    = short
 +  PRIORITY      = 35
 +  NICE          = 20
 +  #RUN_WINDOW
 +  #FAIRSHARE     = USER_SHARES [[user1, 5000] [user2, 5000] [others, 1]]
 +  #r15s        = 0.7/2.3
 +  ###r1m        = 0.9/
 +  #r15m        = 0.4/2.0
 +  #pg        = 5/12
 +  #io        = 140/400
 +  ###CPULIMIT      = 15             # 15 minutes of the fastest host in the cluster
 +  CPULIMIT       = 60             # 60 minutes of the fastest host in the cluster
 +  #FILELIMIT     = 20000
 +  #DATALIMIT     = 20000          # jobs data segment limit
 +  #CORELIMIT     = 20000
 +  #PROCLIMIT    = 5              # job processor limit
 +  #USERS
 +  #HOSTS
 +  #ADMINISTRATORS
 +  #PRE_EXEC  
 +  #POST_EXEC 
 +  #EXCLUSIVE
 +  DESCRIPTION   = For short jobs that would not take much CPU time. \
 +  Scheduled with higher priority.
 +  End Queue
 +   
 +  Begin Queue
 +  QUEUE_NAME   = normal
 +  PRIORITY     = 30
 +  NICE         = 20
 +  #RUN_WINDOW   = 5:19:00-1:8:30 20:00-8:30
 +  #r1m      = 0.7/2.0        # loadSched/loadStop
 +  #r15m       = 1.0/2.5
 +  #pg       = 4.0/8
 +  #ut           = 0.2
 +  #io       = 50/240
 +  CPULIMIT     = 1440           # 24 hours 
 +  #CPULIMIT     = 180/hostA      # 3 hours of host hostA
 +  #FILELIMIT    = 20000
 +  #DATALIMIT    = 20000          # jobs data segment limit
 +  #CORELIMIT    = 20000
 +  #PROCLIMIT    = 5              # job processor limit
 +  #USERS        = all            # users who can submit jobs to this queue
 +  #HOSTS        = all            # hosts on which jobs in this queue can run
 +  #PRE_EXEC     = /usr/local/lsf/misc/testq_pre >> /tmp/pre.out
 +  #POST_EXEC    = /usr/local/lsf/misc/testq_post |grep -v "Hey"
 +  #REQUEUE_EXIT_VALUES = 55 34 78
 +  #APS_PRIORITY = WEIGHT[[RSRC, 10.0] [MEM, 20.0] [PROC, 2.5] [QPRIORITY, 2.0]] \  
 +  #    LIMIT[[RSRC, 3.5] [QPRIORITY, 5.5]] \ 
 +  #    GRACE_PERIOD[[QPRIORITY, 200s] [MEM, 10m] [PROC, 2h]]
 +  DESCRIPTION  = For normal low priority jobs, running only if hosts are \
 +  lightly loaded.
 +  End Queue
 +  
 +  Begin Queue
 +  QUEUE_NAME   = long
 +  PRIORITY     = 25
 +  NICE         = 20
 +  #RUN_WINDOW   = 5:19:00-1:8:30 20:00-8:30
 +  #r1m      = 0.7/2.0        # loadSched/loadStop
 +  #r15m       = 1.0/2.5
 +  #pg       = 4.0/8
 +  #ut           = 0.2
 +  #io       = 50/240
 +  CPULIMIT     = 10080           # 7 giorni
 +  #CPULIMIT     = 180/hostA      # 3 hours of host hostA
 +  #FILELIMIT    = 20000
 +  #DATALIMIT    = 20000          # jobs data segment limit
 +  #CORELIMIT    = 20000
 +  #PROCLIMIT    = 5              # job processor limit
 +  #USERS        = all            # users who can submit jobs to this queue
 +  #HOSTS        = all            # hosts on which jobs in this queue can run
 +  #PRE_EXEC     = /usr/local/lsf/misc/testq_pre >> /tmp/pre.out
 +  #POST_EXEC    = /usr/local/lsf/misc/testq_post |grep -v "Hey"
 +  #REQUEUE_EXIT_VALUES = 55 34 78
 +  #APS_PRIORITY = WEIGHT[[RSRC, 10.0] [MEM, 20.0] [PROC, 2.5] [QPRIORITY, 2.0]] \ 
 +  #    LIMIT[[RSRC, 3.5] [QPRIORITY, 5.5]] \ 
 +  #    GRACE_PERIOD[[QPRIORITY, 200s] [MEM, 10m] [PROC, 2h]]
 +  DESCRIPTION  = For long low priority jobs
 +  End Queue
 +  
 +  Begin Queue
 +  QUEUE_NAME   = idle
 +  PRIORITY     = 20
 +  NICE         = 20
 +  #RUN_WINDOW
 +  r15s      = 0.3/1.5
 +  r1m      = 0.3/1.5
 +  pg      = 4.0/15
 +  it      = 10/1
 +  #CPULIMIT
 +  #FILELIMIT   = 20000
 +  #DATALIMIT    = 20000          # jobs data segment limit
 +  #CORELIMIT    = 20000
 +  #PROCLIMIT    = 5
 +  #USERS
 +  #HOSTS
 +  #ADMINISTRATORS
 +  #EXCLUSIVE
 +  #PRE_EXEC  
 +  #POST_EXEC  
 +  #REQUEUE_EXIT_VALUES
 +  DESCRIPTION  = Running only if the machine is idle and very lightly loaded.
 +  End Queue
 +  
 +Da utente autorizzato di AFS dare i seguenti comandi:  
 +  find /usr/lnf/lsf -noleaf -type d -exec fs sa -dir {} -acl lsf.alice rl \;
 +  find /usr/lnf/lsf/alice/work -type d -noleaf -exec fs sa -dir {} -acl lsf.alice rwlidwk
 +
 +  * Nota: il primo e' un volume dedicato ai dati statici di LSF, unico per tutti i cluster dei LNF (accesso read-lookup).
 +Il secondo e' un volume a parte e ne va creato uno per ogni cluster (accesso anche in scrittura da parte dell'utente amministrativo di LSF specifico del cluster cui appartiene il volume)
 +  
 +Lanciare su tutti i nodi della farm il comando di configurazione hostsetup
 +  cd /usr/lnf/lsf
 +  ./farm "cd /usr/lnf/lsf/alice/8.0/install; ./hostsetup --top=\"/usr/lnf/lsf/alice\" --boot=\"y\""
 +
 +Impostare le variabile di environment nel profilo degli utenti, ad esempio creando il file temporaneo seguente (profile.upd)
 +
 +  #############################
 +  # Load LSF Parameters
 +  #
 +  . /usr/lnf/lsf/alice/conf/profile.lsf
 +
 +appenderlo al file /etc/profile di ogni macchina con il comando
 +
 +  cat profile.upd | ssh root@alicn* "cat >> /etc/profile"
 +
 +oppure (csh.login.upd)
 +
 +  #############################
 +  # Load LSF Parameters
 +  #
 +  source /usr/lnf/lsf/alice/conf/cshrc.lsf
 +
 +appenderlo al file /etc/csh.login di ogni macchina con il comando
 +
 +  cat csh.login.upd | ssh root@alicn* "cat >> /etc/csh.login"
 + 
 +Fare login come root sul nodo master (alicn2) e far partire lsf
 +  lsfstartup
 +
 +Per lo shutdown di lsf:
 +  lsfshutdown
 +  
 +Per testare che tutto funzioni (con lsf started):
 +  lsid
 +  lshosts
 +  bhosts
 +  bqueues
 +  
 +Per testare che i Job vadano in esecuzione, fare login come utente non privilegiato e posizionarsi du area NFS condivisa dalle macchine, quindi dare il seguente comando:
 +  bsub -o o.txt test.sh
 +
 +ove test.sh e' uno shell script di test, ad esempio:
 +  #!/bin/bash
 +  
 +  date
 +  sleep 10
 +  date
 +  env
 +
 +quindi verificare il contenuto di o.txt
 +
 +----
 +
 +
 +--- //[[Tomaso.Tonto@lnf.infn.it|Tomaso Tonto]] 2012/07/23 20:00//
 +
 +--- //[[Massimo.Pistoni@lnf.infn.it|Massimo Pistoni]] 2012/07/23 20:00//
 +
 +--- //[[Cristiano.Succi@lnf.infn.it|Cristiano Succi]] 2012/07/23 20:00//
 +
 +
 +
 +
  
strutture/lnf/dr/calcolo/scientifico/configurazione_lsf_8.txt · Last modified: 2012/10/19 12:53 by tonto@infn.it

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki