SGE中将指定用户使用特定的队列

最近, 同事提出了一个新需求: 保留一些计算节点给研发专用。html

实现思路:

将计算节点放入到 主机组(host group)中, 在队列中指定所使用的主机组以及能够使用的用户, 来达到限定某些用户使用指定节点的目的shell

实现过程

  • 将Node-240从主机组 @allhosts 中取出

先将须要指定专门用户的主机 Node-240 从默认的 @allhosts 中主机组中取出来,这样,默认全部用户可用的队列 all.q 中就再也不使用 Node-240 节点。bash

原配置:操作系统

[admin@ master ~]$ qconf -shgrp @allhosts
group_name @allhosts
hostlist Node-243 Node-242 Node-241 Node-240

修改后:.net

[admin@ master ~]$ qconf -shgrp @allhosts
group_name @allhosts
hostlist Node-243 Node-242 Node-241
  • 增长新的 主机组,名为 @rdhosts , 组内仅含有一个主机 Node-240
[admin@ master ~]$ qconf -ahgrp @rdhosts
group_name @rdhosts
hostlist Node-240
  • 增长一个用户组(UserSet), rd, 组内成员为 @rd,san.zhang,test.rd,si.li
[admin@ master ~]$  qconf -au @rd,san.zhang,test.rd,si.li rd
added "@rd,san.zhang,test.rd,si.li" to access list "rd"

[admin@ master ~]$ qconf -su rd 
name    rd
type    ACL
fshare  0
oticket 0
entries @rd,san.zhang,test.rd,si.li

上述命令中, @rd,san.zhang,test.rd,si.li 为用户组中的用户,使用的是操做系统中的用户,带有 @ 的为系统中的用户组,最后一个参数 rd 为 UserSet 名称。详细参考: http://gridscheduler.sourceforge.net/htmlman/htmlman5/access_list.htmlcode

  • 配置使用主机组 @rdhosts 的队列, 并制定用户, 仅容许用户组 rd 使用该队列 , 添加队列的命令使用 ** qconf -aq rd.q ** , 添加完成后效果以下:
[admin@ master ~]$ qconf -sq rd.q
qname                 rd.q
hostlist              @rdhosts
seq_no                0
load_thresholds       np_load_avg=1.75
suspend_thresholds    NONE
nsuspend              1
suspend_interval      00:05:00
priority              0
min_cpu_interval      00:05:00
processors            UNDEFINED
qtype                 BATCH INTERACTIVE
ckpt_list             NONE
pe_list               make orte
rerun                 FALSE
slots                 1,[Node-240=47]
tmpdir                /tmp
shell                 /bin/bash
prolog                NONE
epilog                NONE
shell_start_mode      posix_compliant
starter_method        NONE
suspend_method        NONE
resume_method         NONE
terminate_method      NONE
notify                00:00:60
owner_list            NONE
user_lists            rd
xuser_lists           NONE
subordinate_list      NONE
complex_values        NONE
projects              NONE
xprojects             NONE
calendar              NONE
initial_state         default
s_rt                  INFINITY
h_rt                  INFINITY
s_cpu                 INFINITY
h_cpu                 INFINITY
s_fsize               INFINITY
h_fsize               INFINITY
s_data                INFINITY
h_data                INFINITY
s_stack               INFINITY
h_stack               INFINITY
s_core                INFINITY
h_core                INFINITY
s_rss                 INFINITY
h_rss                 INFINITY
s_vmem                INFINITY
h_vmem                INFINITY

须要特别注意修改的为:htm

hostlist              @rdhosts
slots                 1,[Node-240=47]
user_lists            rd

其余参数根据实际状况修改。队列

相关文章
相关标签/搜索