BitTorrent

From SystemImager

Jump to: navigation, search

Contents

HOWTO: Image deployment using the BitTorrent transport

Overview

This document explains the steps to setup the BitTorrent transport with SystemImager 4.0.2.

Install BitTorrent client

Before setting up your system to use the BitTorrent transport, you should make sure that your system already has a BitTorrent client installed. For specific instructions on how to install or where to get it, see the Quick_Start_HOWTO.

Configure the BitTorrent transport

Configure the image server

  • Open the file /etc/systemimager/bittorrent.conf to validate the configuration; in particular check the following parameters:
    • BT_INTERFACE=ethi must be the correct interface to reach the client nodes
    • BT_IMAGES=image1,image2,...,imageN must contain a comma separated list of the images to be distributed via BitTorrent
    • BT_OVERRIDES=override1,override2,...,overrideM must contain a comma separated list of the overrides to be distributed via BitTorrent
    • BT_UPDATE=y|n set to y to force the synchronization of the BitTorrent data with the images and overrides content every time the daemon on the image server is restart
    • BT_COMPRESS=y|n set to y to compress the images and overrides (with gzip) before the deployment (Use this option only if your image server is a powerful machine, in particular with a recent CPU...)

Following a typical configuration to deploy 2 images (suse10 and suse10_frontend) with their overrides:

 #
 # "SystemImager"
 #
 #  Copyright (C) 2006 Andrea Righi <a.righi@cineca.it>
 #
 #  $Id: bittorrent.conf 3533 2006-04-24 20:25:59Z bli $
 #
 
 # The bittorrent tracker port.
 BT_TRACKER_PORT=6969
 
 # Tracker state file.
 BT_TRACKER_STATE=/tmp/dstate
 
 # Tracker log file.
 BT_TRACKER_LOG=/var/log/systemimager/bittorrent-tracker.log
 
 # Interface used to seed files with bittorrent.
 BT_INTERFACE=eth0
 
 # Set to yes if you want to compress the images before distributing
 # them via BitTorrent. Set to 'n' if the image server has an old CPU or
 # is not powerful in computations.
 #
 # Allowed values: y|n
 BT_COMPRESS=y
 
 # Set to yes if you want to always synchronize the BitTorrent images
 # with the chrootable images on /var/lib/systemimager/images when the
 # SystemImager BitTorrent daemon starts.
 #
 # Allowed values: y|n
 BT_UPDATE=n
 
 # Comma separated list of images to distribute with BitTorrent
 # (ex. BT_IMAGES=RHEL4_base,suse10,frontend,backend...)
 # IMPORTANT: no spaces between images!!!
 BT_IMAGES=suse10,suse10_frontend
 
 # Comma separated list of overrides to distribute with BitTorrent
 # (ex. BT_OVERRIDES=RHEL4_base,suse10,frontend,backend...)
 # IMPORTANT: no spaces between overrides!!!
 BT_OVERRIDES=suse10,suse10_frontend
  • Start the BitTorrent daemon on the image server:
 # /etc/init.d/systemimager-bittorrent start

Configure the clients to use BitTorrent

Define the following option in the kernel boot parameters:

 BITTORRENT=y

Typically you need to edit the file /etc/systemimager/pxelinux.cfg/syslinux.cfg and add that option to the kernel boot arguments if you have configured a boot server. See the following example:

 DEFAULT systemimager
 
 #
 # Uncomment next line to send pxelinux boot prompt over serial port 0.
 # NOTE: Be sure your serial port speed is appropriate (57600, 9600, etc.)
 #
 #SERIAL 0 57600
 DISPLAY message.txt
 PROMPT 1
 TIMEOUT 50
 
 # Add the following to the append line above to use your first serial port
 # (ttyS0) as a console in addition to your monitor (tty0).  NOTE: Be sure
 # your serial port speed is appropriate (57600, 9600, etc.)
 #
 #console=ttyS0,57600
 
 # Add the following to the append line above to increase the size of your tmpfs
 # filesystem.  About 100MB larger than your image size should suffice.
 #
 # Other tmpfs mount options are also supported.  See the FAQ for details.
 #tmpfs_size=800M
 
 LABEL systemimager
 KERNEL kernel
 APPEND vga=extended initrd=initrd.img root=/dev/ram BITTORRENT=y MONITOR_SERVER=172.16.36.1 MONITOR_CONSOLE=yes

Last step: boot the clients and enjoy the autoinstallation! ;-)

Benchmark

SystemImager has been used to image a cluster of 1190 clients (IBM Blade LS21) over a 1Gb/s interconnect link: a 2.7GB RHEL5.1 x86_64 OS image has been delivered to all the clients in only 15min!!!

(Note: this means that after 15 minutes we were able to ssh and submit jobs to the nodes).

SystemImager Image Server config

Model: IBM e326m
RAM: 4GB
CPU: 2 AMD Opteron(tm) Processor 252 2.6GHz
Network card: Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet
OS: RHEL 5.1 (x86_64)

Client config

Model: IBM BladeCenter LS21
RAM: 8GB
CPU: 2 Dual-Core AMD Opteron(tm) Processor 2216HE 2.4GHz
Network card: Broadcom Corporation NetXtreme II BCM5706S Gigabit Ethernet

Network config

Network: IBM BladeCenter LS21 switches + 2 external CISCO Catalyst 6513 switches

Image

OS: RHEL 5.1 (size: 2.7GB)

Results

Per-client download rate:

systemimager-bittorrent-1190-clients.png

Aggregated bandwidth:

systemimager-bittorrent-1190-clients-aggregated.png

Thanks to CINECA for granting us dedicated access to a large compute cluster to perform this benchmark.

Important notes

When you perform some changes into an image deployed via BitTorrent (manually or using si_getimage - see man si_getimage for more information) remember to force a synchronization of the BitTorrent repository. To do so, simply change the value BT_UPDATE=y in /etc/systemimager/bittorrent.conf and restart the BitTorrent deamon:

 # /etc/init.d/systemimager-server-bittorrent restart

Then if you don't want to re-create the repository at each restart of the daemon change it to BT_UPDATE=n.

See also

Personal tools