Presentation is loading. Please wait.

Presentation is loading. Please wait.

EGRIS-1 www.eu-eela.org E-infrastructure shared between Europe and Latin America Luciano Diaz ICN UNAM Mexico City, 24 October 2007 Hands on session: the.

Similar presentations


Presentation on theme: "EGRIS-1 www.eu-eela.org E-infrastructure shared between Europe and Latin America Luciano Diaz ICN UNAM Mexico City, 24 October 2007 Hands on session: the."— Presentation transcript:

1 EGRIS-1 E-infrastructure shared between Europe and Latin America Luciano Diaz ICN UNAM Mexico City, 24 October 2007 Hands on session: the AMGA Metadata Catalogue

2 E-infrastructure shared between Europe and Latin America Configuration file Create the configuration file for AMGA: $HOME/.mdclient.config # Connection options Host = amga.ct.infn.it Port = 8822 # User settings PermissionMask = rwx GroupMask = r-x Home = / #Name= # Security options UseSSL = require # Values: require, try, no. If off, all options below are ignored AuthenticateWithCertificate = 1 # Use certificate to authenticate # Certificates used for authentication:... either normal certs #CertFile=/home/koblitz/.globus/usercert.pem #KeyFile=/home/koblitz/.globus/userkey.pem #... or a grid proxy certificate UseGridProxy = 1 # Use password instead of certificate to authenticate # Password = secret #VerifyServerCert = 1 # If server certificates are verified, CA certificates need to be loaded: TrustedCertDir = /etc/grid-security/certificates # RequireDataEncryption = 0 Login = NULL

3 E-infrastructure shared between Europe and Latin America EGRIS-1 Access the Metadata Catalog Or copy a template of config file for the MDC and customize it: $ cp $GLITE_LOCATION/etc/mdclient.config \ Start up the Metadata Catalog Client with $ mdclient Once logged in, you can list the available commands, typing help. Connected to amga.ct.infn.it:8822 ARDA Metadata Server Query> help >> >help [topic]< >> >Displays help on a command or a topic.< >> >Valid topics are: help metadata metadata-optional directory entry group acl index schema sequence user view ticket commands< Commands are grouped by topic. You can get the list of valid commands for each topic, typing: help [topic]

4 E-infrastructure shared between Europe and Latin America EGRIS-1 AMGA: List of topics (HELP)‏ Valid topics: –help –metadata –metadata-optional –directory –replication –entry –group –acl –index –schema –sequence –user –view –ticket –commands

5 E-infrastructure shared between Europe and Latin America EGRIS-1 mdclient: Generic Commands Example: help entry >> createdir [options] Make a new folder. It can inherit the schema assosciated to the upper level folder >> rm pattern Remove items corresponding to the given pattern >> link Make a link to another file or to a external URL >> dir List the content of a directory >> listentries List the items (not the collections) of a directory >> stat Show the statistic information about a directory >> chown Changhe the ownership of a file or a directory >> chmod Change the access rights to a file or a directory >> rmdir Remove a directory >> dump Make a recursive dump startung from a given directory, (the default is: ‘/’)‏

6 E-infrastructure shared between Europe and Latin America EGRIS-1 MDC directory related commands Browse the contents of a directory – dir [path] / ls [path] Returns the name of all subdirectories and files in the given path or in the current directory if not specified Print the current working directory – pwd Change the current working directory – cd directory Example: cd /gilda/ Directory creation – createdir /parentdir/dir Creates the directory dir if it does not yet exist but parentdir already does Example: createdir /gilda/tutorial/eelaMX/mexicoXX (XX=01…40)‏ Directory removal – rmdir path Removes the directory given by path

