Changes between Initial Version and Version 1 of installation_GridFTP

Show
Ignore:
Timestamp:
05/16/11 14:26:10 (13 years ago)
Author:
bartek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • installation_GridFTP

    v1 v1  
     1= Introduction = 
     2 
     3This page provides step-by-step guide for site admins. It describes basic steps to install and configure GridFTP service. 
     4For any issue concerning the guide please contact [mailto:bogdanl@man.poznan.pl Bogdan Ludwiczak]. 
     5 
     6= Globus Toolkit/GridFTP - installation = 
     7 
     8This sections provides overview of Globus Toolkit ver. 4.x installation procedure. 
     9 
     10Globus Toolkit is provided both in binary and source versions. It is also available as Java WS-core only or full version. For the purpose of the QosCosGrid Infrastructure the full source installation is required, as it provides the required GridFTP features and in most cases is more reliable (though more troublesome in rare cases) and robust then binary version. 
     11 
     12 
     13Below are the steps required to compile and install Globus Toolkit with only GridFTP daemon and utilities. 
     14 
     15'''Note:''' this is only an outline of the installation process which should be sufficient to install GridFTP service in most cases, full and detailed information regarding toolkit installation can be found in official Globus [http://www.globus.org/toolkit/docs/4.0/ documentation].  
     16 
     17* Check if target system has all required software components: 
     18 *  gcc (latest 3.4 or 4.1) 
     19 *  GNU tar, sed, make 
     20 *  Perl >5.6 
     21 * Create a dedicated, non-privileged user named `globus`. This user owns the installation/deployment files compile and install Globus Toolkit performs administrative tasks such as deploying/configuring services, etc. 
     22 * Create deployment directory 
     23 * make sure that user the `globus` has read and write permissions in the installation directory 
     24 
     25'''Note:''' Following steps should be carried out by the `globus` user. 
     26 
     27* Download and untar Globus Toolkit ver.4.2.x all-source-installer (available at the  [[http://www.globus.org/toolkit/downloads/4.2.1/#source Globus Toolkit]] web site) 
     28* change current working directory to the source directory (i.e. `~/gt4.2.x-all-source-installer`) 
     29* set environmental variable `GLOBUS_LOCATION` to point to installation directory (e.g. `/opt/globus/gt421`) 
     30* finally use `./configure` to set up compilation and installation option. Use at least `--prefix` option to set the deployment directory. 
     31{{{ 
     32#!div style="font-size: 90%" 
     33{{{#!sh 
     34  ./configure --prefix=${GLOBUS_LOCATION} 
     35}}} 
     36}}} 
     37{{Note}} If you encounter an error '''configure: error: Unable to compile with SSL''', replace the above line with: 
     38{{{ 
     39#!div style="font-size: 90%" 
     40{{{#!sh 
     41  ./configure --disable-system-openssl --prefix=${GLOBUS_LOCATION} 
     42}}} 
     43}}} 
     44* Compile and install Globus Toolkit by running: 
     45{{{ 
     46#!div style="font-size: 90%" 
     47{{{#!sh 
     48  make gridftp  
     49  make install 
     50}}} 
     51}}} 
     52 If you wish to have a log file of the build, use "tee" command: 
     53{{{ 
     54#!div style="font-size: 90%" 
     55{{{#!sh 
     56  make gridftp 2>&1 | tee build.log 
     57  make install 
     58}}} 
     59}}} 
     60* GT4 unlike other software packages is made directly to target location (<code>$GLOBUS_LOCATION</code>) 
     61* If you omit <code>gridftp</code> for <code>make</code> the entire Globus Toolkit will be build what can take several hours to complete. 
     62* during <code>make install</code> phase Globus configuration will be initialized 
     63* You can also choose to build GridFTP server or client tools be specifying <code>globus_gridftp_server</code> or <code>globus-data-management-client</code> respectively. 
     64 
     65The belowe steps completes Globus Toolkit/GridFTP installation. The following figure summarizes shell commands used during typical installation process: 
     66  bogdanl@cress ~ $ su - 
     67  cress ~ # useradd -m globus  
     68  cress ~ # mkdir /opt/globus  
     69  cress ~ # chown globus:users /opt/globus 
     70  cress ~ # su - globus 
     71  globus@cress ~ $ wget http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2 
     72  globus@cress ~ $ tar xjf gt4.2.1-all-source-installer.tar.bz2 
     73  globus@cress ~ $ cd gt4.2.1-all-source-installer 
     74  globus@cress ~ $ export GLOBUS_LOCATION=/opt/globus/gt421 
     75  globus@cress ~/gt4.2.1-all-source-installer $ ./configure --prefix=${GLOBUS_LOCATION} \ 
     76  globus@cress ~/gt4.2.1-all-source-installer $ make gridftp 
     77  cd gpt && OBJECT_MODE=32 ./build_gpt 
     78  ... 
     79  Your build completed successfully.  Please run make install. 
     80  globus@cress ~/gt4.2.1-all-source-installer $ make install 
     81 
     82=Globus Toolkit/GridFTP - basic configuration= 
     83 
     84==Security== 
     85After Globus Toolkit installation, but before starting Globus services several aspects of GSI security need to be configured: 
     86*configure Globus (and thus GridFTP daemon) to trust a particular set of CAs (Certificate Authorities), i.e. place certificates of trusted CAs into designated directory - CA is trusted only if its CA certificate exists with the appropriate name in an appropriate directory. Moreover, for pre-ws services (including GridFTP), signing policy file must exist in the same location as CA certificate. In other words, one needs two files to trust given CA: 
     87:* <code>cert_hash.0</code> - the trusted CA certificate and 
     88:* <code>cert_hash.signing_policy</code> - the signing policy. 
     89:Globus services and tools looks for that directory in following locations: 
     90:* the value of <code>$X509_CERT_DIR</code> environment variable if it is set and the directory exists, 
     91:* otherwise, in <code>$HOME/.globus/certificates</code> if it exists, 
     92:* otherwise, in <code>/etc/grid-security/certificates</code> if it exists, 
     93:* otherwise, in <code>$GLOBUS_LOCATION/share/certificates</code> if it exists. 
     94 
     95{{Note}} We suggest to use <code>/etc/grid-security/certificates</code> as system wide trusted CAs directory, but remember that <code>$X509_CERT_DIR</code> and <code>$HOME/.globus/certificates</code> have higher priority.  
     96 
     97The "cert_hash.0", i.e. certificate of the CA, is provided by CA, usually with appropriate hash name. Hash name consists of 8 hex-digits and suffix ".0" (<code>e. g. 8a661490.0 </code>). Valid hash can be obtained with following command (available in <code>$GLOBUS_LOCATION/bin/)</code>: 
     98 
     99  openssl x509 -hash -noout -in ca_certificate 
     100 
     101* cert_hash.signing_policy usually is also provided by CA, but it can be constructed manually. The signing policy file has the following format: 
     102  access_id_CA X509 'CA Distinguished Name' 
     103  pos_rights globus CA:sign 
     104  cond_subjects globus '"Name Pattern1" "Name Pattern2" ...' 
     105 
     106: to get 'CA Distinguished Name' execute: 
     107 
     108  openssl x509 -subject -noout -in cert_hash.0 
     109 
     110* "name pattern" is a string used to match the distinguished names of certificates granted by the given CA. Usually, it is a CA name with common name replaced by wild card '*', e.g.: 
     111 
     112  "/C=PL/O=GRID/CN=Polish Grid CA" -> '"/C=PL/O=GRID/*"' 
     113 
     114: it accepts "C=PL/O=GRID/OU=PSNC/CN=Bogdan Ludwiczak", but it rejects "O=GRID/OU=PSNC/CN=Bogdan Ludwiczak" '"*"' pattern accepts all certificates. 
     115* Configure appropriate default values for use by the grid-cert-request command which is used to generate certificates requests. The following files have to be properly configured to enable Globus tools to generate valid certificate requests: 
     116<code>/etc/grid-security/globus-user-ssl.conf</code> - defines the distinguished name to use for a user's certificate request. 
     117<code>/etc/grid-security/globus-host-ssl.conf</code> - defines the distinguished name for a host and service certificate request. 
     118<code>/etc/grid-security/grid-security.conf</code> - is a main configuration file that contains the name and email address for the given CA. 
     119 
     120These files are usually provided by the CA, particularly [[QosCosGrid CA]] or [http://www.man.poznan.pl/plgrid-ca/ PL-Grid] does provides these files. Typically, CA configuration files are placed in <code>/etc/grid-security/certificates/</code> directory with additional extension .CA_hash_name and only appropriate symbolic links are created in /etc/grid-security/. Globus Toolkit provides grid-default-ca command which can be used to automatically create appropriate links. 
     121 
     122== Requesting host and user X.509 certificates == 
     123All Globus service (including GridFTP) require a host (or service) certificate to operate. Also every user needs a user certificate do use Globus services. You can use Globus command <code>grid-cert-request to generate</code> host/users certificate request which should be send to your CA to be signed. Make sure that CA configuration files and certificate are in place before generating requests. This command will create 3 files: 
     124* an empty (file length is 0) /etc/grid-security/hostcert.pem or ~/.globus/usercert.pem, 
     125* <code>/etc/grid-security/hostkey.pem</code> or <code>~/.globus/userkey.pem file containig</code> host/user private key which must be kept secret - make sure that the unix access mode is set to 0400 or 0600 at most, 
     126* <code>/etc/grid-security/hostcert_request.pem</code> or <code>~/.globus/usercert_request.pem</code> file containing acctual request to be send to and signed by CA. 
     127 
     128{{Note}} Before you can use grid-cert-request command you have to source Globus configuration script appropriate for your shell, i.e. <code>$GLOBUS_LOCATION/etc/globus-user-env.csh</code> or <code>$GLOBUS_LOCATION/etc/globus-user-env.sh</code> 
     129 
     130Send newly generated certificate request (i.e. <code>/etc/grid-security/hostcert_request.pem</code> or <code>~/.globus/usercert_request.pem</code> file) to the appropriate CA and wait for the certificate which should be send in return by your CA. Save the new certificate in <code>hostcert.pem</code> or <code>usercert.pem</code>. Now, request file can be deleted. Host certificate and private key should be owned by root user. 
     131Specify identity mapping information 
     132Globus services map distinguished names (retrieved from certificates) to local identities (unix account) by means of <code>grid-mapfile</code>. Mappings have the folowing form: 
     133"Distinguished Name" local_name 
     134(every line of the file defines one mapping) To let user in, create an account and add mapping to the site's grid-mapfile. Globus looks for the file in the following locations: 
     135* the value of <code>GRIDMAP</code> environment variable if it is set, 
     136* otherwise, if service is run as root then grid map file is <code>/etc/grid-security/grid-mapfile</code>, 
     137* otherwise, the grid map file is <code>$HOME/.gridmap</code> 
     138* otherwise, in <code>/etc/grid-security/grid-mapfile</code>. 
     139 
     140{{Note}} In the QosCosGrid project there is a possibility to generate a new user X.509 certificate in more [http://node2.qoscosgrid.man.poznan.pl:80/gridsphere/gridsphere/guest/security/r/ user-friendly way] 
     141 
     142== Firewall configuration == 
     143 
     144Detailed information on GT firewall issues can be found at http://www.globus.org/toolkit/security/firewalls/. This paragraph only lists the minimum required firewall configuration and gives a short overview of the basic issues. To enable remote access to Globus Toolkit services the following TCP port should be opened for the incoming connections: 
     145*static port: 2811 for main GridFTP daemon port 
     146*ephemeral TCP ports: various Globus services require an arbitrary chosen TCP port range. It is controllable by environmental variable GLOBUS_TCP_PORT_RANGE for pre-ws components. Make sure it is defined in daemons environment (i.e. put it in (x)inetd configuration entries) 
     147 
     148Figure below gives an overview of typical Globus/GridFTP communication flow It shows the meaning of the aforementioned Globus TCP port range. 
     149 
     150[[File:Firewall_gridftp.jpg|frame|center|alt=GridFTP communication diagram|GridFTP communication diagram]] 
     151 
     152== GridFTP Daemon == 
     153After successful installation of GlobusToolkit, the GridFTP daemon binary is located in: <code>$GLOBUS_LOCATION/sbin/globus-gridftp-server</code> file. The daemon could be run in standalone mode, but we suggest using (x)inetd mode. To configure it this way, first add the following entry to <code>/etc/services</code> file: 
     154 
     155  gsiftp          2811/tcp               # GridFTP (Port 2811 is the IANA registered GridFTP port)  
     156 
     157Next add appropriate entry to (x)inetd configuration file(s). Remember to set <code>LD_LIBRARY_PATH</code>, <code>GLOBUS_LOCATION</code> and <code>GLOBUS_TCP_PORT_RANGE</code> in the (x)inetd entry   environment, like in the xinetd example below: 
     158 
     159  service gsiftp 
     160  { 
     161        instances            = 100 
     162        cps                  = 50 10 
     163        per_source           = 50 
     164        socket_type          = stream 
     165        wait                 = no 
     166        user                 = root 
     167        env                  = LD_LIBRARY_PATH=/opt/globus/lib 
     168        env                  += GLOBUS_LOCATION=/opt/globus 
     169        env                  += GLOBUS_TCP_PORT_RANGE=9000,9999 
     170        server               = /opt/globus/sbin/globus-gridftp-server 
     171        server_args          =  -i -c /opt/globus/etc/gridftp.conf 
     172        log_on_success       += DURATION 
     173        log_on_failure       += 
     174        nice                 = 10 
     175        disable              = no 
     176  } 
     177 
     178Note that the above example specifies grid-ftp configuration file (-c .../gridftp.conf in server_args line). It is not required - GridFTP daemon should work without this file. A useful example of configuration file is: 
     179         
     180  log_level ALL (or 'EERROR', 'WARN', 'INFO', 'DUMP') 
     181  log_module stdio 
     182  log_single /var/log/gridftp 
     183 
     184it enables logging which can be helpful in resolving potential problems. Finally, restart (x)inetd to activate the GridFTP daemon: 
     185 
     186 # /etc/init.d/xinetd restart 
     187 
     188== Users configuration == 
     189All Globus Toolkit commands require appropriately configured environment. Globus Toolkit provides scripts for that purpose. To configure users environment for GT command do the following: 
     190for bash shell: 
     191 
     192  export GLOBUS_LOCATION=/opt/globus/gt421 
     193  . $GLOBUS_LOCATION/etc/globus-user-env.sh  
     194 
     195or for csh shell: 
     196 
     197  setenv GLOBUS_LOCATION /opt/globus/gt421 
     198  source $GLOBUS_LOCATION/etc/globus-user-env.csh  
     199 
     200Next you must obtain user certificates (as described in [[GridFTP#Requesting_host_and_user_X.509_certificates| Requesting host and user X.509 certificates]]) and then create user proxy by running command <code>grid-proxy-init</code>: 
     201 $ grid-proxy-init  
     202  Your identity: /C=PL/O=GRID/O=PSNC/CN=Bogdan Ludwiczak 
     203  Enter GRID pass phrase for this identity: 
     204  Creating proxy ....................................................... Done 
     205  Your proxy is valid until: Tue Apr 29 21:02:33 2008 
     206 
     207Next, become root and create a mapping in <code>/etc/grid-security/grid-mapfile</code>. You can use your favorite text editor for that purpose and append a line similar to this one: 
     208 
     209  "/C=PL/O=GRID/O=PSNC/CN=Bogdan Ludwiczak" bogdanl 
     210 
     211or use GT <code>grid-mapfile-add-entry</code> command: 
     212 
     213  # grid-mapfile-add-entry -dn "/C=PL/O=GRID/O=PSNC/CN=Bogdan Ludwiczak" -ln bogdanl 
     214 
     215{{Note}} "bogdanl" in examples above is a name of a local unix account. 
     216 
     217Now you can transfer some files with globus-url-copy tool: 
     218 
     219  $ globus-url-copy gsiftp://node1.qoscosgrid.man.poznan.pl/~/file file:///tmp/file.test 
     220  $ globus-url-copy gsiftp://node1.qoscosgrid.man.poznan.pl/~/file gsiftp://node1.qoscosgrid.man.poznan.pl/~/file2 
     221  $ globus-url-copy gsiftp://node1.qoscosgrid.man.poznan.pl/~/file gsiftp://node2.qoscosgrid.man.poznan.pl/~/file2 
     222 
     223= Quick Start = 
     224 
     225* create 'globus' user and installation directory, make 'globus' user an owner of this directory: 
     226   
     227  bogdanl@cress ~ $ su - 
     228  cress ~ # useradd -m globus 
     229  cress ~ # mkdir /opt/globus 
     230  cress ~ # chown globus:users /opt/globus  
     231 
     232* login as a <code>globus</code> user: 
     233  cress ~ # su - globus 
     234 
     235* download Globus Toolkit source installer and untar it: 
     236  globus@cress ~ $ wget http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2 
     237  globus@cress ~ $ tar xjf gt4.2.1-all-source-installer.tar.bz2  
     238 
     239* Configure and make sources: 
     240  globus@cress ~ $ cd gt4.2.1-all-source-installer 
     241  globus@cress ~ $ export GLOBUS_LOCATION=/opt/globus/gt421 
     242  globus@cress ~/gt4.2.1-all-source-installer $ ./configure --prefix=${GLOBUS_LOCATION} \ 
     243  globus@cress ~/gt4.2.1-all-source-installer $ make gridftp 
     244  cd gpt && OBJECT_MODE=32 ./build_gpt 
     245  ... 
     246  Your build completed successfully.  Please run make install. 
     247  globus@cress ~/gt4.2.1-all-source-installer $ make install 
     248 
     249* Request host certificates: 
     250* Start gridftp-server either standalone or by (x)inetd daemon 
     251:* If you are going to use xinetd daemon add gridftp to /etc/services: 
     252  bogdanl@cress ~ $ su - 
     253  cress ~ # echo "gsiftp          2811/tcp               # GridFTP" >> /etc/services 
     254:* and create new xinetd configuration file for gridftp service 
     255  cress ~ # cat /etc/xinetd.d/gridftp 
     256  service gsiftp 
     257  { 
     258        instances            = 100 
     259        cps                  = 50 10 
     260        per_source           = 50 
     261        socket_type          = stream 
     262        wait                 = no 
     263        user                 = root 
     264        env                  = LD_LIBRARY_PATH=/opt/globus/lib 
     265        env                  += GLOBUS_LOCATION=/opt/globus 
     266        env                  += GLOBUS_TCP_PORT_RANGE=9000,9999 
     267        server               = /opt/globus/sbin/globus-gridftp-server 
     268        server_args          =  -i -c /opt/globus/etc/gridftp.conf 
     269        log_on_success       += DURATION 
     270        log_on_failure       += 
     271        nice                 = 10 
     272        disable              = no 
     273  }  
     274 
     275:* restart xinetd: 
     276  cress ~ # /etc/init.d/xinetd restart 
     277* test it: 
     278   
     279  bogdanl@cress ~ $ telnet cress 2811 
     280  Trying 150.254.149.134... 
     281  Connected to cress.man.poznan.pl. 
     282  Escape character is '^]'. 
     283  220 cress.man.poznan.pl GridFTP Server 2.3 (gcc32dbg, 1144436882-63) ready. 
     284  bogdanl@cress ~ $ export GLOBUS_LOCATION=/opt/globus/gt421 
     285  bogdanl@cress ~ $ . $GLOBUS_LOCATION/etc/globus-user-env.sh  
     286  bogdanl@cress ~ $ grid-proxy-init 
     287  bogdanl@cress ~ $ globus-url-copy gsiftp://cress/~/file \ 
     288        file:///tmp/file.test 
     289  bogdanl@cress ~ $ globus-url-copy gsiftp://cress/~/file \ 
     290        gsiftp://cress/~/file2