Configurando Nós novos

  • Antes de tudo e necessário incluir no /etc/hosts nos servidores e em um dos nós. Depois vamos colocar o ssh sem senha
[root@spgrid root]# ssh node82 'mkdir .ssh; chmod 600 .ssh'
ir para um node funcionando e copiar
[root@node12:root]# scp .ssh/authorized_keys node82:/root/.ssh/.
  • Colocar o dns para funcionar. No servidor rodar o script:
#!/bin/bash
for ((i=55; i<87; i++))
 do
ssh  192.168.1.$i "mv /etc/resolv.conf /etc/resolv.conf.old";
ssh   192.168.1.$i "echo domain grid| cat >>/etc/resolv.conf; echo nameserver 192.168.1.150| cat >>/etc/resolv.conf; echo nameserver 143.107.128.17| cat >>/etc/resolv.conf; echo nameserver 200.136.80.4| cat >>/etc/resolv.conf";
done;
  • Copiar o /etc/hosts de uma máquina modelo.
[root@sprace:root]# scp hosts node79:/etc/hosts
  • Mudando o /etc/sysconfig/network
#!/bin/bash
for ((i=56; i<57; i++))
 do
ssh  192.168.1.$i "mv /etc/sysconfig/network /etc/sysconfig/network.old"
ssh   192.168.1.$i 'UNAME=`uname -n`; echo NETWORKING=yes| cat >>/etc/sysconfig/network; echo HOSTNAME=${UNAME}| cat >>/etc/sysconfig/network; echo GATEWAY=192.168.1.150| cat>>/etc/sysconfig/network; echo NISDOMAIN=grid| cat >>/etc/sysconfig/network'
done;
  • Existiu um erro quanto ao teclado nao ser reconhecido durante o boot, para
isso tiramos o gpm e aproveitamos para por o sendmail na inicialização:
#!/bin/bash
for ((i=55; i<83; i++))
 do
ssh  192.168.1.$i "service gpm stop; chkconfig gpm off; chkconfig sendmail on"
done;
  • Configurar o /etc/sysconfig/network-scripts/ifcfg-eth1
#!/bin/bash
for ((i=55; i<83; i++))
 do
ssh  192.168.1.$i 'echo BROADCAST=192.168.1.255|cat >>/etc/sysconfig/network-scripts/ifcfg-eth1;echo IPADDR=192.168.1.'$i'| cat >>/etc/sysconfig/network-scripts/ifcfg-eth1 ;echo NETMASK=255.255.255.0| cat>>/etc/sysconfig/network-scripts/ifcfg-eth1; echo NETWORK=192.168.1.0| cat>>/etc/sysconfig/network-scripts/ifcfg-eth1'
done;
e agora eliminando a opção de dhcp:
#!/bin/bash
for ((i=55; i<83; i++))
 do
ssh  192.168.1.$i 'mv  /etc/sysconfig/network-scripts/ifcfg-eth1
/etc/sysconfig/net
work-scripts/ifcfg-eth1.bak; cat
/etc/sysconfig/network-scripts/ifcfg-eth1.bak| sed -e "/BOOTPROTO=dhc/d"> /etc/sysconfig/network-scripts/ifcfg-eth1; rm /etc/sysconfig/network-scripts/ifcfg-eth1.bak'
done;
  • Configurar o ntp enviando o arquivo ntp.conf
[root@sprace:mdias]# ls -al ntp.conf
   4 -rw-r--r--    1 root     root           66 Nov 13 22:37 ntp.conf
[root@sprace:mdias]# more ntp.conf
server 192.168.1.150
authenticate no
driftfile /var/lib/ntp/drift
para todos o nós (tem um delay normal):
for ((i=55; i<83; i++))
 do
scp /home/mdias/ntp.conf 192.168.1.$i:/etc/.;
ssh  192.168.1.$i "chkconfig ntpd on; service ntpd start"
done;

  • Configurando NIS. Primeiro vamos fazer um arquivo modelo (só mostrarei as linhas alteradas do original):
[root@sprace:mdias]# ls -al nsswitch.conf
   4 -rw-r--r--    1 root     root         1698 Nov 14 09:57 nsswitch.conf
