Admin how-to

From LHEP Wiki
Revision as of 09:49, 18 March 2015 by Lhep (talk | contribs) (1 revision imported)
Jump to navigation Jump to search

yum

- make sure to have a /etc/profile.d/proxy.sh with

  export http_proxy=http://proxy.unibe.ch:80

- make sure to have a line with the IP of the localhost in /etc/hosts

  example:
 127.0.0.1	localhost.localdomain localhost 
 ==> this one ==> 130.92.139.94   lheppc44.unibe.ch lheppc44  pc44

- "yum clean all" is a good first thing to do when getting stuck


copy large directories

- seen rsync not to work (runs and runs and runs and runs.... and does nothing...)

- example of "tar" use with "ssh":

 tar c -P -f - /terabig | ssh root@lheppc44 tar x -P 

- to sync with the files changed in the last 5h:

 tar c -P -f - `find /terabig -cmin -300` | ssh root@lheppc44 tar x -P

Ganglia

rpm -Uvh /terabig/atlsoft/slc4/ganglia-gmond-3.0.3-1.rhel4.x86_64.rpm


LDAP

- MAIN LDAP server lhepp44
- lheppc7 is replica server (using syncrepl)
- on both, ldap starts at boot time
- a backup of the DB in ~webermi
- to create a replica, add the following in /etc/openldap/slapd.conf:
  For the PROVIDER server:
  access to attr=userPassword
   by dn="uid=syncuser,dc=atlas-unibe,dc=ch" read   <== to add acces to passwords to user syncuser
  For the REPLICA server:
  # Sync the LDAP database with lheppc44
  syncrepl rid=001
       provider=ldap://lheppc44:389
       type=refreshOnly
       interval=01:00:00:00
       bindmethod=simple
       searchbase="dc=atlas-unibe,dc=ch"
       binddn="uid=syncuser,dc=atlas-unibe,dc=ch"
       credentials=******** (the secret password)

(Following is obsolete) Problem on booting (on pc50 ?) since 1/9/09 (slapd does not run as user ldap, but only as root...:

 - boot in single user mode
 - maybe needed: go to /var/lib/ldap and run 'db_recover -c -h /tmp/ldap'
 - maybe needed: copy /tmp/ldap/log.0000[something] to /var/lib/ldap'
 - start sldapd manually (i.e. execude slapd)
 - init 5


cfengine

server: lheppc10

- For a new machine for ATLAS:

 yum install cfengine
 yum install rapidsvn (if needed)
 svn co http://svn.lhep.unibe.ch/subv/atlas/cfengine/masterfiles/inputs /var/cfengine/inputs
 you may need to run cfkey
 cfagent -q
 [done]

- To force an update on all nodes, do a 'cfrun' on the cfengine server

- On the server, svn co http://svn.lhep.unibe.ch/subv/atlas/cfengine/masterfiles /var/cfengine/masterfiles,

 and start cfservd

Bonding of eth0 and eth1 to bond0 (example pc51)

 /etc/sysconfig/network-scripts/ifcfg-bond0
 TYPE=Ethernet
 DEVICE=bond0
 BOOTPROTO='static'
 IPADDR=130.92.139.151
 NETMASK=255.255.255.0
 GATEWAY=130.92.139.1
 NETWORK=130.92.139.0  
 BROADCAST=130.92.139.255
 ONBOOT=yes
 USERCTL=no
 NAME='Bonding device 0'
 STARTMODE='auto'
 IPV6INIT=no
 PEERDNS=yes
/etc/sysconfig/network-scripts/ifcfg-eth0
 TYPE=Ethernet
 DEVICE=eth0
 SLAVE=yes
 MASTER=bond0
 BOOTPROTO=none
 HWADDR=00:15:17:4C:6A:D8
 ONBOOT=yes
/etc/sysconfig/network-scripts/ifcfg-eth1
 TYPE=Ethernet
 DEVICE=eth1
 SLAVE=yes
 MASTER=bond0
 BOOTPROTO=none
 ONBOOT=yes
 /etc/modprobe.conf # Had to add the last line on 2009-05-22 to get the bounding work. 
 alias scsi_hostadapter usb-storage 
 alias scsi_hostadapter1 ahci
 alias eth0 e1000
 alias eth1 e1000
 alias scsi_hostadapter2 3w-9xxx
 alias usb-controller ehci-hcd
 alias usb-controller1 uhci-hcd
 alias bond0 bonding
 alias char-major-89 i2c-dev
 install bond0 /sbin/modprobe/ bonding -o bonding0 mode=1 miimon=100

How to create a new hotspare after drive failure

tw_cli maint createunit c0 rspare p6

where you must replace c0 with your controller and p6 with the port the drive is at


How to test network performance between nodes

Comment: the tool "netcat" or "nc" is used to create very simple network connections. On some system, the tool is named "nc", where on other sytsems it is "netcat". So replace where appropriate.

On the receiving host: enter: (you don't need to be root)

netcat -v -v -l -n -p 2222 > /dev/null

This opens the network port 2222, and discards everything that it receives (/dev/null)

On the sending host, type: (replace <IPoflisteninghost> with the IP address of the host above )

time yes | nc -v -v -n <IPoflisteninghost> 2222 >/dev/null

This sends thousands of "y"'s to the listening host.

After some time, you can abort (control-C) and you will seh how many bytes were sent. You can calculate the average speed by dividing by the time you let the test run.

Keep in mind that the sped s always limited by the slowest machine. So if you have set up network bonding, you should consider running severel servers at a tim eon the receiving host, and connecting from several machines: To test the full speed, I opened severel ports (2222, 2223, 2224) and sent from pc44, pc50, and lhepatsomething.