Torque + Maui配置手册之抛砖引玉篇

Torque + Maui配置手册之抛砖引玉篇

    本文将以应用于实际案例(南航理学院、复旦大学物理系、宁波气象局)中的作业调度系统为例,简单介绍一下免费开源又好用的Torque+Maui如何在曙光服务器上进行安装和配置,以及针对用户特定需求的常用调度策略的设定情况,以便可以起到抛砖引玉的作用,使更多的人关注MAUI这个功能强大的集群调度器(后期将推出SGE+MAUI版本)。本文中的涉及的软件版本Torque 版本: 2.1.7  maui版本:3.2.6p17。

1.    集群资源管理器Torque

1.1.   从源代码安装Torque

其中pbs_server安装在node33上,TORQUE有两个主要的可执行文件,一个是主节点上的pbs_server,一个是计算节点上的pbs_mom,机群中每一个计算节点(node1~node16)都有一个pbs_mom负责与pbs_server通信,告诉pbs_server该节点上的可用资源数以及作业的状态。机群的NFS共享存储位置为/home,所有用户目录都在该目录下。

1.1.1.     解压源文件包

在共享目录下解压缩torque

# tar -zxftorque-2.1.17.tar.gz

假设解压的文件夹名字为: /home/dawning/torque-2.1.7

1.1.2.     编译设置

#./configure  --enable-docs --with-scp --enable-syslog

其中,

默认情况下,TORQUE将可执行文件安装在/usr/local/bin和/usr/local/sbin下。其余的配置文件将安装在/var/spool/torque下

默认情况下,TORQUE不安装管理员手册,这里指定要安装。

默认情况下,TORQUE使用rcp来copy数据文件,官方强烈推荐使用scp,所以这里设定--with-scp.

默认情况下,TORQUE不允许使用syslog,我们这里使用syslog。

1.1.3.     编译安装

# make

# make install

 

Server端安装设置:

在torque的安装源文件根目录中,执行

#./torque.setup root

以root作为torque的管理员账号创建作业队列。

 

计算节点(Client端)的安装:

由于计算节点节点系统相同,因而可以用如下SHELL script (脚本名字为torque.install.sh)在其余计算节点上安装:

创建torque.install.sh脚本

#vi torque.install.sh

#!/bin/sh

cd /home/dawning/torque-2.1.7

make install

使用如下命令:npssh -onnode1..32  sh/home/dawning/torque.install.sh  将在每个节点上安装TORQUE。

 

1.1.4.      TORQUE配置

1.1.4.1 在计算节点上配置TORQUE:

在每个计算节点,必须配置MOMdaemon信任pbs_serverdaemon,可以通过编辑/var/spool/torque/server_name来实现,把node33写入该文件即可。

#cat /var/spool/torque/server_name

node33

其余的配置参数写入/var/spool/torque/mom_priv/config文件。

 

配置计算节点的数据管理,数据管理允许作业的数据在计算节点和PBS_Server之间传递。对于共享文件系统,如NFS,可以通过在mom_priv/config中用$usecp参数来指定如何映射用户的根目录。

$usecp *:/home /home

 

这里集群的mom_priv/config内容如下:

# MOM server configuration file

# if more than one value, separate

## rule is defined by the name

 

## host allowed to connect to mom server onprivileged port

# note: IP address of host runningpbs_server it by comma.

$pbsserver      10.0.68.33

$clienthost      node33

#ideal processor load and max processorload

$ideal_load 7

$max_load 8

## host allowed to connect to Mom server onunprivileged port

#Specifies hosts which can be trusted toaccess mom services as non-root.

#By default, no hosts are trusted to accessmom services as non-root.

$restricted *.node33

## Log event :

# 0x1ff : log all events + debug events

# 0x0ff : just all events

$logevent 0x0ff

## alarm if the script hang or take verylong time to execute

$prologalarm 30

## Specifies which directories should bestaged

$usecp *:/home /home

 

Server端资源管理配置

指定计算节点

为了让pbs_server与每个计算节点进行通信,它需要知道要和那些机器联络,集群中的每个计算节点都必须在nodes文件中指定,一个1行。

#rsh node33

#cd/var/spool/torque/server_priv

#for i in `seq 1 32`;do echo node$inp=2;done > nodes

#catnodes

node1 np=8

node2 np=8

node3 np=8

node4 np=8

node5 np=8

node6 np=8

node7 np=8

node8 np=8

node9 np=8

node10 np=8

node11 np=8

node12 np=8

node13 np=8

node14 np=8

node15 np=8

node16 np=8

node17 np=8

node18 np=8

node19 np=8

node20 np=8

node21 np=8

node22 np=8

