7.5. Replication

To utilize replication, a replication server needs to be installed. It consists of an LDAP server. The Globus Toolkit 2.2 provides an LDAP server than can be used for this purpose. See “Installation” on page 211. In the Globus Toolkit 2.2 the GSI security infrastructure is not used to modify entries in the LDAP repository. Consequently, a password and an LDAP administrator need to be defined for the replica server. It will be used each time from the client side to perform write operations to the LDAP tree.

7.5.1. Shell commands

The Globus Toolkit 2.2 provides a single shell command for manipulating replica catalog objects. The format of the command is:

globus-replica-catalog HOST OBJECT ACTION

Where:

  • HOST specifies the logical collection in the replica catalog as well of the information needed to connect to the LDAP server (a user and a password). The Globus Toolkit V2.2 uses an LDAP directory so the URL for a collection follows the format ldap://host:[port]/dn where dn is the distinguished name of the collection. The HOST format is therefore:

    -host <collection URL> -manager <manager DN> -password <file>

    Two environment variables can be used to avoid typing the -host and -manager option each time:

    - GLOBUS_REPLICA_CATALOG_HOST for the logical collection distinguished name.

    - GLOBUS_REPLICA_CATALOG_MANAGER for the manager distinguished name.

    - file contains the password used during the connection.

  • OBJECT indicates which entry in the replica catalog the command will act upon:

    - -collection for a collection that was specified in the -host option

    - -location <name>

    - -logicalfile <name>

  • ACTION determines which operations will be executed on the entry. There are four categories: Creation/deletion, attributes modifications, files names manipulation in the logical collection file lists and location file lists, and finally search operations. See the Globus documentation for more information.

7.5.2. Replica example

In the following example scenario, we propose to create a logical collection called itsoCollection in the Replica Catalog created in “Installation” on page 211. This collection consists of five files that are located on two different servers, g0.itso-guarani.com and t0.itso-tupi.com. Three files are stored on g0.itso-guarani.com, and two others are located on t0.itso-tupi.com. The two locations host a GridFTP server.

Figure 7-5. Replica example


The steps are:

1.
First, set up the environment:

export GLOBUS_REPLICA_CATALOG_HOST="ldap://m0.itso-maya.com/lc=itso
Collection,rc=test,dc=itso-maya,dc=com"
export GLOBUS_REPLICA_CATALOG_MANAGER="cn=Manager,dc=itso-maya,dc=com"
echo ###### > password

2.
Create the three file lists: One for the files in the collection, one for the files located in g0.itso-guarani.com, and the last for the files stored on t0.itso-tupi.com.

for i in file1 file2 file3 file4 file5;do echo $i >> FileList;done
for i in file1 file2 file3 ;do echo $i >> tupiFiles;done
for i in file4 file5;do echo $i >> guaraniFiles;done

3.
Register the collection:

globus-replica-catalog -password password -collection -create FileList

4.
Register the two locations and their file list:

globus-replica-catalog -password password -location "t0 Tupi Storage"
-create "gridftp://t0.itso-tupi.com/home/globus/storage/" tupiFiles
globus-replica-catalog -password password -location "g0 Guarani Storage"
-create "gridftp://g0.itso-tupi.com/home/globus/storage/" guaraniFiles

5.
Register each of the logical files with their size:

globus-replica-catalog -password password -logicalfile "file1" -create
100000
globus-replica-catalog -password password -logicalfile "file2" -create
200000
globus-replica-catalog -password password -logicalfile "file3" -create
300000
globus-replica-catalog -password password -logicalfile "file4" -create
400000
globus-replica-catalog -password password -logicalfile "file5" -create
500000

We can now perform a few requests:

  1. Search for all locations that contain file4 and file5:

    1. Create a file FilesToBeFound that contains the files we are looking for:

      for i in file4 file5; do echo $i >> FilesToBeFound;done
      
    2. Perform the request:

      globus-replica-catalog -password password -collection -find-locations
      FilesToBeFound uc
      

      Then you should receive the following output:

      filename=file4
      filename=file5
      uc=gridftp://g0.itso-tupi.com/home/globus/storage
      

      uc means URL Constructor and is the attribute used in the LDAP directory to store the location URL.

  2. Check the size attribute for the file file2:

    globus-replica-catalog -password password -logicalfile "file2"
    -list-attributes size
    

    You receive:

    size=200000
    

7.5.3. Installation

The installation process is explained at:

http://www.globus.org/gt2/replica.html

It consists of the following steps:

1.
Add a new schema that defines objects manipulated for replica management. It can be downloaded from:

http://www.globus.org/gt2/replica.schema.txt

Copy this file to

$GLOBUS_LOCATION/etc/openldap/schema/replica.schema.

Edit $GLOBUS_LOCATION/etc/openldap/slapd.conf to reflect your site’s requirements (for all bolded entries).

# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /usr/local/globus/etc/openldap/schema/core.schema
include /usr/local/globus/etc/openldap/schema/replica.schema
pidfile /usr/local/globusvar/slapd.pid
argsfile /usr/local/globus/var/slapd.args

###############################################################
 # ldbm database definitions
 ###############################################################
database ldbm
 suffix "dc=itso-maya,dc=com"
 rootdn "cn=Manager, dc=itso-maya,dc=com "
 rootpw globus
 directory /usr/local/globus/var/openldap-ldbm
 index objectClass eq

Be sure to include the following two lines in the file near the top:

								schemacheck off
include /usr/local/globus/etc/openldap/schemas/replica.schema

2.
Start the LDAP daemon:

export LD_LIBRARY_PATH=$GLOBUS_LOCATION/etc
$GLOBUS_LOCATION/libexec/slapd -f $GLOBUS_LOCATION/etc/openldap/slapd.conf

3.
The LDAP daemon sends a message to the syslogd daemon though the local4 facility. Add the following line in /etc/syslogd.conf:

Local4.*        /var/log/ldap.log

Issue service syslogd reload to enable LDAP error messages. For any issues regarding the LDAP server, you can check/var/log/ldap.log to determine what the problem might be.

4.
Initialize the catalog.

a. Open a shell and issue:

. $GLOBUS_LOCATION/etc/globus_user-env.sh

Note

All bold statements are specific to your site and need to be replaced where necessary.

b. Create a file called root.ldif with the following contents:

dn: dc=itso-maya, dc=com
objectclass: top
objectclass: GlobusTop

c. Create a file called rc.ldif with the following contents:

dn: rc=test, dc=itso-maya, dc=com
objectclass: top
objectclass: GlobusReplicaCatalog
objectclass: GlobusTop
rc: test
									

d. Now run the following commands:

ldapadd -x -h m0.itso-maya,com  -D    "cn=Manager,dc=itso-maya,dc=com"
-w globus -f root.ldif

ldapadd -x -h m0.itso-maya,com -D   "cn=Manager,dc=itso-maya,dc=com" -w
globus -f rc.ldif

ldapsearch -h ldap.server.com -b "dc=itso-maya.com" objectclass=*

You should see the following in the output:

dn: dc=itso-maya,dc=com
objectclass: top
objectclass: GlobusTop

dn: rc=test, dc=itso-maya,dc=com
objectclass: top
objectclass: GlobusReplicaCatalog
objectclass: GlobusTop

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.111.30