Debian Lenny apt-cacher reporting bug
With the apt-cacher package in Debian Lenny, my web interface for the cache statistics wasn't being properly updated. Eventually, I tracked down the problem and figured out that I needed to modify the following section of apt-cacher-report.pl to look like this:
1 2 3 4 5 6 7 8 9 10 11 12 | #parse logfile: foreach $logfile_line (@logdata) { #$logfile_line =~ s/ /\+/g; @line = split /\|/, $logfile_line; $req_date = $line[0]; # $req_pid = $line[1]; # $req_ip = $line[2]; $req_result = $line[3]; $req_bytes = 0; $req_bytes = $line[4] if $line[4] =~ /^[0-9]+$/; # $req_object = $line[5]; |
Quick tip: Using sort on large files
When using the sort command on a 2GB file, with a small /tmp (mine was 16M at the time), it failed with the following error…
sort: write failed: /tmp/sort9tRGAQ: No space left on device
I briefly considered that I may need to expand my /tmp partition, until I consulted Google and found a much easier solution – make sort use an alternate location for its temporary files with the -T switch, as follows:
sort -T /path/to/alternate/tmpNo comments
Delete all messages using mutt
Here's a simple, but extremely useful tip if you've ever wanted to delete all your email messages using mutt. In the main view, press shift+d, then enter the following as the pattern to match: ~s .*
No commentsSaving time and bandwidth with apt-cacher
Saving time and bandwidth are two things every system administrator loves. Implementing apt-cacher could save you a considerable amount of both, depending on the number of servers you have. As the name implies, apt-cacher caches packages and package lists for apt packaging systems on Debian or Debian-like systems. Here's how I recently implemented apt-cacher:
apt-get install apt-cacher
I edited /etc/apt-cacher/apt-cacher.conf
cache_dir=/path/to/cache/directory admin_email=your@email.com daemon_addr=IPADDRESS
I also edited /etc/default/apt-cacher and set:
AUTOSTART=1
Then ran:
/etc/init.d/apt-cacher start
I imported the existing files apt-get had locally archived:
/usr/share/apt-cacher/apt-cacher-import.pl -r /var/cache/apt/archives
Finally, I edited /etc/apt/sources.list on the apt-cacher server, and each client server:
deb http://hostname:3142/ftp.us.debian.org/debian/ lenny main non-free contrib deb-src http://hostname:3142/ftp.us.debian.org/debian/ lenny main non-free contrib deb http://hostname:3142/security.debian.org/ lenny/updates main non-free contrib deb-src http://hostname:3142/security.debian.org/ lenny/updates main non-free contrib2 comments
Debian NAS using AoE (Part 2)
As I mentioned in Debian NAS using AoE (Part 1), I recently needed to implement a low-cost, enterprise grade storage system for backups and to provide network attached storage for vserver-based Debian servers. I was able to build a suitable storage server with 13TB of raw storage for a reasonable price, and decided to use Debian with LVM2 and AoE to divide and share it across the network.
Before getting to the OS installation, I had to setup and build the RAID arrays in the HighPoint 3540 BIOS. I set up a RAID 1 mirror of the two 300GB drives to use for the OS. Then, I created a 6-disk RAID6 and a 7-disk RAID6, which left me with 4GB and 5GB of usage storage.
Next, I installed Debian Lenny from the Lenny netinst ISO onto the 300GB RAID 1 mirror I created, with no additional packages/package groups selected. After the installation was complete, I rebooted the server to install openssh server, lvm2, and AoE. Since I wanted to be able to use the storage server to run vserver instances if needed, I also installed the vserver kernel and tools:
apt-get update apt-get install vserver-debiantools linux-image-2.6-vserver-amd64 lvm2 vblade vblade-persist aoe-tools
I configured LVM to recognize the physical volumes:
pvcreate /dev/sdb pvcreate /dev/sdc
I created the volume groups data1 and data2 on the physical volumes:
vgcreate data1 /dev/sdb vgcreate data2 /dev/sdc
I created two 1TB LVM logical partitions (/dev/data1/backups, /dev/data1/backups2):
lvcreate -L 1TB -n backups data1 lvcreate -L 1TB -n backups2 data1
I made the ext3 filesystem on them so they would be usable:
mkfs.ext3 /dev/data1/backups mkfs.ext3 /dev/data1/backups2
I configured AoE (ATA over Ethernet):
modprobe aoe vblade-persist setup 0 1 eth0 /dev/data1/backups vblade-persist setup 0 2 eth0 /dev/data1/backups2 vblade-persist start 0 1 vblade-persist start 0 2
Finally, I verified they were up and available using:
aoe-discover aoe-stat
Output from aoe-stat… :
e0.1 1099.511GB eth1 up e0.2 1099.511GB eth1 up
To mount an AoE export on a remote server, I used the following (on the remote server):
modprobe aoe apt-get install aoetools aoe-discover aoe-stat (should show the available AoE exports) mkdir /mountpoint mount /dev/etherd/e0.1 /mountpoint (replace e0.1 with the appropriate device from aoe-stat)3 comments
Debian NAS using AoE (Part 1)
Recently, I needed to implement a low-cost, enterprise grade storage system for backups and to provide network attached storage for vserver-based Debian servers. After considering the requirements and projected short-term future growth, I decided to build a storage server with at least 12TB of raw storage, which would allow me to create two 4TB RAID6 arrays.
Ultimately, I was able to get 13TB of raw storage for less than $6300 (~$484 per TB, compared to many vendors starting prices of $1000 or more per TB).
Hardware
- Supermicro CSE-933T-R760B Black 3U Rackmount Case – $769.99
- Supermicro MBD-X7DBN-O Dual LGA 771 Intel 5000P Extended ATX Motherboard – $359.99
- 2x Intel Xeon E5405 Harpertown 2.0GHz LGA 771 80W Quad-Core Processor – $224.99 ($449.98 for 2)
- 4x Kingston 8GB (2 x 4GB) 240-Pin DDR2 667 FB-DIMM ECC RAM – $212.99 ($851.96 for 4)
- 13x Western Digital RE3 1TB 7200 RPM SATA Hard Drive – $189.99 ($2469.87 for 13)
- 2x Western Digital VelociRaptor 300GB 10000 RPM Hard Drive – $229.99 ($459.98 for 2)
- HighPoint RR3540 RAID Controller – $799.99
Total: $6161.76 (plus shipping)
After reviewing the current Linux distributions targeted towards NAS systems, like FreeNAS and OpenFiler, I decided to stick with a simple system using Debian with LVM2 and AoE. My next post, Debian NAS using AoE (Part 2), will dig into the details of the OS and software setup.
3 comments