// Á¦ ¸ñ: Replica Location Service (RLS) ¼³Ä¡
// ÀÛ¼ºÀÚ: ±è¿µ´ë( http://www.howto.pe.kr )
0.¼³Ä¡È¯°æ
¼³Ä¡ GT3: GT3 3.0.2
O/S: Linux 2.4.18-3 (Redhat 7.3)
È£½ºÆ®¸í: myhome.ssu.ac.kr
*.RLS ¼³Ä¡Àü ¿ä±¸»çÇ×
Globus Toolkit ÀÌ ¼³Ä¡µÇ¾î ÀÖ¾î¾ß Çϸç Á¤È®È÷ ½ÇÇàµÇÁö ¾Ê´õ¶óµµ
RLS ¼¹ö¸¦ ¼³Ä¡ÇÒ host ´Â CA ·Î ºÎÅÍ ÀÎÁõ¹ÞÀº È£½ºÆ® ÀÎÁõ¼°¡ ÀÖ¾î¾ß ÇÑ´Ù
/etc/grid-security/hostcert.pem, /etc/grid-security/hostkey.pem
¶ÇÇÑ ÀÏ¹Ý »ç¿ëÀÚ °èÁ¤À¸·Î RLS ¼¹ö Á¢±Ù½Ã ÀÎÁõ °úÁ¤ÀÌ ÇÊ¿äÇÏ´Ù¸é À¯Àú ÀÎÁõ¼µµ ÀÖ¾î¾ß ÇÑ´Ù
1.¼³Ä¡ÇÒ ÆÄÀÏ ´Ù¿î¹Þ±â
.globus-rls-server-2.0.9-src_bundle.tar.gz ( http://www-unix.globus.org/toolkit/download.html )
.libiodbc-3.0.6-2.src.rpm ( http://www.iodbc.org )
.postgresql 7.2.1 ( http://www.postgresql.org )
2.ȯ°æº¯¼ö ¼³Á¤
¼³Ä¡Çϱâ Àü¿¡ 3°³ °èÁ¤(root, globus, ÀÏ¹Ý °èÁ¤)ÀÇ .bash_profile ¶Ç´Â .bashrc ÆÄÀÏÁß GLOBUS_LOCATION º¯¼ö°¡
Á¤ÀÇµÈ ÆÄÀÏ¿¡ ¾Æ·¡ ȯ°æº¯¼ö¸¦ Ãß°¡ÇÑÈÄ ¹Ý¿µ½ÃŲ´Ù
export GLOBUS_IODBC_PATH=$GLOBUS_LOCATION
export ODBCINI=/etc/odbc.ini
export CLASSPATH=$CLASSPATH:$GLOBUS_LOCATION/lib/rls.jar
3.postgresql DB ¼³Ä¡
´Ù¿î¹ÞÀº postgresql rpm À» ÀÌ¿ëÇÏ¿© "rpm -Uvh postgresql*.rpm" ·Î ¼³Ä¡Çϰųª
RedHat CD 1¹øÀ¸·Î ºÎÆÃÇÏ¿© ½Ã½ºÅÛ ¾÷±×·¹À̵å·Î µé¾î°¡¼ postgresql ¸¦ ¼³Ä¡ÇÑ´Ù
CD ·Î ¼³Ä¡Çϴ°ÍÀÌ dependencies µµ ÇØ°áÇÒ ¼ö ÀÖ¾î Æí¸®ÇÏ´Ù
Á¤È®È÷ ¼³Ä¡µÇ¾ú´Ù¸é ´ÙÀ½°ú °°Àº rpm µéÀÌ ¼³Ä¡µÈ´Ù(¶ÇÇÑ ÀÚµ¿À¸·Î postgres °èÁ¤ÀÌ »ý¼ºµÈ´Ù)
[root root]# rpm -qa|grep postgresql
postgresql-libs-7.2.1-5
postgresql-odbc-7.2.1-5
postgresql-contrib-7.2.1-5
postgresql-server-7.2.1-5
postgresql-docs-7.2.1-5
postgresql-python-7.2.1-5
postgresql-jdbc-7.2.1-5
postgresql-tcl-7.2.1-5
postgresql-tk-7.2.1-5
postgresql-7.2.1-5
postgresql-perl-7.2.1-5
postgresql ¼¹ö°¡ TCP/IP ¸¦ ÅëÇÏ¿© ¿ÜºÎ¿¡¼ Á¢¼Ó¿äûÀ» ¹ÞÀ» ¼ö ÀÖµµ·Ï ¼öÁ¤ÇÑ´Ù
[root root]# vi /etc/rc.d/init.d/postgresql
postgresqlÀÇ 151 ÇàÀ¸·Î À̵¿ÇÏ¿© ÇØ´ç ÇàÀ» ´ÙÀ½°ú °°ÀÌ º¯°æÇÑ´Ù
(postmaster¿Í start ´Ü¾î Áß°£¿¡ -o '-i' ºÎºÐÀÌ Ãß°¡µÇ´Â °ÍÀÌ´Ù)
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster -o '-i' start > /dev/null 2>&1" < /dev/null
postgresql ¼¹ö¸¦ ½ÇÇàÇÑ ÈÄ °ð¹Ù·Î Á¾·áÇÑ´Ù(¿¡·¯°¡ ³¯ ¼ö ÀÖÁö¸¸ Áö±ÝÀº ¹«½ÃÇÑ´Ù)
(ÀÌ µ¿ÀÛÀ» ÇÏÁö ¾ÊÀ¸¸é ¾Æ·¡ÀÇ pg_hba.conf °¡ »ý¼ºµÇÁö ¾Ê´Â´Ù)
[root root]# /etc/rc.d/init.d/postgresql start
[root root]# /etc/rc.d/init.d/postgresql stop
»ý¼ºµÈ ȯ°æÆÄÀÏ(pg_hba.cof)À» ¿¾î ¸ðµç È£½ºÆ®°¡ ¼¹ö¿¡ Á¢¼ÓÇÒ ¼ö ÀÖµµ·Ï ÇØÁØ´Ù
[root root]# vi /var/lib/pgsql/data/pg_hba.conf
postgresql ÀÇ ³¡¿¡ ´ÙÀ½ µÎ ¹®ÀåÀ» Ãß°¡ÇÑ´Ù(°¢ Çʵå´Â tab Å°·Î ¶ç¿î´Ù)
host all 127.0.0.1 255.255.255.255 trust
host all 0.0.0.0 0.0.0.0 trust
postgresql ¼¹ö¸¦ ½ÇÇàÇÑ´Ù(¿©±â¼´Â ¿¡·¯°¡ ³ª¸é ¾ÈµÈ´Ù)
[root root]# /etc/rc.d/init.d/postgresql start
4.iODBC ¼³Ä¡
´Ù¿î¹ÞÀº libiodbc-3.0.6-2.src.rpm ¸¦ ÀÓÀÇÀÇ µð·ºÅ丮¿¡¼ ¾Æ·¡¿Í °°ÀÌ ¼³Ä¡ÇÑ´Ù
[root tmp]# rpm -rebuild libiodbc-3.0.6-2.src.rpm
[root tmp]# rpm -Uvh /usr/src/redhat/RPMS/i386/libiodbc-* --force
5.RLS ¼¹ö ¼³Ä¡
¸ÕÀú globus °èÁ¤À¸·Î º¯°æÇÑ ÈÄ GT3 ÀÇ ¾ÐÃàÀ» Ǭ µð·ºÅ丮·Î À̵¿ÇÑ´Ù
[globus globus]$ cd gt3.0.2-linux-installer
´Ù¿î¹ÞÀº globus-rls-server-2.0.9-src_bundle.tar.gz ¸¦ gt3.0.2-linux-installer µð·ºÅ丮¿¡¼ ¼³Ä¡ÇÑ´Ù
[globus gt3.0.2-linux-installer]$ gpt-build globus-rls-server-2.0.9-src_bundle.tar.gz gcc32dbgpthr
[globus gt3.0.2-linux-installer]$ gpt-postinstall
* gpt-build ÇÒ¶§ globus_*.h Çì´õ ÆÄÀÏÀÌ ¾ø´Ù´Â ¿¡·¯¸Þ½ÃÁö°¡ ³ª¿À¸é¼ ÁßÁöµÈ´Ù¸é GT3 ¸¦ ¼³Ä¡ÇÑ µð·ºÅ丮·Î À̵¿ÇÏ¿©
include ¾Æ·¡¿¡ gcc32dbgpthr µð·ºÅ丮°¡ ÀÖ´ÂÁö È®ÀÎÇÑ´Ù. ¸¸¾à ÀÖ´Ù¸é ±× ¾È¿¡ globus_io.h ÆÄÀÏÀÌ ÀÖ´ÂÁöµµ È®ÀÎÇÑ´Ù
gcc32dbgpthr µð·ºÅ丮¿Í ±× ¾È¿¡ globus_io.h ÆÄÀÏÀÌ ¾ø´Ù¸é GT3 ¼³Ä¡½Ã Çì´õÆÄÀÏÀÌ ºüÁø °æ¿ì·Î À̶§´Â GT3 ¸¦ ´Ù½Ã
¼³Ä¡Çϰųª ´Ù¸¥ »ç¶÷ÀÌ ¼³Ä¡ÇÑ GT3 ÀÇ gcc32dbgpthr µð·ºÅ丮¸¦ º¹»çÇØ ³Ö´Â´Ù
º¹»çÇØ ³Ö°í ´Ù½Ã gpt-build ½Ã¿¡´Â -force ¿É¼ÇÀ» »ç¿ëÇÏ¿© rebuild ½ÃÄѾßÇÑ´Ù
6.RLS ȯ°æ¼³Á¤
¸ÕÀú postgresql ¼³Ä¡½Ã ÀÚµ¿ »ý¼ºµÈ postgresql °ü¸®ÀÚ °èÁ¤ÀÎ postgres °èÁ¤À¸·Î ¹Ù²Û´Ù
[root root]# su - postgres
postgresql DB ¿¡ °èÁ¤À» ¸¸µç´Ù(ÆíÀÇ»ó globus/globus ·Î ÇÑ´Ù)
bash-2.05a$ createuser -P globus
Enter password for user "globus": globus
Enter it again: globus
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
CREATE USER
RLS°¡ »ç¿ëÇÒ LRC ¿Í RLI ÀÇ µ¥ÀÌÅͺ£À̽º¸¦ »ý¼ºÇϱâ À§Çؼ ´ÙÀ½°ú °°ÀÌ ½ÇÇàÇÑ´Ù.
bash-2.05a$ createdb lrc1000
bash-2.05a$ createdb rli1000
»ç¿ëÀÚ °èÁ¤À» postgres ¿¡¼ globus ·Î º¯°æÇÑ ÈÄ LRC¿Í RLI À» ¿î¿µÇϴµ¥ ÇÊ¿äÇÑ Å×À̺íÀ» »ý¼ºÇÏ´Â
½ºÅ©¸³Æ®¸¦ ½ÇÇàÇÑ´Ù
[globus globus]$ psql -d lrc1000 -f $GLOBUS_LOCATION/setup/globus/globus-rls-lrc-postgres.sql
[globus globus]$ psql -d rli1000 -f $GLOBUS_LOCATION/setup/globus/globus-rls-rli-postgres.sql
iODBC ȯ°æÀ» À§ÇÏ¿© /etc/odbc.ini ÆÄÀÏÀ» ´ÙÀ½°ú °°ÀÌ »ý¼ºÇÑ´Ù
[root root]# vi /etc/odbc.ini
;
; odbc.ini
;
[ODBC Data Sources]
lrc1000 = lrc database
rli1000 = rli database
[lrc1000]
Description=LRC database
DSN=lrc1000
Servertype=postgres
Servername=localhost
Database=lrc1000
ReadOnly=no
[rli1000]
Description=RLI database
DSN=rli1000
Servertype=postgres
Servername=localhost
Database=rli1000
ReadOnly=no
[Default]
Driver = /usr/lib/libpsqlodbc.so.0
Port = 5432
postgresql ÀÌ »ç¿ëÇÏ´Â µ¿Àû¶óÀ̺귯¸®¸¦ À§ÇÏ¿© ¸¸¾à /etc/ld.so.conf ÆÄÀÏ¿¡ /usr/lib °¡ ¾ø´Ù¸é
¾Æ·¡¿Í °°ÀÌ /usr/lib ¸¦ Ãß°¡ÇÑ´Ù
[root root]# vi /etc/ld.so.conf
/usr/lib
/usr/kerberos/lib
/usr/X11R6/lib
/usr/lib/sane
/usr/lib/qt-3.0.3/lib
/usr/lib/qt-2/lib
/usr/lib/wine
/usr/local/gt3/lib
µ¿Àû ¶óÀ̺귯¸® ȯ°æÀÌ º¯°æµÇ¾úÀ¸¹Ç·Î ´ÙÀ½°ú °°ÀÌ ¹Ý¿µÇÑ´Ù
[root root]# /sbin/ldconfig
rootÀÇ È¨µð·ºÅ丮¿¡¼ /etc/odbc.ini¿¡ ´ëÇÑ ½Éº¼¸¯ ¸µÅ©¸¦ ´ÙÀ½°ú °°ÀÌ »ý¼ºÇÑ´Ù
(iODBC ÀÇ ¹ö±×·Î ÀÎÇÑ°ÍÀ¸·Î ȯ°æº¯¼ö·Î "ODBCINI=/etc/odbc.ini" ¸¦ ÁöÁ¤Çصµ
Ȩ µð·ºÅ丮¿¡¼ ".odbc.ini" ÆÄÀÏÀ» ã´Â´Ù)
[root root]# cd ~
[root root]# ln -s /etc/odbc.ini .odbc.ini
¸¶Áö¸·À¸·Î RLS ¼¹öÀÇ È¯°æ ÆÄÀÏÀ» ´ÙÀ½°ú °°ÀÌ ¼öÁ¤ÇÑ´Ù
(RLS °¡ »ç¿ëÇÒ DB °èÁ¤°ú odbc ȯ°æÆÄÀÏÀÇ À§Ä¡, LRC ¿Í RLI ÀÇ °¡µ¿ ¿©ºÎ¹× »ç¿ë DB Á¤º¸µî)
[root root]# vi $GLOBUS_LOCATION/etc/globus-rls-server.conf
# Database connection options
db_user globus
db_pwd globus
odbcini /etc/odbc.ini
# LRC options
lrc_server true
lrc_dbname lrc1000
lrc_update_immediate true # Propagate changes to RLI quickly
lrc_update_ll 120
# RLI options
rli_server true # Indicates this is an RLI server
rli_dbname rli1000 # database-name
# Access control. There may be multiple acl options, each one
# is a regular expression which is matched against the user's Distinguished
# Name in is X.509 certificate, followed by a colon and a whitespace
# separated list of privs, which are all, lrc_read, lrc_update, rli_read,
# rli_update, stats and admin. If you use a grid-mapfile to map DNs to
# local usernames you may specify those instead of DNs.
acl .*: all
# Here are all the configuration options with default values:
# acl [no default]
# authentication true
# db_pwd changethis
# db_user dbperson
# idletimeout 900
# loglevel 0
# lrc_bloomfilter_numhash 3
# lrc_bloomfilter_ratio 10
# lrc_buffer_time 30
# lrc_dbname lrc1000
# lrc_server false
# lrc_update_bf 900
# lrc_update_factor 10
# lrc_update_immediate true
# lrc_update_ll 86400
# lrc_update_retry 300
# maxbackoff 300
# maxconnections 100
# maxfreethreads 5
# maxthreads 30
# myurl rls://hostname:port
# odbcini $GLOBUS_LOCATION/var/odbc.ini
# pidfile $GLOBUS_LOCATION/var/<programname>.pid
# port 39281
# rli_bloomfilter false
# rli_bloomfilter_dir none # Use "none", "default" or dir path
# rli_dbname rli1000
# rli_expire_int 28800
# rli_expire_stale 86400
# rli_server false
# rlscertfile /etc/grid-security/hostcert.pem
# rlskeyfile /etc/grid-security/hostkey.pem
# startthreads 1
7.RLS command line ¸í·É¾î Å×½ºÆ®
¼³Ä¡°¡ ¿Ï·áµÇ¾úÀ¸´Ï RLS ¼¹ö¸¦ ½ÇÇàÇÑ´Ù
¿É¼Ç: N -> RLS Ŭ¶óÀ̾ðÆ®°¡ ÀÎÁõ°úÁ¤ ¾øÀÌ RLS ¼¹ö¿¡ Á¢±ÙÇÒ ¼ö ÀÖ´Ù. ¸¸¾à ÀÎÁõ
°úÁ¤ÀÌ ÇÊ¿äÇÏ¸é ¼¹ö ½ÃÀ۽à -N ¿É¼ÇÀ» »©°í ¶ÇÇÑ globus-rls-* ¸í·É¾îÀÇ
server À§Ä¡ ÁöÁ¤½Ã rlsn:// ´ë½Å rls:// À» »ç¿ëÇÑ´Ù
d -> debugging ¸ðµå·Î ¼¹ö ÁøÇà»óȲÀ» syslog() °¡ ÀÌ´Ñ È¸éÀ¸·Î Ãâ·Â
L 4 -> log level ·Î¼ log ÀÇ ¼¼ºÎÀûÀÎ Á¤µµ¸¦ ³ªÅ¸³»¸ç L 0 °¡ °¡Àå ÇÏÀ§ÀÌ´Ù)
[root root]# globus-rls-server -N -d -L 4
½ÇÇàµÈ RLS °¡ µ¿ÀÛÇÏ´ÂÁö RLS ping À» Çغ»´Ù
[root root]# globus-rls-admin -p rlsn://localhost
ping rlsn://localhost: 0 seconds
RLSÀÇ LRC¿¡ ¿¹Á¦·Î¼ ³í¸® ÆÄÀϸí lfn0 ¿¡ ´ëÇÑ µÎ°³ÀÇ ¹°¸® ÆÄÀϸí pfn0, pfn1 À» ³Ö´Â´Ù
(º¸Åë ³í¸® ÆÄÀϸíÀº unique ÇÑ ID ÀÇ ÇüÅÂÀÌ¸ç ¹°¸® ÆÄÀϸíÀº ½ÇÁ¦ À§Ä¡À̳ª ÆíÀÇ»ó
lfn0, pfn0 ÇüÅ·ΠÀÔ·ÂÇß´Ù)
[root root]# globus-rls-cli create lfn0 pfn0 rlsn://localhost
[root root]# globus-rls-cli add lfn0 pfn1 rlsn://localhost
RLSÀÇ LRC ¿Í RLI °¢°¢¿¡¼ lfn0 ¿¡ ´ëÇÑ ¸ÅÇÎ Á¤º¸¸¦ query Çغ»´Ù
[root root]# globus-rls-cli query lrc lfn lfn0 rlsn://localhost
lfn0: pfn0
lfn0: pfn1
[root root]# globus-rls-cli query rli lfn lfn0 rlsn://localhost
lfn0: rlsn://localhost:39281
¿©±â±îÁö´Â °¢ÀÚ º»ÀÎ host ÀÇ LRC ¿Í RLI ¸¦ Å×½ºÆ®ÇÑ ³»¿ëÀÌ°í ´ÙÀ½Àº ´Ù¸¥ host ÀÇ RLI ¿¡
º»ÀÎ hostÀÇ LRC Á¤º¸¸¦ soft update Å°´Â ¿¹Á¦¸¦ »ìÆ캻´Ù
º»ÀÎ LRC ·Î ÇÏ¿©±Ý ¿ø°ÝÁöÀÇ ´Ù¸¥ RLI ¼¹ö(rlsn://myhome.ssu.ac.kr) ¿¡ LFN->LRC ¸ÅÇÎ Á¤º¸¸¦
ÁÖ±âÀû(lrc_update_ll)À¸·Î soft update Çϵµ·Ï Áö½ÃÇÑ´Ù
[root root]# globus-rls-admin -a rlsn://myhome.ssu.ac.kr rlsn://localhost
ȯ°æ¼³Á¤¿¡¼ "lrc_update_ll 120" °ú °°ÀÌ 120ÃÊ ¸¶´Ù soft update Ç϶ó°í ¼³Á¤ ÇÏ¿´Áö¸¸
´ÙÀ½°ú °°ÀÌ Áö±Ý Áï½Ã soft update ½Ãų ¼ö ÀÖ´Ù
[root root]# globus-rls-admin -u rlsn://myhome.ssu.ac.kr rlsn://localhost
º»ÀÎÀÇ LRC Á¤º¸°¡ ¿ø°ÝÁöÀÇ RLI ¿¡ soft update µÇ¾ú´ÂÁö wildcard query ·Î È®ÀÎÇØ º»´Ù
[root root]# globus-rls-cli query wildcard lrc lfn lfn* rlsn://myhome.ssu.ac.kr
8.RLS ¿¹Á¦¼Ò½º Å×½ºÆ®
÷ºÎÇÑ ¼Ò½ºÆÄÀÏ(RLSclient.java, RLSclient.c)À» ÀÓÀÇÀÇ µð·ºÅ丮¿¡¼ ÄÄÆÄÀÏÇÏ¿© ½ÇÇàÇغ»´Ù
µÎ ¼Ò½º´Â °¢°¢ java ¿Í c ·Î ÀÛ¼ºµÈ°ÍÀÌ¸ç ½ÇÇà°á°ú´Â µ¿ÀÏÇϹǷΠºñ±³ÇÏ¸ç º¸¸é µÈ´Ù
ÀÚ¹ÙÀÇ °æ¿ì rls.jar °¡ ÇÊ¿äÇѵ¥ ÀÌ°ÍÀº RLS ¼³Ä¡½Ã $GLOBUS_LOCATION/lib ¿¡ ÀÚµ¿À¸·Î Ãß°¡µÈ´Ù
ȯ°æº¯¼ö·Î CLASSPATH=$GLOBUS_LOCATION/lib/rls.jar ¸¦ ÁöÁ¤ÇÏ¿© »ç¿ëÇÏ´ø°¡
¾Æ´Ï¸é ¾Æ·¡Ã³·³ Á÷Á¢ ¸í½ÃÇÏ¿© ÄÄÆÄÀÏ ÇÒ ¼ö ÀÖ´Ù
[root root]# javac -classpath $GLOBUS_LOCATION/lib/rls.jar RLSclient.java
[root root]# java RLSclient rlsn://localhost
GCC ÀÇ °æ¿ì´Â ¾Æ·¡¿Í °°ÀÌ ÄÄÆÄÀÏ ÇÑ´Ù
[root root]# gcc -o RLSclient RLSclient.c -I $GLOBUS_LOCATION/include/gcc32dbgpthr
-L $GLOBUS_LOCATION/lib -lglobus_rls_client_gcc32dbgpthr
[root root]# RLSclient rlsn://localhost |
|