Presentation is loading. Please wait.

Presentation is loading. Please wait.

The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) 马兰馨 IHEP, CAS Setting Up a Repository.

Similar presentations


Presentation on theme: "The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) 马兰馨 IHEP, CAS Setting Up a Repository."— Presentation transcript:

1 www.epikh.eu The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) 马兰馨 IHEP, CAS ma@ihep.ac.cn Setting Up a Repository

2 Why? –gLite includes a large number of tools and software to download –Download from remote servers can require too much time When – Many server to install  Large server farms  Training events – Slow connection How? – gLite repository are managed by mrepo tool 2 A repository

3 The mrepo service retrieves rpms from mirror sites and creates a repository with APT-YUM meta-data Manages the local APT and YUM repository for OS and middleware Requires the configuration of both: mrepo and httpd service Supports for ftp, http, sftp, rsync, rhn and other protocals 3 MREPO

4 Prepare a Scientific Linux 5.x machine Retrieve the mrepo package and install it –Package from(Use the el5 version of the package): wget http://linuxsoft.cern.ch/dag/redhat/el5/en/x86_64/dag/RPMS/mrepo-0.8.7- 1.el5.rf.noarch.rpm –Install with: rpm -Uvh –Ensure that createrepo and httpd rpms are installed on your system wget http://linuxsoft.cern.ch/dag/redhat/el5/en/x86_64/dag/RPMS/createrepo-0.4.10- 1.el5.rf.noarch.rpmhttp://linuxsoft.cern.ch/dag/redhat/el5/en/x86_64/dag/RPMS/createrepo-0.4.10- 1.el5.rf.noarch.rpm 4 Repository Installation

5 Modify the mrepo script, since the path to the comps.xml file is not composed properly *** /usr/bin/mrepo 2010-03-22 01:57:41.000000000 +0100 --- mrepo.modified 2010-07-04 20:58:02.000000000 +0200 *************** *** 845,851 **** repoopts = repoopts + ' --cachedir "%s"' % cachedir if os.path.isdir(os.path.join(self.wwwdir, '.olddata')): remove(os.path.join(self.wwwdir, '.olddata')) ! groupfile = os.path.join(cf.srcdir, self.dist.nick, self.name + '-comps.xml') if os.path.isfile(groupfile): symlink(groupfile, os.path.join(self.wwwdir, 'comps.xml')) repoopts = repoopts + ' --groupfile "%s"' % groupfilename --- 845,853 ---- repoopts = repoopts + ' --cachedir "%s"' % cachedir if os.path.isdir(os.path.join(self.wwwdir, '.olddata')): remove(os.path.join(self.wwwdir, '.olddata')) ! # groupfile = os.path.join(cf.srcdir, self.dist.nick, self.name + '-comps.xml') ! groupfile = os.path.join(cf.srcdir, self.dist.nick, self.name + '/comps.xml') ! info(2, 'Groupfile: %s' % (groupfile)) if os.path.isfile(groupfile): symlink(groupfile, os.path.join(self.wwwdir, 'comps.xml')) repoopts = repoopts + ' --groupfile "%s"' % groupfilename 5 mrepo Script

6 /etc/mrepo.conf ### The [main] section allows to override mrepo's default settings ### The mrepo-example.conf gives an overview of all the possible settings [main] srcdir = /var/mrepo wwwdir = /var/www/mrepo confdir = /etc/mrepo.conf.d arch = i386 x86_64 metadata=yum repomd lftp-mirror-options = -c -X "*/Fermi/*" -X "*/example/*" #lftp-mirror-options = -c -P=10 -X "*/Fermi/*" -X "*/example/*" createrepo-options = -d –p #(If you mirrot from infngrid, add it) mailto = root@localhost smtp-server = localhost #rhnlogin = username:password 6 General Settings

7 /etc/mrepo.conf ### The [main] section allows to override mrepo's default settings ### The mrepo-example.conf gives an overview of all the possible settings [main] srcdir = /var/mrepo wwwdir = /var/www/mrepo confdir = /etc/mrepo.conf.d arch = i386 x86_64 metadata=yum repomd lftp-mirror-options = -c -X "*/Fermi/*" -X "*/example/*" #lftp-mirror-options = -c -P=10 -X "*/Fermi/*" -X "*/example/*" createrepo-options = -d –p (if you mirror the InfnGrid repositories, add this line) mailto = root@localhost smtp-server = localhost #rhnlogin = username:password 7 General Settings

