source: drbl-biocluster/drbl-torque.sh @ 157

Last change on this file since 157 was 104, checked in by jazz, 15 years ago
  • 把 torque 在 DRBL Server 上的安裝步驟變成標準化程序
  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/bash
2
3########
4# 安裝 openPBS / torque
5########
6if [ ! -e torque-2.3.6.tar.gz ]; then
7  wget wget http://www.clusterresources.com/downloads/torque/torque-2.3.6.tar.gz
8  tar zxvf torque-2.3.6.tar.gz
9  cd torque-2.3.6/
10  ./configure
11  sudo make
12  sudo make install
13  # to make sure libtorque.so.2 is updated
14  # or there will be an error message:
15  #
16  # pbs_mom: error while loading shared libraries: libtorque.so.2: cannot open shared object file:
17  #          No such file or directory
18  #
19  sudo ldconfig
20  # create init.d scripts for torque
21  sudo cp contrib/init.d/debian.pbs_mom    /etc/init.d/pbs_mom
22  sudo cp contrib/init.d/debian.pbs_sched  /etc/init.d/pbs_sched
23  sudo cp contrib/init.d/debian.pbs_server /etc/init.d/pbs_server
24fi
25
26sudo cat /etc/dhcp3/dhcpd.conf | grep "host .* {" | awk '{ print $2 }' > nodes
27sudo mv nodes /var/spool/torque/server_priv/nodes
28sudo pbs_server -t create
29cat > torque_conf << EOF
30create queue batch
31set queue batch queue_type = Execution
32set queue batch started = True
33set queue batch enabled = True
34set server default_queue = batch
35set server resources_default.nodes = 1
36set server scheduling = True
37EOF
38sudo qmgr < torque_conf
39cat >> config << EOF
40\$pbsserver    $(hostname)
41\$logevent     255
42EOF
43sudo mv config /var/spool/torque/mom_priv/jobs/config
44sudo qterm -t quick
45sudo /opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf
46sudo /opt/drbl/sbin/drbl-cp-host /var/spool/torque/server_priv/nodes /var/spool/torque/server_priv/nodes
47sudo /opt/drbl/sbin/drbl-cp-host /var/spool/torque/mom_priv/jobs/config /var/spool/torque/mom_priv/jobs/config
48sudo /opt/drbl/sbin/drbl-cp-host /var/spool/torque/pbs_environment /var/spool/torque/pbs_environment
49# enable pbs_mom service for DRBL Clients
50sudo /opt/drbl/sbin/drbl-client-service pbs_mom on
51# enable pbs_sched and pbs_server services for DRBL Server
52sudo update-rc.d pbs_sched defaults
53sudo update-rc.d pbs_server defaults
Note: See TracBrowser for help on using the repository browser.