ClearFoundation

Documentation Howtos Creating A Local Mirror

Creating A Local Mirror

Overview

Keeping a local mirror of ClearOS can be useful in some circumstances. This document provides a quick guide on how to implement one.

Local Mirror

This document is intended for the ClearOS 5.x releases. The software repository structure in ClearOS 6.0 and later is significantly different.

Find and Allocate Disk Space

You can expect the ClearOS 5.x releases to take up about 20 GB before the version reaches its end of life. So the first step in creating a local mirror is to find and allocate the necessary disk space on your system. If you are using ClearOS, you can use a Flexshare for this task. In our example, we have created a Flexshare called mirrors and made sure Web access was enabled. On the file system, the mirror directory defaults to /var/flexshares/shares/mirrors.

Download / Synchronize

Now that you have a mirror directory all set up, it's time to start the first synchronize. Good old rsync is the tool of choice for this task, so you will need to make sure it has been installed:

yum install rsync

For ClearOS, there are two distinct mirrors that need to be kept synchronized:

MirrorDescription
clearosThe ClearOS RPMs
clearcentosThe slimmed down CentOS mirror

To synchronize the ClearOS download servers with the local Flexshare mirror, run:

rsync -rltv --delete --progress sync.clearfoundation.com::clearos /var/flexshare/shares/mirrors/clearos/ 
rsync -rltv --delete --progress sync.clearfoundation.com::clearcentos /var/flexshare/shares/mirrors/clearcentos/

Local Updates

If you want your internal ClearOS systems to use your new local mirror, change the yum repository entries in /etc/yum.repos.d/base.repo. The excerpt below shows how one of the repository entries (base-os) was changed.

[base-os]
name=ClearOS Enterprise 5.2 - OS
baseurl=http://download.clearfoundation.com/clearos/enterprise/5.2
              http://download1.clearfoundation.com/clearos/enterprise/5.2
              http://download2.clearfoundation.com/clearos/enterprise/5.2
              http://download3.clearfoundation.com/clearos/enterprise/5.2
              http://download4.clearfoundation.com/clearos/enterprise/5.2
gpgcheck=1

Changed to:

[base-os]
name=ClearOS Enterprise 5.2 - OS
baseurl=http://192.168.3.1/flexshare/mirrors/clearos/enterprise/5.2
gpgcheck=1

When testing your new repository, you may need to run yum clean all command to make sure you are not using cached data.



Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Video demonstrations - Copyright © 2010 ClearCenter Corporation