Projet

Général

Profil

MiroirEOLE » Historique » Version 5

« Précédent - Version 5/10 (diff) - Suivant » - Version actuelle
Daniel Dehennin, 10/02/2015 14:41


Mise en place d’un miroir des dépôts de paquet

Introduction

Ce document décrit comment créer un miroir local des dépôts Ubuntu et EOLE.

La méta-distribution EOLE se compose de deux sources de paquets:

1. Les paquets de la distribution Ubuntu, nécessite à ce jour environ 600Gio d’espace disque ;

2. Les paquets du projet EOLE, nécessite à ce jour environ 15Gio d’espace disque.

La mise en place d’un miroir ce fait donc en deux étapes.

Miroir Ubuntu

La mise en place d’un miroir Ubuntu est faisable avec l’outil ubumirror en appliquant les patchs fournis en réponse aux bugs 663992 et 939379

La configuration utilisée par le projet EOLE est la suivante

#
#   ubumirror.conf - configuration file for the ubumirror scripts.
#

# Please set the variables below to fit your site.
# Which email address/user that will receive failure notices.
EMAIL=mirror-admin@exemple.net

# Server's FQDN.
HOSTNAME=$(hostname -f)

# Bandwidth limit for all mirror scripts - set to 0 for no limit.
SPEED=10240

# UBUARC_DIR is the destination for the base of the archive directory
# The script won't run if this variable isn't set
UBUARC_DIR="/home/ftp/mirror/ubuntu/" 

# UBUCDI_DIR is the destination for the base of the cdimage directory
# The script won't run if this variable isn't set
#UBUCDI_DIR="/srv/mirror/ubuntu-cdimage" 

# UBUREL_DIR is the destination for the base of the releases directory
# The script won't run if this variable isn't set
#UBUREL_DIR="/srv/mirror/ubuntu-releases" 

# UBUPOR_DIR is the destination for the base of the ports directory
# The script (ubuports) won't run if this variable isn't set
#UBUPOR_DIR="/srv/mirror/ubuntu-ports" 

# LOGDIR is the destination directory of all the logs
LOGDIR="/hom/ftp/mirror/log.d/ubumirror/" 

# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
#   upstream mirrors where the ubumirror scripts will mirror from.
UBUARC_MIRROR=ftp.crihan.fr::ubuntu/
# UBUCDI_MIRROR=cdimage.ubuntu.com::cdimage/
# UBUREL_MIRROR=rsync.releases.ubuntu.com::releases/
# UBUPOR_MIRROR=ports.ubuntu.com::ubuntu-ports/

# UBUCDI_FLAVOURS is the set of image flavours to pull from UBICDI_MIRROR
# flavour names must match directory names on the mirror
# UBUCDI_FLAVOURS="\
#   daily daily-live \
#   ubuntu-netbook/daily-live ubuntu-server/daily \
# " 

# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
UBUARC_EXCLUDE="\
 --exclude binary-powerpc/ --exclude binary-sparc/ \
 --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
 --exclude installer-powerpc/ --exclude installer-sparc/ \
 --exclude *_powerpc.deb --exclude *_powerpc.udeb \
 --exclude *_sparc.deb --exclude *_sparc.udeb \
 --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
 --exclude pool/local \
" 
UBUCDI_EXCLUDE="\
#  --exclude *-powerpc.* --exclude *-sparc.* \
#  --exclude source/ \
" 
UBUREL_EXCLUDE="\
#  --exclude *-powerpc.* --exclude *-sparc.* \
" 
UBUPOR_EXCLUDE="\
#  --exclude binary-powerpc/ --exclude binary-sparc/ \
#  --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
#  --exclude installer-powerpc/ --exclude installer-sparc/ \
#  --exclude *_powerpc.deb --exclude *_powerpc.udeb \
#  --exclude *_sparc.deb --exclude *_sparc.udeb \
#  --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
" 

Miroir EOLE 2.4 et plus

La mise en place d’un miroir EOLE pour les versions 2.4 et plus est faisable avec l’outil ubumirror en appliquant les patchs fournis en réponse aux bugs 663992 et 939379

Vous pouvez baser votre configuration sur le modèle suivant :

#
#   ubumirror.conf - configuration file for the ubumirror scripts.
#