node23 np=8

node24 np=8

node25 np=8

node26 np=8

node27 np=8

node28 np=8

node29 np=8

node30 np=8

node31 np=8

node32 np=8

np=8是说每个节点有8个CPU(其余的以线程来跑)。

 

指定作业的提交节点为node33,node34,node35:

[root@node33 ~]# qmgr-c 'set server submit_hosts = node33'

[root@node33 ~]# qmgr-c 'set server submit_hosts += node34'

[root@node33 ~]# qmgr-c 'set server submit_hosts += node35'

 

1.1.5.     系统自动启动脚本

1.        Server的系统启动脚本/etc/init.d/pbs_server

该脚本单独启动/重新启动/暂停/查看状态TORQUE中Server的守护进程

#cp contrib/init.d/pbs_server /etc/init.d/

编辑pbs_server:

#vi /etc/init.d/pbs_server

PBS_DAEMON=/usr/local/sbin/pbs_server

PBS_HOME=/var/spool/torque

要确保这两个变量设定正确。

 

2.        Mom系统启动脚本/etc/init.d/pbs_mom,在计算节点执行。

该脚本单独启动/重新启动/暂停/查看状态TORQUE中Mom的守护进程。

#cp contrib/init.d/pbs_mom /etc/init.d/

#vi /etc/init.d/pbs_mom

PBS_DAEMON=/usr/local/sbin/pbs_mom

PBS_HOME=/var/spool/torque

 

PBS_SERVER端测试:

重启pbs_server,使刚才的配置生效。

>/etc/init.d/pbs_server restart

# verify allqueues are properly configured

> qstat -q

# viewadditional server configuration

> qmgr -c 'p s'

# verify allnodes are correctly reporting

>pbsnodes -a

# submit a basicjob - DO NOT RUN AS ROOT

> su -testuser

>qstat

 

2.   调度器系统MAUI的安装配置

2.1.1.      在共享目录下解压缩MAUI

# tar -zxf maui-3.2.6p17.tar.gz

假设解压的文件夹名字为: /home/dawning/maui-3.2.6p17

 

2.1.2.      编译

要是MAUI和TORQUE无缝的结合在一起,确保管理节点(PBS SERVER)上TORQUE的路径设置正确,

#./configure --with-pbs=/usr/local

#make

#make install

 

2.1.3.      MAUI自启动脚本

[root@node33maui-3.2.6p17]# cp etc/maui.d /etc/init.d/

[root@node33maui-3.2.6p17]# vi /etc/init.d/maui.d

#!/bin/sh

#

# maui  Thisscript will start and stop the MAUI Scheduler

#

# chkconfig: 345 85 85

# description: maui

#

ulimit -n 32768

# Source the library functions

. /etc/rc.d/init.d/functions

 

MAUI_PREFIX=/usr/local/maui

 

# let see how we were called

case "$1" in

        start)

               echo -n "Starting MAUI Scheduler: "

               daemon $MAUI_PREFIX/sbin/maui

               echo

               ;;

        stop)

               echo -n "Shutting down MAUI Scheduler: "

               killproc maui

               echo

               ;;

        status)

               status maui

               ;;

       restart)

               $0 stop

               $0 start

               ;;

        *)

               echo "Usage: maui {start|stop|restart|status}"

                exit 1

esac

 

 

2.1.4.      与MAUI结合的node33上TORQUE设置

在TORQUE的qmgr上

[root@node33maui-3.2.6p18]# qmgr

Max openservers: 4

Qmgr: set server managers += root@*.node33

Qmgr: set server operators += root@*.node33

Qmgr: set server scheduling=True

Qmgr: quit

要确保set server scheduling=True这条,这条语句确保了可以使用MAUI调度。

 

其它设置:

TORQUE默认作业的最大运行时间为3600s(1个小时),需要根据实际情况进行修改:设定作业运行所需时间资源不超过7天:

qmgr -c "set queue batchresources_default.walltime=604800"

qmgr –c “set server query_other_jobs=TRUE”

确保每个非管理员帐户可以查看其它帐户的作业信息。

 

2.1.5.      MAUI配置文件

[root@node33  ~]vi /usr/local/maui/maui.cfg

 

# maui.cfg3.2.6p17

#edited by dolphin=============

#SERVERHOST           node33

SCHEDCFG[0] SERVER=node33:42559 MODE=NORMAL

#================end============================

 

# primary adminmust be first in list

ADMIN1                root

 

# ResourceManager Definition

 

#======edited by dolphin

#RMCFG[NODE33] TYPE=PBS@RMNMHOST@

RMCFG[0] TYPE=PBS HOST=node33

#==================end==========================

 

