Difference between revisions of "Service/mirrors"
m (Bernie moved page Sysadmin/Content Delivery Network to Service/mirrors) |
(→For mirror administrators: Add tutorial commands) |
||
Line 22: | Line 22: | ||
All you need is a web server with enough bandwidth to serve the files. To set up a new mirror, the site administrator needs to: | All you need is a web server with enough bandwidth to serve the files. To set up a new mirror, the site administrator needs to: | ||
− | * Set up rsync job to synchronize a copy of the files on http:// | + | * Set up rsync job to synchronize a copy of the files on http://download.sugarlabs.org onto their local system. For example copy it into ''/rsync/download.suarlabs.org/'': |
+ | |||
+ | rsync -avzh rsync://download.sugarlabs.org/pub /rsync/download.sugarlabs.org | ||
+ | |||
+ | * You can schedule it daily or more frequently, but please don't sync more often than once per hour. For example, use cron to re-sync every 2 hours (on linux): | ||
+ | |||
+ | echo "0 */2 * * * rsync -avzh rsync://download.sugarlabs.org/pub /rsync/download.sugarlabs.org" > asloSyncCronJob.txt | ||
+ | crontab asloSyncCronJob.txt | ||
+ | |||
* Publish the files via HTTP and -- if possible -- rsync. Rsync allows for efficient [http://www.mirrorbrain.org/features/#mirror-monitoring mirror monitoring] (scanning). FTP is less efficient, but still preferred over an HTTP-only mirror. | * Publish the files via HTTP and -- if possible -- rsync. Rsync allows for efficient [http://www.mirrorbrain.org/features/#mirror-monitoring mirror monitoring] (scanning). FTP is less efficient, but still preferred over an HTTP-only mirror. | ||
* Alert the [[Infrastructure_Team/Contacts|Sugar Labs System Administrators]] that they would like their mirror into rotation, including the following information in the request: | * Alert the [[Infrastructure_Team/Contacts|Sugar Labs System Administrators]] that they would like their mirror into rotation, including the following information in the request: |
Revision as of 07:04, 7 August 2014
Introduction
A content delivery network or Content Delivery Network (CDN) is a system of computers containing copies of data, placed at various points in a network so as to maximize bandwidth for access to the data from clients throughout the network. A client accesses a copy of the data near to the client, as opposed to all clients accessing the same central server, thereby causing a bottleneck near that server.
Goals
- Reduce bandwidth at primary download server.
- Improve quality of service for users.
- Move content closer to users, thus reducing latency.
Architecture
The Sugar Labs Content Delivery Network uses MirrorBrain as a redirector. The redirector, which lives in a Sugar Labs data center, keeps track of which files are available on which mirror. When a user requests a file, the redirector points the user to the correct mirror and automatically starts the file download.
Mirrors
The current list of available mirrors is available at http://mirrors.sugarlabs.org/
Setting up a new mirror
For mirror administrators
All you need is a web server with enough bandwidth to serve the files. To set up a new mirror, the site administrator needs to:
- Set up rsync job to synchronize a copy of the files on http://download.sugarlabs.org onto their local system. For example copy it into /rsync/download.suarlabs.org/:
rsync -avzh rsync://download.sugarlabs.org/pub /rsync/download.sugarlabs.org
- You can schedule it daily or more frequently, but please don't sync more often than once per hour. For example, use cron to re-sync every 2 hours (on linux):
echo "0 */2 * * * rsync -avzh rsync://download.sugarlabs.org/pub /rsync/download.sugarlabs.org" > asloSyncCronJob.txt crontab asloSyncCronJob.txt
- Publish the files via HTTP and -- if possible -- rsync. Rsync allows for efficient mirror monitoring (scanning). FTP is less efficient, but still preferred over an HTTP-only mirror.
- Alert the Sugar Labs System Administrators that they would like their mirror into rotation, including the following information in the request:
- Name and URL of the mirror operator (e.g. organization)
- Name and email address of the administrative contact
- ISO 3166-1 alpha-2 country code of the server location
- HTTP base URL of the files on the mirror (typically http://mirrors.example.org/sugarlabs/)
- rsync base URL of the files on the mirror (typically rsync://mirrors.example.org/sugarlabs/)
Please contact sysadmin AT sugarlabs DOT org if you are interested in hosting a mirror.
For Sugar Labs sysadmins
To add a new mirror to the MirrorBrain redirector:
- Choose a name for the mirror, usually the host name.
- Register the mirror with MirrorBrain:
sudo -u mirrorbrain mb new <mirror name> --operator-name <operator name> \ --operator-url <operator URL> -a <admin name> -e <admin email> \ -c <country code> -H <base HTTP URL> -R <base rsync URL> -F <base FTP URL>
- Scan and enable the mirror:
sudo -u mirrorbrain mb scan -e <mirror name>