# Please set the variables below to fit your site.
# Which email address/user that will receive failure notices.
EMAIL=mirror-admin@exemple.net

# Server's FQDN.
HOSTNAME=$(hostname -f)

# Bandwidth limit for all mirror scripts - set to 0 for no limit.
SPEED=10240

# UBUARC_DIR is the destination for the base of the archive directory
# The script won't run if this variable isn't set
UBUARC_DIR="/home/ftp/mirror/eole/" 

# UBUCDI_DIR is the destination for the base of the cdimage directory
# The script won't run if this variable isn't set
#UBUCDI_DIR="/srv/mirror/ubuntu-cdimage" 

# UBUREL_DIR is the destination for the base of the releases directory
# The script won't run if this variable isn't set
#UBUREL_DIR="/srv/mirror/ubuntu-releases" 

# UBUPOR_DIR is the destination for the base of the ports directory
# The script (ubuports) won't run if this variable isn't set
#UBUPOR_DIR="/srv/mirror/ubuntu-ports" 

# LOGDIR is the destination directory of all the logs
LOGDIR="/home/ftp/mirror/log.d/ubumirror/" 

# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
#   upstream mirrors where the ubumirror scripts will mirror from.
UBUARC_MIRROR=rsync://eole.ac-dijon.fr/eole/
# UBUCDI_MIRROR=cdimage.ubuntu.com::cdimage/
# UBUREL_MIRROR=rsync.releases.ubuntu.com::releases/
# UBUPOR_MIRROR=ports.ubuntu.com::ubuntu-ports/

# UBUCDI_FLAVOURS is the set of image flavours to pull from UBICDI_MIRROR
# flavour names must match directory names on the mirror
# UBUCDI_FLAVOURS="\
#   daily daily-live \
#   ubuntu-netbook/daily-live ubuntu-server/daily \
# " 

# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
UBUARC_EXCLUDE="" 
UBUCDI_EXCLUDE="\
#  --exclude *-powerpc.* --exclude *-sparc.* \
#  --exclude source/ \
" 
UBUREL_EXCLUDE="\
#  --exclude *-powerpc.* --exclude *-sparc.* \
" 
UBUPOR_EXCLUDE="\
#  --exclude binary-powerpc/ --exclude binary-sparc/ \
#  --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ \
#  --exclude installer-powerpc/ --exclude installer-sparc/ \
#  --exclude *_powerpc.deb --exclude *_powerpc.udeb \
#  --exclude *_sparc.deb --exclude *_sparc.udeb \
#  --exclude Contents-powerpc.gz --exclude Contents-sparc.gz \
" 

Miroir EOLE 2.3

La mise en place d’un miroir EOLE requiert une autorisation réseau préalable à adresser à l’équipe EOLE, vous devez donc nous communiquer l’adresse IP qui sera utilisée par votre serveur miroir.

La récupération des paquets EOLE jusqu’à la version 2.3 se fait avec le script suivant :

#!/bin/bash

set -e -u

MIRROR_SRC="eoleng.ac-dijon.fr::eoleng" 
MIRROR_DST="/home/ftp/mirror/eoleng" 
MIRROR_LOG_DIR="/home/ftp/mirror/log.d/eoleng" 
MIRROR_LOG_FILE="${MIRROR_LOG_DIR}/eole.log" 

RSYNC_OPTS="-v --force --recursive --times --perms --links --delete-after" 
RSYNC_EXCLUDE="--exclude mini-dinstall --exclude *.changes" 

test -d "${MIRROR_LOG_DIR}" || mkdir -p "${MIRROR_LOG_DIR}" 
savelog -t -n -r "${MIRROR_LOG_DIR}" "${MIRROR_LOG_FILE}" 

rsync ${RSYNC_OPTS} ${RSYNC_EXCLUDE} ${MIRROR_SRC} ${MIRROR_DST} | tee -a "${MIRROR_LOG_FILE}" 

Vous pouvez ensuite planifier une tâche cron comme suit:

SHELL=/bin/bash
PATH=~/.bin:/usr/bin:/bin
MAILTO=mirror-admin@example.net

0 5 * * * mirror-eole.sh > /dev/null

Publication de votre miroir

Il ne vous reste plus qu’à configurer un service HTTP ou FTP afin de rendre votre miroir accessible.