http://blog.sciencenet.cn/blog-588243-482121.html
常见问题和命令
永久关闭防火墙: rocks run host n "chkconfig iptables off"
增加环境变量: 全局变量 加入到 /etc/profile
当前用户变量加入到 ~/.bashrc
3. 设置系统时间
设置系统时间
date -s 20071215
date -s 15:35
如果要同时更改BIOS时间
在执行 clock -w
所有节点安装完成后:
2. Ssh 其他节点时:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
修改 /etc/ssh/ssh_config 文件,在最后加入 ForwardX11Trusted yes (加入各个节点,并将 头结点的密 scp cghpc:/root/.ssh/* /root/.ssh/ 拷过来) 然后退出
执行 rocks sync config
4.节点重新安装
如果集群中的节点机需要重新安装,可以在这个节点机上运行:
/boot/kickstart/cluster-kickstart
来重装系统。或者可以在Frontend节点机上运行:
rocks run host '/boot/kickstart/cluster-kickstart'
来重新安装所有的compute节点机。
如果想重装集群中所有的compute节点机,并在重装完以后让这些节点机继续执行由于重装而中断的计算任务,可以通过SGE控制来实现,运行:
/opt/gridengine/examples/jobs/sge-reinstall.sh
5. How do I remove a compute node from the cluster?
On your frontend end, execute:
# rocks remove host "[your compute node name]"
For example, if the compute node’s name is compute-0-1, you’d execute
# rocks remove host compute-0-1
# rocks sync config
The compute node has been removed from the cluster.
6. How do I export a new directory from the frontend to all the compute nodes that is accessible under /home?
Execute this procedure:
• Add the directory you want to export to the file /etc/exports.
For example, if you want to export the directory /export/disk1, add the following to /etc/exports:
/export/disk1 10.0.0.0/255.0.0.0(rw)
• Restart NFS:
# /etc/rc.d/init.d/nfs restart
• Add an entry to /etc/auto.home.
For example, say you want /export/disk1 on the frontend machine (named frontend-0) to be mounted as
/home/scratch on each compute node.
Add the following entry to /etc/auto.home:
scratch frontend-0:/export/disk1
• Inform 411 of the change:
make -C /var/411
Now when you login to any compute node and change your directory to /home/scratch, it will be automounted.
7. 注意:在每次运行完rocks的一些命令修改了数据库配置信息后,比如删除compute节点机,都要再运行: rocks sync config
来将更新后的数据库信息写入到节点机的系统配置文件中,否则在运行其他管理命令时会遇到一些莫名的错误。
VASP 任务提交
1) (周健)名称: vasp.sh
#!/bin/bash
#
#$ -cwd
#$ -j y
#$ -S /bin/bash
mpirun -r ssh -f $TMPDIR/machines -n $NSLOTS /home/software/vasp/vasp
蓝色部分每个作业脚本必写。
Entries which start with #$ will be treated as SGE options.
• -cwd means to execute the job for the current working directory.
• -j y means to merge the standard error stream into the standard output stream instead of having two separate error and output streams.
• -S /bin/bash specifies the interpreting shell for this job to be the Bash shell.
-np $NSLOTS 表明使用多少个处理器核心进行计算,后面跟着计算软件路径。
提交时: qsub -pe mpich 4 vasp.sh
2)
#!/bin/bash
#
#$ -cwd
#$ -j y
#$ -S /bin/bash
#$ -pe mpich 16
(可加 expor=$PATH:路径)
mpirun -r ssh -f $TMPDIR/machines -n $NSLOTS /home/software/vasp/vasp
(MPI_DIR=/opt/mpich/gnu
$MPI_DIR/bin/mpirun -np $NSLOTS -machinefile $TMP/machines ./cpi
)
蓝色部分每个作业脚本必写。
#$ -pe mpich 16 指定脚本的并行环境为mpich,同时申请了16个处理器核心来进行运算。其它
根据各个应用程序不同做相应更改。
提交时: qsub vasp.sh (或 ./vasp.sh)
4)执行 qstat 查看作业执行状态
说明,作业执行状态 qw 作业处于等待状态,r 运行状态。Slots 显示的是当前作业时
几个处理器核心在运算。
三.软件安装
修改组名: group -n 新组名 旧组名
修改用户属组: usermod -g 组名 用户名
Usermod -l 新用户名 旧用户名
Usermod -d 登录目录 用户名
Userdel -r 用户名
Groupadd cluster
1. 添加用户
(当不存在 cluster组时)
Adduser -g root mu
Adduser -g root soft
Passwd mu
Rocks sync users
make -C /var/411/ force
Rocks sync config
默认情况下,新建用户mu建立/export/home/mu目录,此目录是被其他计算节点共享的,对应/home/mu (包括头节点,软件可装在/export/home/mu/soft/下)。
2) Root下建立用户 softe useradd soft
3) Root下删除其密码 passwd -d soft
Chmod a+rwx /export/home/soft
同步账户 rocks sync users
发布密码的信息 make -C /var/411 force
2) 使用XFTP 将程序考到soft 下
使用root用户copy /export/home/soft/src 下
然后更改属主 chown -v soft:soft 文件名或目录
(用户名:用户组)
3) rocks run host compute-0-0 command="hostname"
rocks run host n "reboot"
Run the command ’ls /tmp/’ on all n nodes.