Difference between revisions of "Adding a new cvmfs repository"
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | This article gives a quick overview of the steps needed to create a new cvmfs repository and activate it on the clients. The repository name used in the examples is '''my.repo.fqdn'''; replace it with the appropriate name (i.e., a fully-qualified domain name corresponding to a domain name is owned by the party being served). At Nikhef, the Stratum-0 and Stratum-1 servers are ''mesthoop'' and ''cvmfs01'' (an alias), respectively | + | This article gives a quick overview of the steps needed to create a new cvmfs repository and activate it on the clients. The repository name used in the examples is '''my.repo.fqdn'''; replace it with the appropriate name (i.e., a fully-qualified domain name corresponding to a domain name is owned by the party being served). At Nikhef, the Stratum-0 and Stratum-1 servers are ''mesthoop'' and ''cvmfs01'' (an alias), respectively. |
+ | |||
+ | |||
+ | == Stratum-0 == | ||
− | |||
* '''Create''' a new repository: | * '''Create''' a new repository: | ||
cvmfs_server mkfs -w http://<STRATUM-0>/cvmfs/my.repo.fqdn -o cvmfs my.repo.fqdn | cvmfs_server mkfs -w http://<STRATUM-0>/cvmfs/my.repo.fqdn -o cvmfs my.repo.fqdn | ||
− | * '''Populate''' a new repository, or update an existing repository: | + | * '''Populate''' a new repository, or '''update''' an existing repository: |
cvmfs_server transaction my.repo.fqdn | cvmfs_server transaction my.repo.fqdn | ||
rsync -av <SRCDIR> /cvmfs/my.repo.fqdn/ | rsync -av <SRCDIR> /cvmfs/my.repo.fqdn/ | ||
cvmfs_server publish my.repo.fqdn | cvmfs_server publish my.repo.fqdn | ||
Note that the rsync and publish commands may take some time. It is useful to execute them from a screen session. | Note that the rsync and publish commands may take some time. It is useful to execute them from a screen session. | ||
+ | |||
+ | (You may want to replace the rsync by an rm followed by a copy, to ensure that obsolete files are removed from the repository) | ||
(or to abort:) | (or to abort:) | ||
Line 17: | Line 21: | ||
* Enable replication to Stratum-1 servers: | * Enable replication to Stratum-1 servers: | ||
cvmfs_server alterfs -m on my.repo.fqdn | cvmfs_server alterfs -m on my.repo.fqdn | ||
+ | (this was needed when creating a new repository with cvmfs <= 2.1.14). | ||
+ | * Periodically resign the repository (at least every 30 days): | ||
+ | cvmfs_server resign my.repo.fqdn | ||
+ | or use a [[Media:Cvmfs-stratum0-resign.sh|script]] to resign all repositories that are configured on the Stratum-0 server. This script is weekly executed from a cron job. | ||
− | Stratum-1 | + | == Stratum-1 == |
* Add the public key of the new repository to /etc/cvmfs/keys/my.repo.fqdn.pub | * Add the public key of the new repository to /etc/cvmfs/keys/my.repo.fqdn.pub | ||
Line 28: | Line 36: | ||
* To synchronize: | * To synchronize: | ||
cvmfs_server snapshot my.repo.fqdn | cvmfs_server snapshot my.repo.fqdn | ||
− | or use a script to update snapshots of all repositories: | + | or use a [[Media:Cvmfs-stratum1-synchronize.sh|script]] to update snapshots of all repositories: |
/usr/local/sbin/cvmfs-stratum1-synchronize.sh | /usr/local/sbin/cvmfs-stratum1-synchronize.sh | ||
− | + | This script is executed every hour from a cron job to synchronize all repositories that are configured on the Stratum-1 server. | |
− | Clients | + | |
+ | == Clients == | ||
* Add the public key of the new repository to /etc/cvmfs/keys/my.repo.fqdn.pub | * Add the public key of the new repository to /etc/cvmfs/keys/my.repo.fqdn.pub | ||
Line 40: | Line 49: | ||
CVMFS_PUBLIC_KEY=/etc/cvmfs/keys/my.repo.fqdn.pub | CVMFS_PUBLIC_KEY=/etc/cvmfs/keys/my.repo.fqdn.pub | ||
CVMFS_SERVER_URL=http://<STRATUM-1>/cvmfs/@fqrn@/ | CVMFS_SERVER_URL=http://<STRATUM-1>/cvmfs/@fqrn@/ | ||
+ | |||
+ | '''Make sure that the clients connect to the Stratum-1 servers via a local Squid proxy!''' |
Latest revision as of 16:22, 5 December 2013
This article gives a quick overview of the steps needed to create a new cvmfs repository and activate it on the clients. The repository name used in the examples is my.repo.fqdn; replace it with the appropriate name (i.e., a fully-qualified domain name corresponding to a domain name is owned by the party being served). At Nikhef, the Stratum-0 and Stratum-1 servers are mesthoop and cvmfs01 (an alias), respectively.
Stratum-0
- Create a new repository:
cvmfs_server mkfs -w http://<STRATUM-0>/cvmfs/my.repo.fqdn -o cvmfs my.repo.fqdn
- Populate a new repository, or update an existing repository:
cvmfs_server transaction my.repo.fqdn rsync -av <SRCDIR> /cvmfs/my.repo.fqdn/ cvmfs_server publish my.repo.fqdn
Note that the rsync and publish commands may take some time. It is useful to execute them from a screen session.
(You may want to replace the rsync by an rm followed by a copy, to ensure that obsolete files are removed from the repository)
(or to abort:)
cvmfs_server abort my.repo.fqdn
- Enable replication to Stratum-1 servers:
cvmfs_server alterfs -m on my.repo.fqdn
(this was needed when creating a new repository with cvmfs <= 2.1.14).
- Periodically resign the repository (at least every 30 days):
cvmfs_server resign my.repo.fqdn
or use a script to resign all repositories that are configured on the Stratum-0 server. This script is weekly executed from a cron job.
Stratum-1
- Add the public key of the new repository to /etc/cvmfs/keys/my.repo.fqdn.pub
- Add the repository:
cvmfs_server add-replica http://<STRATUM-0>/cvmfs/my.repo.fqdn /etc/cvmfs/keys/my.repo.fqdn.pub
- To synchronize:
cvmfs_server snapshot my.repo.fqdn
or use a script to update snapshots of all repositories:
/usr/local/sbin/cvmfs-stratum1-synchronize.sh
This script is executed every hour from a cron job to synchronize all repositories that are configured on the Stratum-1 server.
Clients
- Add the public key of the new repository to /etc/cvmfs/keys/my.repo.fqdn.pub
- Configuration for the new repository:
# cat /etc/cvmfs/config.d/my.repo.fqdn.conf CVMFS_PUBLIC_KEY=/etc/cvmfs/keys/my.repo.fqdn.pub CVMFS_SERVER_URL=http://<STRATUM-1>/cvmfs/@fqrn@/
Make sure that the clients connect to the Stratum-1 servers via a local Squid proxy!