Storing index files in a tree
- To: amanda-users@cs.umd.edu
- Subject: Storing index files in a tree
- From: "John R. Jackson" <jrj@gandalf.cc.purdue.edu>
- Date: Thu, 23 Apr 1998 10:57:00 -0500
- Reply-to: jrj@cc.purdue.edu
- Resent-Date: Thu, 23 Apr 1998 11:57:23 -0400 (EDT)
- Resent-From: amanda-users@cs.umd.edu
- Resent-Message-ID: <"TtAdR.0.1c2.QJsFr"@tove.cs.umd.edu>
- Resent-Sender: amanda-users-request@cs.umd.edu
I store my index files on an archive file system. The current version
of that software does not handle large directories well (fixed in the
next release, of course :-). Some of my index directories contained
several thousand files and all index operations (amtrmidx, dumper,
amrecover/amindexd) as well as normal Unix commands were very, very slow.
This patch changes the index directory from a flat namespace to one
that matches the text formatted database structure:
.../hostname/filesystem/YYYYMMDD_L.gz
With this, I only have roughly "tapecycle" files in any one directory.
This change has significantly reduced my amdump time (amtrmidx went
from taking hours to minutes) and the load on the archive server.
Amrecover is much zippier at startup.
I've also included the ksh script I used for converting an my existing
flat index directories to the new structure. As the comments mention,
you'll want to change the chown/chmod calls to match your local Amanda
user/group and ownership conventions, and you may need to change the
mkdir if your system does not support the -p option (which creates a
tree no matter how many pieces are missing and does not whine about
already existing components).
To apply my patch, you will first have to apply this patch from Alexandre:
new patch location
It fixes a problem with false matches on the host name in amindexd.
My patch accomplishes the same thing in a different way.
Since this directory structure matches the text format database, you
could make "indexdir" and "infofile" the same and mix the two if that's
convenient for your configuration.
John R. Jackson, Technical Software Specialist, jrj@purdue.edu
indexdir.diff
move-index.ksh