隨筆-49  評論-67  文章-27  trackbacks-0

          1 安裝GT 4.0

          1.用root用戶登錄并創(chuàng)建“globus”的用戶,通過運(yùn)行下面的命令為該用戶建立目錄并賦予globus用戶對其目錄的所有權(quán)限:

          root#[1] mkdir /usr/local/globus-4.0.1

          root# chown globus:globus /user/local/globus-4.0.1

          2.下載附錄 軟件先決條件里面的軟件。

          注:正確設(shè)置JAVA_HOME環(huán)境變量,在/etc/profile里面加入

          export JAVA_HOME=/usr/local/jdk1.5.0_04

          同時(shí)在/etc/ant.conf文件里面只需要加入

          ANT_HOME=/usr/local/ant-1.6.5

          3.最為globus用戶登錄,運(yùn)行命令:

          globus$ export GLOBUS_LOCATION=/user/local/globus-4.0.1

          globus$ ./configure –prefix=$GLOBUS_LOCATION

          同時(shí)可以使用./configure –help獲得更多幫助信息。

          注:為了方便執(zhí)行,可以將上面第一個(gè)語句加入到/etc/profile文件里面,或者加入到用戶自己HOME目錄下的.bashrc文件中。

          4.執(zhí)行命令:

          globus$ make

          也可以用下面的命令對安裝過程進(jìn)行日志記錄:

          globus$ make 2>&1 | tee build.log

          5.最后運(yùn)行:

          globus$ make install

          來完成安裝。

          2 安全配置

                 標(biāo)準(zhǔn)的安裝文檔的結(jié)構(gòu)設(shè)置存在問題,如果按照它的順序無法完整安裝。這里我們對結(jié)構(gòu)進(jìn)行了調(diào)整。這部分包含了標(biāo)準(zhǔn)安裝文檔的567章的內(nèi)容。

          2.1 設(shè)置環(huán)境變量

          1.  作為globus登錄,設(shè)置GLOBUS_LOCATION指向Globus Toolkit的安裝路徑:

          globus$ export GLOBUS_LOCATION=/usr/local/globus-4.0.1

          注:如果上面你以及在/etc/profile里面進(jìn)行了設(shè)置,這里就不需要再執(zhí)行這一步驟。

          2.  執(zhí)行$GLOBUS_LOCATION/ect/gobus-user-env.sh(我們這里使用的是BShell。如使用的是C Shell,需要執(zhí)行后綴是csh的文件)。

          globus$ . $GLOBUS_LOCATION/ect/globus-user-env.sh

          注:在點(diǎn)“.”和$GLOBUS_LOCATION/ect/globus-user-env.sh之間有一個(gè)空格。

          2.2 得到主機(jī)證書(host certificates

          為了運(yùn)行GT 4.0,必須為主機(jī)分配證書。其中:

          l         證書必須包含兩個(gè)文件:hostcert.pemhostkey.pem

          l         同時(shí),這兩個(gè)文件必須放在正確的目錄下:/etc/grid-security/

          l         主機(jī)在DNS上必須具有一個(gè)固定的域名,不可以運(yùn)行在使用了DHCP服務(wù)的服務(wù)器上。

          為此,可以選擇:

          l           從一個(gè)以及存在的CA處申請一個(gè)證書。

          l           安裝SimpleCA,并使之為我們分配證書。

          l           使用globus提供的low-trust證書。

          這里,我們選擇一個(gè)比較容易實(shí)現(xiàn)的方法,就是安裝SimpleCA。在下面一節(jié)里面我們將介紹如何安裝和配置SimpleCA

          2.3 安裝和配置SimpleCA

          1.創(chuàng)建用戶

                 保證系統(tǒng)中存在這樣的用戶:

          l           普通的用戶賬號,用來執(zhí)行客戶端的程序。

          l           一個(gè)globus賬號,用來執(zhí)行管理的任務(wù)。如啟動(dòng)、停止容器,部署服務(wù)等。同時(shí),這個(gè)用戶還負(fù)責(zé)管理SimpleCA。為此,需要保證該用戶對$GLOBUS_LOCATION目錄有讀寫權(quán)限。在第1章中我們以及創(chuàng)建了這樣一個(gè)用戶。

          2.運(yùn)行安裝腳本

                 對每個(gè)網(wǎng)格,只需運(yùn)行一次下面的腳本即可。

          globus$ GLOBUS_LOCATION/setup/globus/setup-simple-ca

          在此過程中,程序會(huì)提醒你關(guān)于你想創(chuàng)建的CA的信息,如:

          The unique subject name for this CA is:

          cn=Globus Simple CA, ou=simpleCA-mci.uestc.edu.cn, ou=GlobusTest, o=Grid

          Do you want to keep this as the CA subject (y/n) [y]:

          推薦默認(rèn)選項(xiàng),按y繼續(xù)。接下來,會(huì)提示你輸入用來發(fā)送證書的email地址:

          Enter the email of the CA (this is the email where certificate requests will be sent to be signed by the CA):

          這時(shí),系統(tǒng)提示你輸入證書過期的時(shí)間。默認(rèn)是5年,接受即可。

          The CA certificate has an expiration date. Keep in mind that                 once the CA certificate has expired, all the certificates                 signed by that CA become invalid.  A CA should regenerate                 the CA certificate and start re-issuing ca-setup packages                 before the actual CA certificate expires.  This can be done                 by re-running this setup script.  Enter the number of DAYS                 the CA certificate should last before it expires.

          [default: 5 years (1825 days)]:

          緊接著,系統(tǒng)提示輸入生成密鑰的短語。這里可以隨意輸入,但是不允許包括空格。同時(shí)一定要記住,因?yàn)榻酉聛磉€要使用這個(gè)短語。

          Generating a 1024 bit RSA private key

                          ........++++++

                          ................++++++

                          writing new private key to '/home/globus/.globus/simpleCA//private/cakey.pem'

                          Enter PEM pass phrase:

          最后,你會(huì)看見下面的提示:

          A self-signed certificate has been generated for the Certificate Authority with the subject:                            /O=Grid/OU=GlobusTest/OU=simpleCA-mayed.mcs.anl.gov/CN=Globus Simple CA

          If this is invalid, rerun this script

          setup/globus/setup-simple-ca

          and enter the appropriate fields.

          ------------------------------------------------------------------

          The private key of the CA is stored in /home/globus/.globus/simpleCA//private/cakey.pem

          The public CA certificate is stored in /home/globus/.globus/simpleCA//cacert.pem

          The distribution package built for this CA is stored in

          /home/globus/.globus/simpleCA//globus_simple_ca_68ea3306_setup-0.17.tar.gz

          這里顯示的信息對于以后在其它機(jī)器上進(jìn)行安裝你的網(wǎng)格是十分重要的。在最后一行的數(shù)字68ea3306是你的CA hash,它是一個(gè)8位的十六進(jìn)制的字符串。安裝繼續(xù)進(jìn)行,直到你看到類似下面的內(nèi)容,證明安裝以及結(jié)束。

          ******************************************************************

          Note: To complete setup of the GSI software you need to run the following script as root to configure your security configuration directory:

          /opt/gt4/setup/globus_simple_ca_68ea3306_setup/setup-gsi

          For further information on using the setup-gsi script, use the -help option.  The -default option sets this security configuration to be the default, and -nonroot can be used on systems where root access is not available.

          ******************************************************************

          setup-ssl-utils: Complete

          3.安裝GSI

                 root用戶登錄,運(yùn)行:

          root# $GLOBUS_LOCATION/setup/globus_simple_ca_CA_Hash_setup/

          setup-gsi -default

          其中,Hash表示你的CA Hash,應(yīng)該用68ea3306代替。這里每次安裝時(shí)獲得的CA Hash是不一樣的,應(yīng)該注意。

          2.4 證書的申請和發(fā)放

          2.4.1 host證書

          1.申請一個(gè)host證書

                 這個(gè)證書應(yīng)該是給服務(wù)器申請的,這樣才可以向用戶發(fā)放證書。首先,使用root用戶登錄,運(yùn)行命令:

          root# grid-cert-request –host ‘hostname’

          這里的hostname是服務(wù)器的主機(jī)名,比如“mci.uestc.edu.cn”。該命令會(huì)在服務(wù)器上創(chuàng)建3個(gè)文件,分別是:

          l           /etc/gride-security/hostkey.pem

          l           /etc/grid-security/hostcert_request.pem

          l           /etc/grid-security/hsotcert.pem(這是一個(gè)空的文件)

          之后,會(huì)通過郵件的方式將hostcert_request.pem發(fā)送給CA的管理員,即globus用戶。

          2.對host證書簽名

                 作為globus用戶登錄,并運(yùn)行如下命令:

          grid-ca-sign –in hostcert_request.pem –out hostsigned.pem

          這個(gè)命令是對接受到的host證書進(jìn)行簽名,從而生成hostsigned.pem文件。在此過程中,系統(tǒng)提示globus用戶輸入最初安裝SimpleCA時(shí)輸入的短語。

          3.獲得簽名證書

          作為root用戶登錄,將剛才生成的hostsinged.pem文件移到/etc/grid-security/目錄下并改名為hostcert.pem,從而覆蓋原先的空文件。這時(shí),該文件的所有者是root,同時(shí)對其它用戶是只讀的權(quán)限。

          2.4.2 用戶證書

          1.申請證書

          首先,用一個(gè)普通用戶登錄。然后在命令行輸入如下命令:

          user$ grid-cert-request

          在此過程中,會(huì)提示你輸入passphrase。這個(gè)是用來生成密鑰的短語,要牢記。否則只能重新申請證書。

                 最后,系統(tǒng)中會(huì)生成如下三個(gè)文件:

          ·         ~$USER/.globus/usercert.pem (empty)

          ·         ~$USER/.globus/userkey.pem

          ·         ~$USER/.globus/usercert_request.pem

          其中usercert.pem是空文件,需要另外獲得。此時(shí),會(huì)用email方式將usercert_request.pemSimpleCA的管理員。

          2.對申請的證書進(jìn)行簽名

                 SimpleCA的管理員賬號globus登錄,并運(yùn)行如下命令

          globus$ grid-ca-sign -in usercert_request.pem -out signed.pem

          對通過email收到的usercert_request.pem進(jìn)行簽名。這時(shí),系統(tǒng)會(huì)提示globus用戶輸入在安裝SimpleCA過程中輸入的passphrase。正確輸入后就會(huì)根據(jù)usercert_request.pem生成一個(gè)signed.pem文件,并通過email將其發(fā)送給申請證書的用戶。

          3.獲得簽名證書

                 用普通用戶登錄,并接收來自email的經(jīng)過簽名的signed.pem文件,將其拷貝到~$USRE/.globus/目錄下,并改名為usercert.pem。從而覆蓋原先生成的空文件。

          2.4.3 測試

                 為了對安裝在/etc/grid-security/certificates的證書進(jìn)行校驗(yàn),需要運(yùn)行如下命令:

          user$ grid-proxy-init –debug –verify

          如果一切正確,輸出的結(jié)果類似下面的內(nèi)容:

          [bacon@mayed schedulers]$ grid-proxy-init -debug -verify

                  User Cert File: /home/user/.globus/usercert.pem

                  User Key File: /home/user/.globus/userkey.pem

                  Trusted CA Cert Dir: /etc/grid-security/certificates

                  Output File: /tmp/x509up_u1817

                  Your identity: /O=Grid/OU=GlobusTest/OU=simpleCA-mayed.mcs.anl.gov/OU=mcs.anl.gov/CN=User Name

                  Enter GRID pass phrase for this identity:

                  Creating proxy ..............................++++++++++++

                  ...............++++++++++++

                  Done

                  Proxy Verify OK

                  Your proxy is valid until: Sat Mar 20 03:01:46 2004

          2.5 使容器可以訪問證書

                 通過上述方法獲得證書的host key文件(/etc/grid-security/hostkey.pem)對于root用戶使只讀的。而此時(shí)容器會(huì)以非root用戶身份運(yùn)行(可能使globus用戶)。為了讓容器也可以訪問證書,必須使用root賬號登錄并做如下改動(dòng):

          root# cd /etc/grid-security

          root# cp hostkey.pem containerkey.pem

          root# cp hostcert.pem containercert.pem

          root# chown globus.globus containerkey.pem containercert.pem

          執(zhí)行結(jié)束后,/etc/grid-security目錄看起來像下面這樣:

          root# ls -l *.pem

          -rw-r--r-- 1 globus globus 1785 Oct 14 14:47 containercert.pem

          -r-------- 1 globus globus 887 Oct 14 14:47 containerkey.pem

          -rw-r--r-- 1 root root 1785 Oct 14 14:42 hostcert.pem

          -r-------- 1 root root 887 Sep 29 09:59 hostkey.pem

          2.6 添加授權(quán)

          為用戶添加授權(quán),使之可以訪問服務(wù)。首先,需要作為root用戶登錄,創(chuàng)建/etc/grid-security/grid-mapfile文件。這時(shí),你需要兩部分信息:

          l           用戶的主體名(subject name

          l           這個(gè)主體名應(yīng)該映射到的賬號(account name

          這個(gè)文件的語法是每個(gè)用戶使用一行來表示,前面是用戶的主體名,后面跟著用戶的賬號。

                 為了得到這兩部分信息,可以使用grid-cert-info命令得到用戶的主體名,并用whoami命令得到用戶的賬號。例如:

          bacon$ grid-cert-info -subject

          /O=Grid/OU=GlobusTest/OU=simpleCA-mayed.mcs.anl.gov/OU=mcs.anl.gov/CN=Charles Bacon

          bacon$ whoami

          bacon

          可以使用grid-mapfile-add-entry命令向grid-mapfile文件中添加用戶。例如:

          root# $GLOBUS_LOCATION/sbin/grid-mapfile-add-entry -dn "/O=Grid/OU=GlobusTest/OU=simpleCA-mayed.mcs.anl.gov/OU=mcs.anl.gov/CN=Charles Bacon" -ln bacon

          結(jié)果grid-mapfile看起來應(yīng)該像這樣:

          "/O=Grid/OU=GlobusTest/OU=simpleCA-mayed.mcs.anl.gov/OU=mcs.anl.gov/CN=Charles Bacon" bacon

          注:主體名兩側(cè)的雙引號是必須的,因?yàn)檫@樣可以忽略其中包含的空格。



          [1] 在指南中,所有命令之前都標(biāo)準(zhǔn)執(zhí)行該命令的用戶名。root# 表示系統(tǒng)管理員root用戶,globus$ 表示globus用戶執(zhí)行該命令。對于不是globus的非特權(quán)用戶,我們使用user$ 來表示

          posted on 2005-10-01 09:34 思考 閱讀(4759) 評論(8)  編輯  收藏 所屬分類: Grid Computing

          評論:
          # re: Globus Toolkit 4.0安裝配置 Part I 2005-12-11 15:59 | zhouwanliyt
          不錯(cuò)嘛  回復(fù)  更多評論
            
          # re: Globus Toolkit 4.0安裝配置 Part I 2006-02-22 11:21 | Uz
          看不太懂~  回復(fù)  更多評論
            
          # re: Globus Toolkit 4.0安裝配置 Part I 2006-05-31 11:35 | song
          謝謝 , 這是我找過中最詳細(xì)的 !!   多謝!!  回復(fù)  更多評論
            
          # re: Globus Toolkit 4.0安裝配置 Part I 2006-08-02 17:58 | jan
          用globus身份輸入:grid-ca-sign –in hostcert_request.pem –out hostsigned.pem
          結(jié)果出錯(cuò),顯示為:ERROR: Please specify a request file using the -in option
          請您幫我看看到底哪兒出錯(cuò)了,十分感謝


            回復(fù)  更多評論
            
          # re: Globus Toolkit 4.0安裝配置 Part I 2007-10-18 08:59 | 打發(fā)
          @jan
          必然需要指定待簽發(fā)證書的路徑了.  回復(fù)  更多評論
            
          # re: Globus Toolkit 4.0安裝配置 Part I 2008-10-17 11:48 | 光華
          @打發(fā)


          那個(gè)不是 自動(dòng)郵寄給GLOBUS用戶了么、?? 怎么還要路徑。而且找不到路徑啊  回復(fù)  更多評論
            
          # re: Globus Toolkit 4.0安裝配置 Part I 2009-03-06 17:46 | 施宇光
          你轉(zhuǎn)載我的就轉(zhuǎn)載,還刪除我開始和最后寫的轉(zhuǎn)載版權(quán)來源

          實(shí)在是夠嗆!  回復(fù)  更多評論
            
          # re: Globus Toolkit 4.0安裝配置 Part I[未登錄] 2009-06-04 17:05 | james
          我執(zhí)行到globus$ grid-ca-sign -in usercert_request.pem -out signed.pem這一步時(shí),總是提醒沒有找到grid-ca-sign命令。這是怎么回事呢,望指點(diǎn)。
            回復(fù)  更多評論
            
          主站蜘蛛池模板: 鹿泉市| 高尔夫| 磐安县| 合江县| 铜梁县| 大厂| 和林格尔县| 仙居县| 浦江县| 蚌埠市| 五大连池市| 浦城县| 安阳县| 芦溪县| 桦川县| 永年县| 凤翔县| 湘阴县| 当涂县| 罗平县| 莒南县| 敖汉旗| 酒泉市| 商丘市| 安平县| 廉江市| 滦平县| 镇平县| 都匀市| 本溪市| 怀化市| 黔江区| 德惠市| 宁都县| 上蔡县| 武城县| 永嘉县| 呼伦贝尔市| 兰西县| 玉田县| 万山特区|