4 Setting Up eMerge Databases on Linux
Transcript of 4 Setting Up eMerge Databases on Linux
-
8/13/2019 4 Setting Up eMerge Databases on Linux
1/16
Setting up eMerge Databases
On Linux
Revision 2.4
24 June 2009
Copyright Opportunity International Not for Distribution
-
8/13/2019 4 Setting Up eMerge Databases on Linux
2/16
1 OVERVIE ........................................................................................................ !
2 "SS#M$%IO&S "&D DE'I&I%IO&S ............................................................................. !
! $RE$"RE I&S%"LL"%IO& MEDI" .............................................................................. !
!.1 D"%"("SE)I%O&'%$ SERVER.................................................................................!
!.2 D"%"("SE)I%O&*D+ROM DIS*...............................................................................4
!.! D"%"("SE)I%O&I&DOSS,"RE.............................................................................-
3.3.1 OPTION1: CONNECTTOWINDOW!"#E"ND#ET#IE$ET!E%I&E.............................................'
3.3.( OPTION(: )O*NTT!EWINDOW!"#E"NDCOP+T!E%I&E..................................................,
4 #&$"*) I&S%"LL"%IO& MEDI" ...............................................................................
4.1 #&$"*)"%"R/I$ 'ILE......................................................................................
4.2 #&$"*)"%"R/(I$2 'ILE....................................................................................
4.! #&$"*)"I$ 'ILE..............................................................................................4.4 #&$"*)"R"R 'ILE.............................................................................................
- *RE"%E D"%"("SE #SER ...................................................................................... 3
SE% #$ $ERMISSIO&S ........................................................................................... 9
DO*#ME&% ,IS%OR .......................................................................................... 1
1-//'1(-.0o Page ( of 1,
-
8/13/2019 4 Setting Up eMerge Databases on Linux
3/16
1 Overvie5This 0ou2ent 0etails the steps reuire0 to set up an e)erge 0atabase on a &inu4 ser5er.
2 "ssu6ptions an7 De8initionsIt is assu2e0 that the rea0er has basi &inu46*NI7 8no9le0ge as 9ell as syste2 a02inistrators8ills.
#euire2ents regar0ing the ser5er that is to be installe0 are outline0 belo9 in the installationprereuisites setion.
The shell ;sreenshots< belo9 outline user input in blue bol0 9hile o2puter output is in 0ar8blue regular font.
%or the sa8e of this 0ou2ent 9e 9ill be setting up a 0atabase na2e0 ;train 0oso2ething li8e:
[root@dscrht24023 root]# cd /emerge
[root@dscrht24023 emerge]#mkdir database
[root@dscrht24023 emerge]# cd database/
[root@dscrht24023 database]#mkdir train
[root@dscrht24023 database]# cd train[root@dscrht24023 train]#
! $repare Instaation Me7ia*sually the installation 2e0ia for a ne9 0atabase 9ill o2e as a o2presse0 file. This an eitherbe a stan0ar0 *ni4 arhi5e =T"#6?@IP i.e. .tar.@ .tar.gA .taA .tgA> @ip for2at =.Aip> or e5en #"#=.rar>.
E4ept for unusual iru2stanes the 0atabase 8it 9ill be a5ailable on either one of the follo9ing:
B %TP ser5er
B CDB#O) 0isB Win0o9s PC share0 fol0er
elo9 are a fe9 pointers on ho9 to 0eal 9ith eah of these situations.
3.1 Database Kit on FTP Server
To retrie5e the 8it you an use the ;ftp< tool 9hih beha5es e4atly as the o22an0 line ftp toolin Win0o9s =9hih 9as of ourse base0 on the *ni4 5ersion>.
[root@dscrht24023 train]# ftp your.ftp.server.com
Connected to your.ftp.server.com.220 (vs!"d ..3$
1-//'1(-.0o Page 3 of 1,
-
8/13/2019 4 Setting Up eMerge Databases on Linux
4/16
%30 "&ease &ogin 'ith )*+ and ",)).
%30 "&ease &ogin 'ith )*+ and ",)).
-*+*+/)14 reected as an authentication type
ame (your.ftp.server.comroot$ test
33 "&ease specify the pass'ord.
"ass'ord
230 5ogin successfu&. 6ave fun.
+emote system type is 78.
sing binary mode to transfer fi&es.
ftp9 cd database
2%0 :irectory successfu&&y changed.
ftp9 ls
22; *ntering "assive =3=4>=223=34$
%0 6ere comes the directory &isting.
?r'?r??r?? 0 4 4 2%2340A> ,ug % 230 train.tar.gz
22> :irectory send /-.
ftp9 get train.tar.gz
&oca& train.tar.gB remote train.tar.gB
22; *ntering "assive =3=4>=%=20$
%0 /pening 7,+ mode data connection for train.tar.gB (2%2340A>bytes$.
22> i&e send /-.
2%2340A> bytes received in 2%0.032 seconds (.eD02 -bytesEs$
ftp9 quit
22 Foodbye.
3.2 Database Kit on CD-ROM Disc
*nli8e 9ith Win0o9s in or0er to aess re2o5able 2e0ia you nee0 to ;2ount< the appropriate0e5ie. This applies to loal 0ri5es suh as CDB#O) or * flash0ri5e but also to net9or8 0ri5ese.g. Win0o9s shares. Well only o5er the first ase here.
Nor2ally if you insert the CDB#O) into the ser5er 0ri5e the CDB#O) unit shoul0 be 2ounte0auto2atially =un0er ;62nt60ro2< in #e0 !at> but if this not happens you an 0o this 2anually.Then you si2ply nee0 to opy the file aross.
[root@dscrht24023 train]# ls /mnt/cdrom
[root@dscrht24023 train]#mount /mnt/cdrom
[root@dscrht24023 train]# ls /mnt/cdrom
train.tar.gB
[root@dscrht24023 train]# cp /mnt/cdrom/train.tar.gz .
G!o eect the C:?+/< you 'i&& need to unmount the drive= other'ise it 'i&&be &ocHed9
[root@dscrht24023 train]# umount /mnt/cdrom
1-//'1(-.0o Page / of 1,
-
8/13/2019 4 Setting Up eMerge Databases on Linux
5/16
3.3 Database Kit on Windows Share
This is the 2ore o2ple4 9ay of getting the ob 0one. +ou ha5e t9o options here: you an use aftpBli8e tool for onneting to the Win0o9s share an0 na5igating to the file then retrie5ing it oryou an 2ount the entire share into a *ni4 0iretory =li8e 9ith the CDB#O) in the pre5ious step>an0 then opy the file as if it 9as loal.
3.3.1 Otion 1! Connect to Windows Share and Retrieve the Fi"e
We 9ill assu2e that this share is the 0efault ;DF< share on a o2puter 9ith IP ;1G.1.1.((
-
8/13/2019 4 Setting Up eMerge Databases on Linux
6/16
3.3.2 Otion 2! Mo#nt the Windows Share and Co$ the Fi"e
"ssu2ing the sa2e setup as abo5e the o22an0s are:
-
8/13/2019 4 Setting Up eMerge Databases on Linux
7/16
bnHE."F.
With ;9getErpmforgeE+".rpm [fo&&o'ing]
??23;??httpEErpmforge.s'.beEredhatEe&%EenEi3>ErpmforgeE+".rpm+eso&ving rpmforge.s'.be... 30.33.3%.>
1-//'1(-.0o Page L of 1,
http://dag.wieers.com/packages/unrar/http://dag.wieers.com/packages/unrar/ -
8/13/2019 4 Setting Up eMerge Databases on Linux
8/16
Connecting to rpmforge.s'.beM30.33.3%.>M0... connected.
6!!" reNuest sent= a'aiting response... 200 /-
5ength 33>> (-$ [app&icationEO?rpm]
)aving to Punrar?3.;.4?.e&%.rf.i3>.rpmQ
00R[IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII9] 3=3>> 3;%-Es in0.3s
23 (3;% -Es$ ? Punrar?3.;.4?.e&%.rf.i3>.rpmQ saved[33>>E33>>]
[root@dscrht24023 train]# rpm #i unrar..1.el3.rf.i45.rpm
'arning unrar?3.;.4?.e&%.rf.i3>.rpm 6eader 13 :), signature /-*=Hey 7: >bd;Ae>
Des8top or M$T>. This reuires a user on the re2ote2ahine 9hih on one han0 pro5i0e an e4tra le5el of seurity =sine you 9ill nee0 a pass9or0 tologin 9ith it> an0 on the other han0 it perfor2s the e4tre2ely useful ation of establishing the
lin8 to the 0atabase.
1-//'1(-.0o Page of 1,
-
8/13/2019 4 Setting Up eMerge Databases on Linux
9/16
"gain li8e in Win0o9s in *ni4 a file an ha5e user an0 group per2issions. "t this point if youha5ent alrea0y reate0 a group ust for e)erge 0atabases 9e strongly reo22en0 0oing so. Thispro5i0es an e4tra le5el of seurity for e)erge 0atabases sine you 9ill be able to set per2issionsin suh a 9ay that 0atabases users an rossBaess 0ifferent 0atabases but other users in thesyste2 9ill not be able to aess any 0atabase at all.
To reate this group =9ell all it ;e2erge issue this o22an0:
[root@dscrht24023 train]# groupadd emerge
To reate a 0atabase user na2e0 ;train
-
8/13/2019 4 Setting Up eMerge Databases on Linux
10/16
-
8/13/2019 4 Setting Up eMerge Databases on Linux
11/16
# #### ###### # # ##### #######
#
# )et up the port= if it ever goes 'i&d= then typing a sing&e W8W
# shou&d hopefu&&y put it bacH= using the seNuence Ctr&?X (YX$= 8= Ctr&?X(YX$
# 'hereby Ctr&?X means ne' &ine.
#
# Certain contro& characters used in some system stty settings may c&ash'ith
# contro& characters used 'ithin the X*:EX)6 programs= thus maHing thefunction
# appear not to 'orH. 7n this case the c&ashing stty settings can besafe&y set
# to undefined thus a&&o'ing the contro& character to be processed byX*:EX)6.
# e.g. ndefine stty Wf&ushW character. stty f&ush Y?= 'here Y is uparro'
and# ? is the minus character. ,&ternative&y X*: can be configured to usea&ternative
# contro& characters via the .edsrc fi&e. )ee Hno'&edge base.
#
# stty intr YC Hi&& YZ icanon opost echo echoe echoH on&cr ?&case tab3
#
# undefine common stty settings to avoid c&ash 'ith some terminfo and edcontro&s
stty Nuit Y? susp Y? erase Yh
a&ias 8IWstty T(stty ?g$W
#
#
# !o set the defau&t umasH to 002. !his a&&o's the C+*,!*?75* to createfi&es 'ith
# defau&t permissions of >>4. i.e. r'?r'?r??.
# +eadEJrite ser= +eadEJrite Froup= +ead/n&y /thers
# !his enab&es fi&e access permissions to be more easi&y contro&&ed viauser groups.
# ,&so in the case of net'orH fi&e access= uniO &ocHs reNuired readE'riteaccess.
#
#umasH 002
#
#
eOport !*+
-
8/13/2019 4 Setting Up eMerge Databases on Linux
12/16
#
# defau&t to vi editor and vi options and cd to home
17),5IEusrEbinEvi
set ?o vi
#
#
# )et up the directory of 'here ,)* is being run from.
# !he XC+*5*,)*:7+ sho's 'here the eOecutab&es= &ibraries= scripts etc.
# can be found for the particu&ar re&ease you 'ant to run. !he
# XCF5/,5:7+ sho's 'here a fe' of the g&oba& constants can be
# found= such as the configuration fi&e for the record &ocHing
# mechanism ?? these shou&d be common to a&& re&eases running on
# the same system
#
# 7f undefined= they 'i&& resort to EusrEbc as a defau&t. 6o'ever= they
# are initia&ised in this script to the defau&t= so that if you move
# to another test re&ease at a &ater stage= it maHes it very easy to
# update the XC+*5*,)*:7+ variab&e to say EusrEtestbc and a&& the
# other variab&es fa&& in to p&ace.
#
e+port EFG?HIH">HD(?*/usr/,bc
eOport XCF5/,5:7+ITXC+*5*,)*:7+
#
#
# )et up the shared obect fi&e name 'here 'e 'i&& reso&ve
# a&& the ca&&s to subroutines made via. the C,55 @1ar($ statements.# !he defau&t is T6/
-
8/13/2019 4 Setting Up eMerge Databases on Linux
13/16
#
eOport EFG'FEHG7I(>7*$J'%H/globuspatclib$J'%H/locallib$J'%H/lib$J'%H/globuslib
#
#
# :uring the search for a shared obect= if an obect is specified
# 'ithout a path component= e.g. W&ibsubroutines.soW = then ,78
# 'i&& use 57",!6 to find out 'hat directory the obect is in=
# and )1+4 systems 'i&& use 5:57+,+",!6 and 6"8 the )657",!6.
#
eOport X+*:7+ITXC+*5*,)*:7+EdHEre
eOport X+*57ITXC+*5*,)*:7+EdHEreE&ibTXC+*5*,)*:7+EdHEreE&ibEp&atform
eOport 5:57+,+",!6ITXC+*5*,)*:7+E&ibTX+*57EusrEccsE&ibEusrE&ib
#eOport 57",!6ITXC+*5*,)*:7+E&ibTX+*57EusrEccsE&ibEusrE&ib
#eOport )657",!6ITXC+*5*,)*:7+E&ibTX+*57TU)657",!6?EusrE&ibE&ibV#
#
# )et up path of 'here to find data fi&es. y defau&t if the X*:775*",!6
# is not set then fi&es 'i&& be &ooHed for first in the T6/&>7H%
#
#
# )etup the niO ",!6 environment variab&e. !his variab&e specifies the&ocation and
# order in 'hich directories 'i&& be search to find the command &ine
eOecutab&e.#
1-//'1(-.0o Page 13 of 1,
-
8/13/2019 4 Setting Up eMerge Databases on Linux
14/16
e+port K"7J*$EFG?HIH">HD(?/bin$EFG?HIH">HD(?/config$K"7J.$J'%H/globuspatcbin$J'%H/localbin$J'%H/bin$J'%H/globusbin
#
#
# !o see ,)* man pages enab&e and eOport the H7%K*$J'%H/,F">H'?O/tmp
-
8/13/2019 4 Setting Up eMerge Databases on Linux
15/16
eOport XC5/C-5,)!C5/)*I
#
#
# ou can no' start to add any ,)* programs in your .profi&e at thisstage.
# !*+< 0=0====32=>0
# )"?,))7F I"+7!+/78
#
# o' 'e 'orH out if 'e 'ant to go straight into F5/) or go to ,)*
#
# 7f you 'ish to use /) on&ine via *.,!/.77!."+/C*))= uncomment
# the fo&&o'ing four &ines of script
# irst 'e checH if there are any auto processes to run. !he program
# *.,!/.77!."+/C*)) checHs the tab&e *.,!/."+/C*)) for a record
# 'ith an id of the user. 7f this is found (defined in /).)/+C*$
# the *.,!/.77!."+/C*)) 'i&& run the routine= an u&timate&y &ogout# Jhere nothing is found= the routine terminates norma&&y.
# 6ence 'e eOamine the TZ code. , non Bero seems to indicate that the
# process :7: something= so get out. !his 'i&& need to be tested
# on a site by site basis.
#
PHF."!7'.()(7.K?'GH>>
P if 8 $Q R* 0 9: ten
P e+it
P fi
#
# o' 'e asH our traditiona& Nuestion.
#
#echo WKn)!,+! F5/) EIKcW
#read ans'er
#
# 7f 'e 'ant to start F5/)= do so and then eOit. !his prevents
# a$ !oo many processes being spa'ned and
# b$ "rocesses being &eft WhangingW
#
#if [ WTans'erW I ?o WTans'erW I y ]^ then
# start F5/) hereS
# *).!*+HD(?/bin/,pqn $EHD(L(IH)"%H
-
8/13/2019 4 Setting Up eMerge Databases on Linux
16/16
$EFG?HIH">HD(?/bin/,pqn $EHD(L(IH)"%HH7%K9D 2= /dev/null
e+it
Do:u6ent ,istor=Date "ut