7 E-infrastructure shared between Europe and Latin America EGRIS-1 MDC: Handling attributes Schema population – addattr dir attr type Adds a new attribute to the schema of a directory. Type is the name of an SQL datatype which will translated (if necessary) into a data type understood by the back end DB. Examples of valid datatypes are int, float, varchar(n), timestamp, text, numeric(p,s)‏ Examples: Attribute listing – listattr path Returns a list of all attributes of the given file/direcory Attribute Removal – removeattr dir attribute Removes an attribute from a directory if it is not used by any entry in the directory Query> addattr /gilda/tutorial/eelaMX/mexicoXX id int Query> addattr /gilda/tutorial/eelaMX/mexicoXX name varchar(20)‏ Query> addattr /gilda/tutorial/eelaMX/mexicoXX number float

8 E-infrastructure shared between Europe and Latin America EGRIS-1 MDC: managing entries Entry creation – addentry entry (attribute value)‏ Add a new entry and initializes some attributes Example: Setting attribute values – setattr entry (attribute value)‏ Sets one or more attributes of an entry to given values Example: cd /gilda/tutorial/eelaMX/mexicoXX addentry file1 id 1 name 'Juan Perez' number 30.1 addentry file2 id 2 name 'Miguel Benitez' number addentry file3 id 3 name 'Tomas Cruz' number addentry file10 id 10 name 'Bartolomeo Simpson' number addentries file20 file30 setattr /gilda/tutorial/eelaMX/mexico32/file20 id 20 name 'Julia Roberta' number setattr file30 id 300 name 'Beatriz Sanches' number setattr /gilda/tutorial/eelaMX/mexicoXX/file30 id 30 name 'Beatriz Sanchez'

9 E-infrastructure shared between Europe and Latin America EGRIS-1 MDC: managing entries Getting attribute values – getattr pattern (attribute)‏ Returns the entries and all the attributes for every file matching pattern Example: Entry deletion – rm pattern Removes all entries matching pattern Example: getattr /gilda/tutorial/eelaMX/mexicoXX/file*0 name addentries file40 file50 rm file40 rm file50

10 E-infrastructure shared between Europe and Latin America EGRIS-1 Metadata Queries – find pattern ‘query_condition’ Returns all entries matching pattern for which query_condition is true Examples: Query> getattr * name >> file1 >> Juan Perez >> file2 >> Miguel Benitez >> file3 >> Tomas Cruz >> file10 >> Bartolomeo Simpson >> file20 >> Julia Roberta >> file30 >> Beatriz Sanchez Query> find./file* 'like(name,"%a%")' >> file1 >> file3 >> file10 >> file20 >> file30 Query> find./file? 'like(name,"%a%")' >> file1 >> file3

11 E-infrastructure shared between Europe and Latin America EGRIS-1 Metadata Queries selectattr attr... condition Returns the values of given attributes for all files matching condition Example: Query> pwd >> /gilda/tutorial/eelaMX/mexicoXX/ Query> selectattr.:name.:number 'id>10' >> Julia Roberta >> >> Beatriz Sanchez >>

12 E-infrastructure shared between Europe and Latin America EGRIS-1 Hands-on Session Exercise: Log into the Metadata Catalog Create a directory with your surname into the /grid/tutorial/eelaMX/mexicoXX directory Add some attributes (id int, name varchar(32), remark varchar(128)) to the directory just created Add some entries, you may use any name or the LFNs you uploaded and registered into the File Catalog during the DMS hands-on session Fill the attribute fields for the inserted entries Look for the entries having ‘id’ > 50

13 E-infrastructure shared between Europe and Latin America EGRIS-1 GILDA wiki pages Introduction to AMGA  https://grid.ct.infn.it/twiki/bin/view/GILDA/AMGAHandsOn https://grid.ct.infn.it/twiki/bin/view/GILDA/AMGAHandsOn AMGA Advanced usage  https://grid.ct.infn.it/twiki/bin/view/GILDA/AMGAAdv https://grid.ct.infn.it/twiki/bin/view/GILDA/AMGAAdv


Download ppt "EGRIS-1 www.eu-eela.org E-infrastructure shared between Europe and Latin America Luciano Diaz ICN UNAM Mexico City, 24 October 2007 Hands on session: the."

Similar presentations


Ads by Google