8 /etc/mrepo.conf.d/ca.conf ### CA repository [ca] name = lcg-ca arch = noarch production = http://linuxsoft.cern.ch/LCG-CAs/current/RPMS.productionhttp://linuxsoft.cern.ch/LCG-CAs/current/RPMS.production Mrepo will create: http:// /mrepo/ca-noarch 8 Specific configuration

9 /etc/mrepo.conf.d/glite32.gridit.conf ### ### gLite Middleware 3.2 ### [glite_ig_sl5] name = gLite Middleware (R3.2 - x86_64) release = R3.2 arch = x86_64 ### Official repositories (https://twiki.cern.ch/twiki/bin/view/LCG/GenericInstallGuide310) # Generic Repositories generic-externals = http://grid-it.cnaf.infn.it/mrepo/glite_sl5-x86_64/RPMS.generic-externals/ generic-release = http://grid-it.cnaf.infn.it/mrepo/glite_sl5-x86_64/RPMS.generic-release/ generic-updates = http://grid-it.cnaf.infn.it/mrepo/glite_sl5-x86_64/RPMS.generic-updates/ Mrepo will create: http:// /mrepo/glite_sl5-x86_64/RPMS.generic-externals http:// /mrepo/glite_sl5-x86_64/RPMS. release http:// /mrepo/glite_sl5-x86_64/RPMS.generic-updates 9 Specific configuration

10 mrepo command options -c, –config=file specify alternative configfile -g, –generate generate mrepo repositories -q, –quiet minimal output -r, –repo=repo1,repo2 restrict action to specific repositories -u, –update fetch updates -v, –verbose increase verbosity (only mrepo info) -vv, -vvv increase verbosity more Example mrepo –guvv mrepo -gvv mrepo –uvv mrepo -guvv gilda sl4 mrepo -guvv -r app 10 MREPO Usage

11 mrepo command options -c, –config=file specify alternative configfile -g, –generate generate mrepo repositories -q, –quiet minimal output -r, –repo=repo1,repo2 restrict action to specific repositories -u, –update fetch updates -v, –verbose increase verbosity (only mrepo info) -vv, -vvv increase verbosity more Example mrepo –guvv mrepo -gvv mrepo –uvv mrepo -guvv gilda sl4 mrepo -guvv -r app 11 MREPO Usage

12 MREPO support the creation of several set of metadata for the clients – apt, yum and repomd supported Tools creating the additional metadata should be installed in the system – apt requires genbasedir binary from apt package – yum < 2.4 requires yum-arch binary from yum package – repomd for apt>=0.5.15lorg and yum>=2.4 requires createrepo binary from createrepo package 12 MREPO Metadata

13 Example [root@gilda09 repodata]# ls /var/www/mrepo/ca-current/RPMS.production/repodata filelists.sqlite.bz2 filelists.xml.gz other.sqlite.bz2 other.xml.gz primary.sqlite.bz2 primary.xml.gz repomd.xml 13 MREPO Metadata

14 Example –Apache web server manages the web interface –Mrepo package installs a own configuration file for http in order to define its urls: /etc/httpd/conf.d/mrepo.conf –The default repository web directory is /var/www/mrepo – Add it to the automatic boot and start the service  In SL5 you can use the following commands: /sbin/chkconfig httpd on /sbin/service httpd start 14 WEB server configuration

15 Verify that mrepo installation created a crontab under /etc/cron.d like this one: ### Enable this if you want mrepo to daily synchronize ### your distributions and repositories at 2:30am. 30 2 * * * root echo "### Mrepo running on: "`date` >> /var/log/mrepo.log 2>&1 ; /usr/bin/mrepo -ugfv >> /var/log/mrepo.log 2>&1 15 Update repo

16 The machine has to be configure with your repository – E.g. using yum you need to create a repo file in /etc/yum.repos.d/.repo Repo file example –more /etc/yum.repos.d/lcg-ca.repo # # CA repository # [CAs] name = CAs baseurl = http://linuxsoft.cern.ch/LCG-CAs/current enabled = 1 protect = 0 –yum install lcg-CA 16 Using your repo

17 Official MREPO web page http://dag.wieers.com/home-made/mrepo/ 17 Reference

18 Official MREPO web page http://dag.wieers.com/home-made/mrepo/ 18

19 19


Download ppt "The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) 马兰馨 IHEP, CAS Setting Up a Repository."

Similar presentations


Ads by Google