最近老师要求我们把机房的网格环境搭起来,方便更高效率进行科学计算的工作,由于我们要跑数据量非常之大,所以并行计算是必不可少的~~~
谈到网格,自然会想到Globus了,所以这些天花了一些时间学习了一下Globus Toolkit,并且在四台机器上做了一下实验,实现了基本的网格job schedule,个人感受是就是Globus Toolkit 的配置过程比较复杂,所以今天写一下Globus Toolkit 配置的详细过程(这篇所配置的是“从机”,“主机”配置流程在接下来的文章中介绍)。
Globus官方网站对Globus Toolkit是这样描述的:The Globus® Toolkit is an open source software toolkit used for building grids. It is being developed by the Globus Alliance and many others all over the world. A growing number of projects and companies are using the Globus Toolkit to unlock the potential of grids for their cause.
Wiki对Globus Toolkit的描述也很简单:The Globus Toolkit, currently at version 4, is an open source toolkit for building computing grids developed and provided by the Globus Alliance.
在配置Globus之前建议你先了解一下Globus的原理和具体框架流程,还有它遵循了哪些标准协议等基础知识,费话就不多说了~~~(以下代码区内是Ubuntu Shell下编辑的,其中有一些注释内容)
“从机“的配置过程:
1.Install Ubuntu(我使用的version是Karmic)
2. Connect to the network (把网络环境和karmic的源配置好,方便接下来所需要其它包的快速安装)
3. Create two users(建立两个账户,使用globus用户与主机建立连接;)
#adduser xsh
4. Install prerequisites tools (需要一些预装的软件包)
#export JAVA_HOME=/usr/lib/jvm/java-6-sun/
5. Install globus-4.2.0 (下载官网上Latest-stable的version即可,然后配置一下环境变量)
#cd gt4.2.1...-installer
#./configure
#make
#make install
#chown -R globus:globus /usr/local/globus-4.2.0/
#export GLOBUS_LOCATION=/usr/local/globus-4.2.0
Alternatively add GLOBUS_LOCATION to /etc/profile:
export GLOBUS_LOCATION=/usr/local/globus-4.2.0/
#source /etc/profile
6. Set up Security(配置Globus的授权认证)
#cp /usr/local/globus-4.2.0/etc/globus-user-env.sh /home/a.sh
Create host certificate for node33:
root@node1:~#myproxy-admin-addservice -c "nodo33" -l node33
root@node33:~#source /etc/profile
#source /home/a.sh
#myproxy-retrieve -s node1 -k node33 -l node33
Enter MyProxy pass phrase:222222
#cd /etc/grid-security/
#cp hostcert.pem containercert.pem
#cp hostkey.pem containerkey.pem
#chown globus:globus container*.pem
#ls -l *.pem
If node33 wants to REMOVE :
#myproxy-destroy -s node1 -k node33 -l node33
Create a grid-mapfile
#gedit grid-mapfile
"/O=Grid/OU=GlobusTest/OU=simpleCA-node1/CN=xsh" xsh
7. Set up GridFTP(建立GridFTP,Globus主要使用它进行结点间的通信)
service gsiftp
{
instances = 100
socket_type = stream
wait = no
user = root
env += GLOBUS_LOCATION=/usr/local/globus-4.2.0
env += LD_LIBRARY_PATH=/usr/local/globus-4.2.0/lib
server = /usr/local/globus-4.2.0/sbin/globus-gridftp-server
server_args = -i
log_on_success += DURATION
disable = no
}
#gedit /etc/services
# Local services
myproxy-server 7512/tcp # Myproxy server
gsiftp 2811/tcp
#/etc/init.d/xinetd reload
#netstat -an | grep 2811
tcp 0 0 0.0.0.0:2811 0.0.0.0:* LISTEN
Begin a test:
#su xsh
#source /etc/profile
#source /home/a.sh
#myproxy-logon -s node1
Enter MyProxy pass phrase: 222222
A credential has been received for user xsh in /tmp/x509up_u1001.
#globus-url-copy gsiftp://node33/etc/group gsiftp://node1/tmp/
8. Set up GRAM4(配置GRAM4,对Grid资源进行管理)
#gedit /etc/sudoers //add these lines below
globus ALL=(GLOBUSUSERS) NOPASSWD: /usr/local/globus-4.2.0/libexec/globus-gridmap-and-execute -g /etc/grid-security/grid-mapfile /usr/local/globus-4.2.0/libexec/globus-job-manager-script.pl *
globus ALL=(GLOBUSUSERS) NOPASSWD: /usr/local/globus-4.2.0/libexec/globus-gridmap-and-execute -g /etc/grid-security/grid-mapfile /usr/local/globus-4.2.0/libexec/globus-gram-local-proxy-tool *
#chmod -w /etc/sudoers
9. Set up Webservices (最后建立Web服务,这样主机就能调用本机了)
#source /home/a.sh
#cp /usr/local/globus-4.2.0/etc/init.d/globus-ws-java-container /etc/init.d/
#su globus
globus@node33:~$ /etc/init.d/globus-ws-java-container start
globus@node33:~$ /etc/init.d/globus-ws-java-container stop
globus@node33:~$ /etc/init.d/globus-ws-java-container restart
就些从机的所有配置完成,收功!
整个的配置过程我已经写很详细了,想得到更多的信息,还是去Globus的官网GT4.2 Quickstart中看吧,它才是权威啊~
主机的配置过程我会尽快写的
参考网站:
http://www.cnblogs.com/conanboa