# AllocationManager Definition

 

AMCFG[bank]  TYPE=NONE

 

# full parameterdocs at http://supercluster.org/mauidocs/a.fparameters.html

# use the'schedctl -l' command to display current configuration

 

RMPOLLINTERVAL        00:00:30

 

SERVERPORT            42559

SERVERMODE            NORMAL

 

# Admin:http://supercluster.org/mauidocs/a.esecurity.html

 

 

LOGFILE               maui.log

LOGFILEMAXSIZE        10000000

LOGLEVEL              3

 

# Job Priority:http://supercluster.org/mauidocs/5.1jobprioritization.html

 

QUEUETIMEWEIGHT       1

 

# FairShare: http://supercluster.org/mauidocs/6.3fairshare.html

 

#FSPOLICY              PSDEDICATED

#FSDEPTH               7

#FSINTERVAL            86400

#FSDECAY               0.80

 

# ThrottlingPolicies: http://supercluster.org/mauidocs/6.2throttlingpolicies.html

 

# NONE SPECIFIED

# Add by dolphin =======================================

#JOBNODEMATCHPOLICY EXACTNODE

#NODEACCESSPOLICY SINGLEUSER

JOBNODEMATCHPOLICY   EXACTNODE

NODEACCESSPOLICY     SHARED

#NODECFG[DEFAULT] PRIORITYF='-JOBCOUNT'

ENABLEMUITINODEJOBS     TRUE

ENABLEMULTIREQJOBS     TRUE

# ended ================================================

 

# Backfill:http://supercluster.org/mauidocs/8.2backfill.html

 

BACKFILLPOLICY        FIRSTFIT

RESERVATIONPOLICY     CURRENTHIGHEST

 

# NodeAllocation: http://supercluster.org/mauidocs/5.2nodeallocation.html

 

# Add by dolphin =======================================

NODEALLOCATIONPOLICY FIRSTAVAILABLE

#NODEALLOCATIONPOLICY   PRIORITY

# ended ================================================

#NODEALLOCATIONPOLICY  MINRESOURCE

 

# QOS:http://supercluster.org/mauidocs/7.3qos.html

 

#QOSCFG[hi]  PRIORITY=100 XFTARGET=100FLAGS=PREEMPTOR:IGNMAXJOB

# QOSCFG[low]PRIORITY=-1000 FLAGS=PREEMPTEE

 

# StandingReservations: http://supercluster.org/mauidocs/7.1.3standingreservations.html

 

#SRSTARTTIME[test] 8:00:00

#SRENDTIME[test]   17:00:00

#SRDAYS[test]      MON TUE WED THU FRI

#SRTASKCOUNT[test] 20

#SRMAXTIME[test]   0:30:00

 

# Creds: http://supercluster.org/mauidocs/6.1fairnessoverview.html

 

    USERCFG[DEFAULT]      MAXJOB=2 MAXNODE=3

    USERCFG[nano]      MAXJOB=64 MAXNODE=16

##这里指定默认的每个帐户最大可以运行2job,每个job所申请的节点总数不能超##3个。而nano帐户在另外做限制,可以用16个节点,最大可以运行64个作业。

 

#USERCFG[DEFAULT]      FSTARGET=25.0

#USERCFG[john]         PRIORITY=100  FSTARGET=10.0-

#GROUPCFG[staff]       PRIORITY=1000QLIST=hi:low QDEF=hi

#CLASSCFG[batch]       FLAGS=PREEMPTEE

#CLASSCFG[interactive] FLAGS=PREEMPTOR

 

红色标记出来的是需要修改并已经修改过的地方,关于MAUI各个配置参数的意义,请查看

http://www.clusterresources.com/products/maui/docs/a.fparameters.shtml

好了,至此,你可以把MAUI服务起来了。/etc/init.d/maui.dstart

 

然后提交作业echo “sleep 2” | qsub 查看是不是正常。

    注意事项:TORQUE的pbs_sched不要启动,因为我们要使用MAUI作为调度器。

 

 

 

关于TORQUE更详细的信息,请参考:

http://www.clusterresources.com/torquedocs21/

和 

http://www.clusterresources.com/wiki/doku.php?id=torque:appendix:l_torque_quickstart_guide

 

关于MAUI更详细的信息请参考:

http://www.clusterresources.com/products/maui/docs/mauiusers.shtml 以及

http://www.clusterresources.com/products/maui/docs/mauiadmin.shtml

http://www.dcsc.sdu.dk/docs/maui/mauidocs.html

 

关于MAUI和TORQUE的集成,请参考:

http://www.clusterresources.com/products/maui/docs/pbsintegration.shtml

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值