[root@sprace:mdias]# more nsswitch.conf
passwd:     files nis
shadow:     files nis
group:      files nis
agora rodamos o script:
#!/bin/bash
for ((i=57; i<83; i++))
 do
scp /home/mdias/nsswitch.conf  192.168.1.$i:/etc/.;
ssh  192.168.1.$i "echo ypserver 192.168.1.150|cat >>/etc/yp.conf;chkconfig ypbind on; service ypbind start"
done;

  • Configurar /etc/fstab e /etc/mtab:
#!/bin/bash
for ((i=55; i<83; i++))
 do
ssh  192.168.1.$i 'echo storage:/raid0 /raid0 nfs rw,addr=192.168.1.100 0 0|cat >>/etc/mtab; echo spg00:/home /home nfs rw,addr=192.168
.1.150 0 0 |cat >>/etc/mtab ; echo spg00:/OSG /OSG nfs rw,addr=192.168.1.150 0 0 |cat >>/etc/mtab; echo "spg00:/home             /home
         nfs     defaults        1 2"|cat >>/etc/fstab;echo "spg00:/OSG         /OSG            nfs     defaults        1 2"| cat>>
 /etc/fstab;echo "storage:/raid0          /raid0          nfs     defaults
1 2"|cat >>/etc/fstab;mkdir /OSG; mkdir /raid0'
done;
  • Configurando o condor
#!/bin/bash
for ((i=71; i<83; i++))
 do
scp node12:/etc/init.d/condor 192.168.1.$i:/etc/init.d/.;
ssh  192.168.1.$i 'mkdir /usr/local/opt;ln -s /OSG /usr/local/opt/OSG;mkdir
/scratch/condor; chown condor:condor /scratch /scratch/condor; mount /OSG; ln
-s /usr/local/opt/OSG/condor/etc/condor_config /scratch/condor/condor_config; cd /scratch/condor; touch condor_config.local; mkdir execute log spool;chown condor:condor condor_config.local execute log spool;ln -s /etc/init.d/condor /etc/rc.d/rc0.d/K99condor;ln -s /etc/init.d/condor /etc/rc.d/rc1.d/K99condor;ln -s /etc/init.d/condor /etc/rc.d/rc2.d/S90condor;ln -s /etc/init.d/condor /etc/rc.d/rc3.d/S90condor;ln -s /etc/init.d/condor /etc/rc.d/rc4.d/S90condor;ln -s /etc/init.d/condor  /etc/rc.d/rc5.d/S90condor;ln -s /etc/init.d/condor /etc/rc.d/rc6.d/K99condor;/etc/init.d/condor start';
done;

  • Configurar o gmond. Primeiramente tivemos problemas quanto a configuração do Multicast no switch, que não estava habilidato. Resolvido este entrave,
com o pacote rpm em mãos e criando o seguinte gmond.conf
name "SPGRID Cluster"
owner "SPRACE-HEP"
url "http://spgrid.if.usp.br/"
num_nodes  86
setuid ganglia
mcast_if eth1
e agora iremos utilizar o seguinte script para ter o Physical view correto de 55<->70
#!/bin/bash
RACK=4; RANK=0
for ((i=55; i<71; i++))
 do
scp   ganglia-monitor-core-gmond-2.5.4-8.i386.rpm 192.168.1.$i:/root/.;
scp gmond.conf 192.168.1.$i:/etc/.;
ssh 192.168.1.$i 'echo location \"'$RACK','$RANK',0\"| cat >>
/etc/gmond.conf';
let "RANK += 1";
ssh 192.168.1.$i 'groupadd -g 104 ganglia;useradd -d /var/lib/ganglia -s /bin/false -g ganglia -u 107 ganglia ;rpm -ivh /root/ganglia-monitor-core-gmond-2.5.4-8.i386.rpm; rm /root/ganglia-monitor-core-gmond-2.5.4-8.i386.rpm';
done;
e outro para o 71<->86, mudando a variável RACK=5.
Topic revision: r1 - 2006-11-23 - MarcoAndreFerreiraDias
 

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback

antalya escort bursa escort eskisehir escort istanbul escort izmir escort