<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Wushu Blog &#187; ZFS</title>
	<atom:link href="http://www.mywushublog.com/tag/zfs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mywushublog.com</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 18:42:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Bacula in the Enterprise &#8211; Part 2</title>
		<link>http://www.mywushublog.com/2011/07/bacula-in-the-enterprise-part-2/</link>
		<comments>http://www.mywushublog.com/2011/07/bacula-in-the-enterprise-part-2/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 19:10:26 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[Bacula]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Jenny]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=1524</guid>
		<description><![CDATA[Software As mentioned many times, this is a FreeBSD based environment. Some good sysinfo output below: Operating system release: FreeBSD 8.2-RELEASE OS architecture: amd64 Kernel build dir location: /usr/obj/usr/src/sys/GENERIC Currently booted kernel: /boot/kernel/kernel Currently loaded kernel modules (kldstat(8)): zfs.ko opensolaris.ko Bootloader settings for the Director/Database node: The /boot/loader.conf has the ...]]></description>
			<content:encoded><![CDATA[<h1>Software</h1>
<p>As mentioned many times, this is a FreeBSD based environment. Some good sysinfo output below:</p>
<pre>
Operating system release: FreeBSD 8.2-RELEASE
OS architecture: amd64
Kernel build dir location: /usr/obj/usr/src/sys/GENERIC
Currently booted kernel: /boot/kernel/kernel

Currently loaded kernel modules (kldstat(8)):
zfs.ko
opensolaris.ko
</pre>
<p>Bootloader settings for the Director/Database node:</p>
<pre>
The /boot/loader.conf has the following contents:
kern.ipc.semmni=1024
kern.ipc.semmns=2048
kern.ipc.semmnu=1024
</pre>
<p>All of the storage nodes and the director are running a GENERIC kernel with very few system tweaking. One of the storage nodes has a Chelsio 10Gb controller, but that hasn&#8217;t had a high enough load to crack the 1Gb/sec barrier.</p>
<p>I&#8217;m using Bacula from the ports tree, and the directory has a special Make flag to build with gcc&#8217;s debugging symbols. Jenny worked on getting that setup when we were having some stability issues.</p>
<p>The Bacula configuration one the director node is backed by a git repository. It adds a little bit of complexity for a systems administrator, when they want to add a client, but the benefit is clear. This backup project actually enforces change control and tracks all of the commits by who.</p>
<p>I&#8217;ve also setup Redmine as a project front-end, and I&#8217;ve begun to file tickets and reference what commit fixed what. This not only tracks my progress, but it is the first time I&#8217;ve had a backup server that was clearly documented and had some type of accountability.<br />
<div id="attachment_1525" class="wp-caption aligncenter" style="width: 643px"><a href="http://www.mywushublog.com/wp-content/uploads/2011/07/redmine.png"><img src="http://www.mywushublog.com/wp-content/uploads/2011/07/redmine.png" alt="" title="redmine" width="633" height="412" class="size-full wp-image-1525" /></a><p class="wp-caption-text">A snippet of the Redmine site</p></div></p>
<h1>The Structure</h1>
<p>I&#8217;ve compared projects like bacula to a large box of LegosTM. It doesn&#8217;t enforce a structure by any means, and I&#8217;ve taken it upon myself to add meaning to the otherwise flat and incomprehensible bacula-dir.conf</p>
<p>The Bacula Port on FreeBSD installs all configuration files in <strong>/usr/local/etc</strong>.</p>
<p>Write, the Director, only contains the following in /usr/local/etc/bacula-dir.conf:</p>
<pre>
@/usr/local/etc/bacula/bacula-dir.conf
@/usr/local/etc/bacula/storage.conf
@/usr/local/etc/bacula/clients.conf
@/usr/local/etc/bacula/messages.conf
@/usr/local/etc/bacula/schedules.conf
@/usr/local/etc/bacula/pools.conf
</pre>
<p>As you can see, I place everything in etc/bacula/.</p>
<p>Here is a beautiful output of tree(1):</p>
<pre>
bacula
|-- bacula-dir.conf
|-- bin
|   |-- create_client.sh
|   `-- package_list.sh
|-- clients.conf
|-- clients.d
|   |-- 10am
|   |-- 10pm
|   |-- 11pm
|   |-- 12am
|   |-- 1am
|   |-- 2am
|   |-- 3am
|   |-- 4am
|   |-- 4pm
|   |-- 5am
|   |-- 5pm
|   |-- 6am
|   |-- 6pm
|   |-- 7am
|   |-- 7pm
|   |-- 8am
|   |-- 8pm
|   |-- 9am
|   |-- 9pm
|   |-- TEMPLATE-mac
|   |-- TEMPLATE-unix
|   `-- TEMPLATE-win32
|-- excludes.d
|   |-- common.conf
|   |-- mac.conf
|   |-- unix.conf
|   `-- win32.conf
|-- messages.conf
|-- pools.conf
|-- schedules.conf
|-- storage.conf
`-- storage.d
    |-- write-01.conf
    |-- write-02.conf
    |-- write-03.conf
    |-- write-04.conf
    |-- write-05.conf
    `-- write-06.conf
</pre>
<h1>Storage Nodes</h1>
<p>All of the storage nodes are using <strong>ZFS</strong> as the filesystem/Volume manager.</p>
<pre>
write-06# zpool list
NAME         SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
filevol001  90.6T  33.3T  57.3T    36%  ONLINE  -
</pre>
<p>They all have one volume, <strong>/filevol001</strong>, and I created 512 &#8220;drives&#8221; within that volume. Effectivly, each storage node has 512 drives, and clients are randomly assigned a drive.</p>
<p>Since I have 6 storage nodes, I wrote a little shell script to handle the directory creation:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">i</span>=<span style="color: #000000;">1</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">-le</span> <span style="color: #000000;">512</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-o</span> bacula <span style="color: #660033;">-g</span> bacula <span style="color: #660033;">-m</span> <span style="color: #000000;">770</span> <span style="color: #000000; font-weight: bold;">/</span>filevol001<span style="color: #000000; font-weight: bold;">/</span>drive<span style="color: #007800;">$i</span>
        <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>i++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>Simple, right? I also wrote a script to generate the bacula-sd.conf file on a storage node as well:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
usage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; EOF
    Usage $0 NUMBER &gt; /usr/local/etc/bacula-sd.conf
&nbsp;
    Where &quot;NUMBER&quot; is just a single digit indicating which storage node this is.
&nbsp;
    Example, for write-07:
    $ make_sd.sh 7 &gt; /usr/local/etc/bacula-sd.conf
EOF</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #007800;">i</span>=<span style="color: #000000;">1</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    usage
    <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;Storage {<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Name = write-0$1.llnl.gov-sd<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>SDAddress = write-0$1.llnl.gov<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>SDPort = 9103<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>WorkingDirectory = <span style="color: #000099; font-weight: bold;">\&quot;</span>/var/db/bacula<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Pid Directory = <span style="color: #000099; font-weight: bold;">\&quot;</span>/var/run<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Maximum Concurrent Jobs = 516<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;#<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;# List Directors who are permitted to contact Storage daemon<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;#<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;Director {<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Name = write.llnl.gov-dir<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Password = <span style="color: #000099; font-weight: bold;">\&quot;</span>ItsASecret<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;#<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;# Restricted Director, used by tray-monitor to get the<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;#   status of the storage daemon<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;#<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;Director {<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Name = write.llnl.gov-mon<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Password = <span style="color: #000099; font-weight: bold;">\&quot;</span>ItsANotherSecret<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Monitor = yes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;Messages {<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Name = Standard<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>director = write.llnl.gov-dir = all<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;Device {<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Name = W0$1FileStorage<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Media Type = File<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Archive Device = /filevol001<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>LabelMedia = yes;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Random Access = Yes;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>AutomaticMount = yes;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>RemovableMedia = no;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>AlwaysOpen = no;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Maximum Concurrent Jobs = 2<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">-le</span> <span style="color: #000000;">512</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;Device {<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Name = W0$1FileStorageD<span style="color: #007800;">$i</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Media Type = File<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Archive Device = /filevol001/drive<span style="color: #007800;">$i</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>LabelMedia = yes;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Random Access = Yes;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>AutomaticMount = yes;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>RemovableMedia = no;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>AlwaysOpen = no;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Maximum Concurrent Jobs = 2<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>i++<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>On the Directory, a storage node definition is saved in /usr/local/etc/bacula/storage.d/write-0{N}.conf, which is included in /usr/local/etc/bacula/storage.conf:</p>
<pre>
@/usr/local/etc/bacula/storage.d/write-01.conf
@/usr/local/etc/bacula/storage.d/write-02.conf
@/usr/local/etc/bacula/storage.d/write-03.conf
@/usr/local/etc/bacula/storage.d/write-04.conf
@/usr/local/etc/bacula/storage.d/write-05.conf
@/usr/local/etc/bacula/storage.d/write-06.conf
</pre>
<h1>Client Generation</h1>
<p>There are two components, the TEMPLATE file (there are three, TEMPLATE-unix, TEMPLATE-win32 and TEMPATE-mac) and the shell script.</p>
<h2>The Client TEMPLATE File</h2>
<p>Here is what one of the TEMPLATE files looks like:</p>
<pre>
#
# Client Definition, the Password here must match
#  the clients bacula-fd.conf Client definition.
#
# Using Vi/m, you can easily replaced HOSTNAME with
#  the short hostname of the client with:
#  %s/HOSTNAME/yourhostname/
#
#

Client {
    Name = HOSTNAME.llnl.gov
    Address = HOSTNAME.llnl.gov
    FDPort = 9102
    Catalog = Catalog001
    Password = "ItsASecret"
    File Retention = 40 days
    Job Retention = 1 months
    AutoPrune = yes
    Maximum Concurrent Jobs = 10
    Heartbeat Interval = 300
}

Console {
    Name = HOSTNAME.llnl.gov-acl
    Password = ItsASecret
    JobACL = "HOSTNAME.llnl.gov RestoreFiles", "HOSTNAME.llnl.gov"
    ScheduleACL = *all*
    ClientACL = HOSTNAME.llnl.gov
    FileSetACL = "HOSTNAME.llnl.gov FileSet"
    CatalogACL = Catalog001
    CommandACL = *all*
    StorageACL = *all*
    PoolACL = HOSTNAME.llnl.gov-File
}

Job {
    Name = "HOSTNAME.llnl.gov"
    Type = Backup
    Level = Incremental
    FileSet = "HOSTNAME.llnl.gov FileSet"
    Client = "HOSTNAME.llnl.gov"
    Storage = FileStorageD##
    Pool = HOSTNAME.llnl.gov-File
    Schedule = "@@"
    Messages = Standard
    Priority = 10
    Write Bootstrap = "/var/db/bacula/%c.bsr"
    Maximum Concurrent Jobs = 10
    Reschedule On Error = yes
    Reschedule Interval = 1 hour
    Reschedule Times = 1
    Max Wait Time = 30 minutes
    Cancel Lower Level Duplicates = yes
    Allow Duplicate Jobs = no
    RunScript {
        RunsWhen = Before
        FailJobOnError = no
        Command = "/etc/scripts/package_list.sh"
        RunsOnClient = yes
    }
}

Pool {
    Name = HOSTNAME.llnl.gov-File
    Pool Type = Backup
    Recycle = yes
    AutoPrune = yes
    Volume Retention = 1 months
    Maximum Volume Bytes = 10G
    Maximum Volumes = 100
    LabelFormat = "HOSTNAME.llnl.govFileVol"
    Maximum Volume Jobs = 5
}

Job {
    Name = "HOSTNAME.llnl.gov RestoreFiles"
    Type = Restore
    Client= HOSTNAME.llnl.gov
    FileSet="HOSTNAME.llnl.gov FileSet"
    Storage = FileStorageD##
    Pool = HOSTNAME.llnl.gov-File
    Messages = Standard
    #Where = /tmp/bacula-restores
}

FileSet {
    Name = "HOSTNAME.llnl.gov FileSet"
    Include {
        Options {
            signature = MD5
            compression = GZIP6
                        fstype = ext2
                        fstype = xfs
                        fstype = jfs
                        fstype = ufs
                        fstype = zfs
                        onefs = no
                        Exclude = yes
                        @/usr/local/etc/bacula/excludes.d/common.conf
        }
                File = /
                File = /usr/local
                Exclude Dir Containing = .excludeme
    }
    Exclude {
        @/usr/local/etc/bacula/excludes.d/unix.conf
    }
}
</pre>
<h2>The Create Client Script</h2>
<p>So here is what really makes creating clients easy for us, the create_client script.</p>
<p>I didn&#8217;t want to do it this way, really, so part of me is very ashamed of this tool. I would have preferred to re-write this in Python, or make a web page out of it, and let admins create clients from their desktop. Or, I would have loved to create a puppet module to handle this automagically (but that would exlcude everything that *isn&#8217;t* running Puppet, which is huge).</p>
<p>With that disclaimer, here is my create_client shell script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/env bash</span>
<span style="color: #666666; font-style: italic;"># usage: cclient -t unix -s 12am -h hostname</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">umask</span> 022
&nbsp;
<span style="color: #666666; font-style: italic;"># Variables</span>
<span style="color: #666666; font-style: italic;">## Randomize Schedule</span>
<span style="color: #007800;">SCHEDULES</span>=<span style="color: #ff0000;">&quot;4pm 5pm 6pm 7pm 8pm 9pm 10pm 11pm 12am 1am 2am 3am 4am 5am 6am 7am 8am 9am 10am&quot;</span>
<span style="color: #007800;">s</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$SCHEDULES</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">num_s</span>=<span style="color: #800000;">${#s[*]}</span>
<span style="color: #007800;">RAND_SCHED</span>=<span style="color: #800000;">${s[$((RANDOM%num_s))]}</span>
<span style="color: #666666; font-style: italic;"># Randomize which storage node we use</span>
<span style="color: #007800;">NODES</span>=<span style="color: #ff0000;">&quot;write-06 write-01 write-06 write-01 write-02 write-03 write-04 write-05&quot;</span>
<span style="color: #007800;">n</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$NODES</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">num_n</span>=<span style="color: #800000;">${#n[*]}</span>
<span style="color: #007800;">RAND_NODE</span>=<span style="color: #800000;">${n[$((RANDOM%num_n))]}</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">DRIVE</span>=<span style="color: #000000; font-weight: bold;">`</span>jot <span style="color: #660033;">-r</span> <span style="color: #000000;">1</span> <span style="color: #000000;">1</span> <span style="color: #000000;">512</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">BDIR</span>=<span style="color: #ff0000;">&quot;/usr/local/etc/bacula&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">TYPE</span>=<span style="color: #ff0000;">&quot;unix&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">SCHEDULE</span>=<span style="color: #007800;">$RAND_SCHED</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HOSTNAME</span>=<span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">STORAGE_NODE</span>=<span style="color: #007800;">$RAND_NODE</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GIT_DIR</span>=<span style="color: #ff0000;">&quot;/usr/local/etc/bacula/.git&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CLASS</span>=<span style="color: #ff0000;">&quot;desktop&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">whoami</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> == <span style="color: #ff0000;">&quot;root&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; EOF
                Please do not run this as root. This script runs a
                git add/commit, which is how changes are managed and
                tracked. If you run this as root, then it shows up
                as carlson39 or root.
&nbsp;
                If you encounter a problem with your normal OUN account,
                please contact Mike Carlson, or submit a bug here:
                https://st-scm.llnl.gov/redmine/snt/projects/bacula/issues/new
EOF</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
usage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; EOF
&nbsp;
        Usage: $0 [OPTION]... -h HOSTNAME
&nbsp;
        This script will generate a bacula client definition.
&nbsp;
        OPTIONS:
        -s      schedule, (4pm|5pm|6pm|7pm|8pm|9pm|10pm|11pm|12am|1am|2am|3am|4am|5am|6am|7am|8am|9am). The default schedule is random.
        -t      type, (unix|win32|mac), unix is the default
        -n      storage node (write-01|write-02|...), the default is random.
        -h      hostname (use the short hostname)
EOF</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$BDIR</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">getopts</span> <span style="color: #ff0000;">'c:t:s:n:h:'</span> OPTION
<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$OPTION</span> <span style="color: #000000; font-weight: bold;">in</span>
                c<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                        <span style="color: #007800;">CLASS</span>=<span style="color: #007800;">$OPTARG</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
                t<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                        <span style="color: #007800;">TYPE</span>=<span style="color: #007800;">$OPTARG</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
                s<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                        <span style="color: #007800;">SCHEDULE</span>=<span style="color: #007800;">$OPTARG</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
                h<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                        <span style="color: #007800;">HOSTNAME</span>=<span style="color: #007800;">$OPTARG</span>
                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$HOSTNAME</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;(llnl.gov|ucllnl.org)&quot;</span>
                        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
                        <span style="color: #000000; font-weight: bold;">then</span>
                        <span style="color: #007800;">HOSTNAME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$HOSTNAME</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/.llnl.gov//'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/.ucllnl.org//'</span><span style="color: #000000; font-weight: bold;">`</span>
                        <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
                        <span style="color: #000000; font-weight: bold;">;;</span>
                n<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                        <span style="color: #007800;">STORAGE_NODE</span>=<span style="color: #007800;">$OPTARG</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
                ?<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                        usage
                        <span style="color: #7a0874; font-weight: bold;">exit</span>
                        <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$CLASS</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$TYPE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$SCHEDULE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$HOSTNAME</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$STORAGE_NODE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
        usage
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-w</span> <span style="color: #007800;">$HOSTNAME</span> <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.conf
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'client '</span><span style="color: #007800;">$HOSTNAME</span> <span style="color: #ff0000;">'already exists...'</span>
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">RETRY_COUNT</span>=<span style="color: #ff0000;">&quot;2&quot;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$STORAGE_NODE</span> == <span style="color: #ff0000;">&quot;write-01&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
        <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #007800;">DRIVE</span>=<span style="color: #000000; font-weight: bold;">`</span>jot <span style="color: #660033;">-r</span> <span style="color: #000000;">1</span> <span style="color: #000000;">33</span> <span style="color: #000000;">512</span><span style="color: #000000; font-weight: bold;">`</span>
                <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/HOSTNAME/'</span><span style="color: #007800;">$HOSTNAME</span><span style="color: #ff0000;">'/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/FileStorageD##/FileStorageD'</span><span style="color: #007800;">$DRIVE</span><span style="color: #ff0000;">'/'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/\@\@/'</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #ff0000;">'/'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/RETRY_COUNT/'</span><span style="color: #007800;">$RETRY_COUNT</span><span style="color: #ff0000;">'/g'</span> <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span>TEMPLATE-<span style="color: #007800;">$TYPE</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOSTNAME</span>.conf
                <span style="color: #7a0874; font-weight: bold;">echo</span> \<span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOSTNAME</span>.conf <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.conf
        <span style="color: #000000; font-weight: bold;">else</span>
                <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">SN</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$STORAGE_NODE</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">7</span>-<span style="color: #000000;">8</span><span style="color: #000000; font-weight: bold;">`</span>
                <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/HOSTNAME/'</span><span style="color: #007800;">$HOSTNAME</span><span style="color: #ff0000;">'/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/FileStorageD##/W'</span><span style="color: #007800;">$SN</span><span style="color: #ff0000;">'FileStorageD'</span><span style="color: #007800;">$DRIVE</span><span style="color: #ff0000;">'/'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/\@\@/'</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #ff0000;">'/'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/RETRY_COUNT/'</span><span style="color: #007800;">$RETRY_COUNT</span><span style="color: #ff0000;">'/g'</span> <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span>TEMPLATE-<span style="color: #007800;">$TYPE</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOSTNAME</span>.conf
                <span style="color: #7a0874; font-weight: bold;">echo</span> \<span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOSTNAME</span>.conf <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.conf
        <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
        <span style="color: #c20cb9; font-weight: bold;">chgrp</span> st-bacula-admins <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOSTNAME</span>.conf
        <span style="color: #c20cb9; font-weight: bold;">git</span> add <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOSTNAME</span>.conf <span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.conf
        <span style="color: #c20cb9; font-weight: bold;">git</span> commit
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'created client definition: '</span><span style="color: #007800;">$BDIR</span><span style="color: #000000; font-weight: bold;">/</span>clients.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$SCHEDULE</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$HOSTNAME</span>.conf
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'for '</span><span style="color: #007800;">$HOSTNAME</span><span style="color: #ff0000;">'.llnl.gov'</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>This is always a work in progress, but at the core, it is a simple sed wrapper with a lot of randomization and a git commit.</p>
<p>Why all the randomization?</p>
<p>Because I had to add around 1000 clients in a VERY short amount of time. We didn&#8217;t have a problem pushing the Bacula client to all of the platforms, nor the bacula-fd.conf file either. What I could not do was spend the time to create and manage all of the resources for each client. That is why I have so many devices/drives, so I can attempt to have a 1:1 without having to actually think about it.</p>
<p>So, I wrote ANOTHER script to wrap around this one when I need to do bulk client creations. I&#8217;m not going to post that, it just loops through the above command.</p>
<h2>Pre-Job command &#8211; Package List</h2>
<p>I only do this on the Unix/Linux clients, and I thought it was a cool idea. </p>
<p>Yeah, I will pat myself on the back a little bit for that :)</p>
<p>I exclude the Operating System from backups for two reasons, 1) to reduce backing up duplicate and reproducible data and 2) Our build/Imaging process is so quick and clean it is just faster to rebuild than restore everything.</p>
<p>Still, I needed a way to keep the state of installed packages/software.</p>
<p>This is where the pre-job command comes in handy. This part right here:</p>
<pre>
    RunScript {
        RunsWhen = Before
        FailJobOnError = no
        Command = "/etc/scripts/package_list.sh"
        RunsOnClient = yes
    }
</pre>
<p>That package_list.sh file looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">#!/usr/bin/env bash</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PLIST</span>=<span style="color: #ff0000;">&quot;/root/plist.txt&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`uname -s`</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
Linux<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lsb_release <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        <span style="color: #007800;">DIST</span>=<span style="color: #000000; font-weight: bold;">`</span>lsb_release -d<span style="color: #000000; font-weight: bold;">`</span>
                <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
                <span style="color: #666666; font-style: italic;"># RHEL</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>up2date <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        rpm <span style="color: #660033;">-qa</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$PLIST</span>
                <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
                <span style="color: #666666; font-style: italic;"># RHEL 5</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>yum <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>yum.pid <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Yum currently in use, exiting gracefully...&quot;</span>
                                <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
                        <span style="color: #000000; font-weight: bold;">else</span>
                        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>yum list installed <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$PLIST</span>
                        <span style="color: #000000; font-weight: bold;">fi</span>
                <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
                <span style="color: #666666; font-style: italic;"># Ubuntu</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-x</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">--get-selections</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$PLIST</span>
                <span style="color: #000000; font-weight: bold;">fi</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
FreeBSD<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                pkg_info<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$PLIST</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
SunOS<span style="color: #7a0874; font-weight: bold;">&#41;</span>
                pkginfo <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$PLIST</span>
                <span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span></pre></div></div>

<p>That file, /root/plist.txt, gets backed up.</p>
<p>Now we have a record of what was installed on our Unix platforms :)</p>
<p>That is it for now, see you at <a href="/#">Part 3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2011/07/bacula-in-the-enterprise-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bacula in the Enterprise &#8211; Part 1</title>
		<link>http://www.mywushublog.com/2011/07/bacula-in-the-enterprise-part-1/</link>
		<comments>http://www.mywushublog.com/2011/07/bacula-in-the-enterprise-part-1/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 00:45:21 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[Bacula]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=1513</guid>
		<description><![CDATA[I&#8217;ve been using Bacula, the open source backup software, for over a year now. Things have been going well, and I would like to dedicate a post or two to the environment I built. Background Over a year ago, I took it upon myself to replace a single Legato Networker ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Bacula, the open source backup software, for over a year now. Things have been going well, and I would like to dedicate a post or two to the environment I built.</p>
<h2>Background</h2>
<p>Over a year ago, I took it upon myself to replace a single Legato Networker server with Bacula. One of our collaborators had decided to ship us (for no reason at all really, I think they were cleaning out their data center) a Sun X4200 AMD server, and two StorageTek/Sun NAS servers.</p>
<p>I had no reason for the NAS heads, but the JBOD was full of drives and the Sun X4200 was useful enough. So, I gutted them (Since the StoragTek NAS heads were identical in almost every way to a standard X4200), put as much memory and CPU&#8217;s as I could in one system. This was my first Bacula server. It had around 2TB of FC storage and it made a nice replacement backup server for the 50 or so clients that were on the Networker server. The OS was not Solaris, as you might guess since I was using Sun hardware, but FreeBSD.</p>
<p>Since was focusing only on disk based backups, and FreeBSD has two fantastic large file systems (UFS2 and ZFS), this was my underlying storage platform. Combine that with the current choice of software (in the case, Bacula 5.0.x and PostgreSQL 8/9) from the Ports tree, it really makes the perfect open source software and hardware stack.</p>
<p>After spending a good amount of time wrapping my head around Bacula, and really, just carelessly diving into it, I was very happy with how fast and stable it was shaping up to be.</p>
<p>Around the same time, I was asked to pick up the project that literally went no where for years: The dreaded Backup Project for all of the S&amp;T directorate. A mix of all OS&#8217;s, desktops, servers, laptops, etc&#8230; and around 3000 active machines online with lots of important data.</p>
<p>No small feat, and there are many reasons why this had been a difficult project to wrangle. One thing for sure, is we knew we had a lot of unique programmatic data.</p>
<p>I knew what software I wanted to use, and I was pretty set on using commodity hardware and reasonably priced storage. The next part was to define some constants in the environment.</p>
<h2>The Initial Concepts</h2>
<p>First up, I knew of the largest painful aspects of our computing environment:</p>
<ol>
<li>Budget constraints &#8211; We are not rich, and IT always seems to be underfunded. This project had to be as frugal as possible, yet still deliver.</li>
<li>Diverse platforms &#8211; We have Windows, OS X and a mix of RHEL and Ubuntu for desktops. Server platforms range all across the board: Windows, OSX, RHEL, Solaris, FreeBSD, AIX, etc&#8230;</li>
<li>Mission critical data &#8211; Lets face it, the Lab doesn&#8217;t make a car, or a VCR. We have a LOT of critical scientific knowledge that is only stored in bits and bytes. That is our product, scientific data that is truly unique.</li>
<li>A campus like geography &#8211;  the Lab is 1 sq. mile with a mixture of trailers, new buildings, and some buildings that are over 50 years old. The network backbone ranges from 10Gbps to 10Mbps. The poses a problem when it comes to backups.</li>
</ol>
<div>With this in mind, theses are some of the initial concepts I latched onto:</div>
<div>
<ul>
<li>A distributed <strong>disk</strong> based storage backend for Bacula</li>
<li>Smaller retention window &#8211; 1 month</li>
<li>Reduce the amount of data that has to even go over the network</li>
<ul style="padding-left: 30px;">
<li>Skip &#8220;reproducible data&#8221; such has installed programs like Office, and exclude the OS itself</li>
<li>Enable client side compression. The effectively distributes the compression for all clients. Saves a lot of disk space :)</li>
</ul>
<li>Skip virtual machine images, like vmdk and vmem files, and treat important virtual machines as separate clients.</li>
</ul>
<div>For Bacula itself, I had decided that each client would have its own resources. Very little is shared between each client, so for example client-001 would get all of these resources:</div>
<ul>
<li>Pool = &#8220;Client-001-File&#8221;</li>
<ul style="padding-left: 30px;">
<li>Storage = a randomly assigned drive on one of the storage nodes</li>
<li>Maximum Volume bytes = 10Gb</li>
<li>Maximum Volumes = 100</li>
<li>AutoPrune and Recycling enabled</li>
</ul>
<li>Job = &#8220;client-001&#8243; (one for backup and one for restore)</li>
<li>FileSet = &#8220;client-001 FileSet&#8221;</li>
</ul>
<p>What this prevents is cross-client data contamination. What is also prevented, and I found out later, was concurrent backups. More on that later though.</p>
<p>After feeling a bit more comfortable with a simple all-in-one server, I was ready to spec out new hardware. This was good, because at the same time it was our end of year budget crunch, and hardware had to be procured.</p>
<h2>The Hardware</h2>
<p>For storage, I had a few concepts I was floating around.</p>
<p>One, was to use MooseFS, a distributed filesystem , across a bunch of cheap node with a modest amount of storage.</p>
<p>The other, idea was to buy a handful of servers with a lot of internal storage, around 18TB or so. Them distribute them across the &#8220;campus&#8221; as a kind of Bacula storage node cloud.</p>
<p>The last idea was to take a more traditional backup server approach, and buy a server with as much expandable storage as possible and back everything up to that.</p>
<p>In the end, when a bunch of hardware showed up (I had *some* control over the hardware, but not all aspects since some of the managers took it upon themselves to purchase everything), I scrapped the MooseFS idea after talking it over with Jenny, and we took the last two: 4 HP servers with 17TB or RAID6 internal storage, and a large 140TB SAN array (Winchester Systems, great stuff!) as the primary backup node:</p>
<p><div id="attachment_1522" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2011/07/Overview.jpg"><img src="http://www.mywushublog.com/wp-content/uploads/2011/07/Overview-300x292.jpg" alt="" title="Overview" width="300" height="292" class="size-medium wp-image-1522" /></a><p class="wp-caption-text">Our Environment</p></div><br />
This model served us well for a while. We had a primary storage node that backed up a users primary desktop, and the smaller storage nodes were used to back up servers and infrastructure data.</p>
<p>There was room for improvement right away though. As soon as it was in production, I quickly mapped out what I felt were the next steps in making a robust backup environment.</p>
<p>More on that in another installment :)</p>
<p><a href="/2011/07/bacula-in-the-enterprise-part-2/">Continue to Part 2&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2011/07/bacula-in-the-enterprise-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD and Multipath</title>
		<link>http://www.mywushublog.com/2010/06/freebsd-and-multipath/</link>
		<comments>http://www.mywushublog.com/2010/06/freebsd-and-multipath/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 06:06:58 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[Benchmarking]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=985</guid>
		<description><![CDATA[I didn&#8217;t find any blog posts of discussions on FreeBSD and multipath (for storage) that wasn&#8217;t a man page. That means it is up to me to write about it :) Hardware CPU Machine class: amd64 CPU Model: Intel(R) Xeon(R) CPU E5530 @ 2.40GHz No. of Cores: 16 Memory&#160; Total ...]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t find any blog posts of discussions on FreeBSD and multipath (for storage) that wasn&#8217;t <a href="http://www.freebsd.org/cgi/man.cgi?query=gmultipath&amp;section=8">a man page</a>.</p>
<p>That means it is up to me to write about it :)</p>
<h2>Hardware</h2>
<h3>CPU</h3>
<h3>
<pre>Machine class:	amd64
CPU Model:	Intel(R) Xeon(R) CPU           E5530  @ 2.40GHz
No. of Cores:	16</pre>
</h3>
<h3>Memory&nbsp;</p>
<pre>Total real memory available:	65511 MB
Logically used memory:		3945 MB
Logically available memory:	61565 MB</pre>
</h3>
<h3>Storage</h3>
<p>The storage is a large ~90TB Enterprise class Fibre Channel array, a Data Direct Networks S2A9900. Connected to that are two, dual port QLogic 2532 8Gb HBA&#8217;s. We also have two SSD drives (configured as a RAID1 device) for the ZFS Intent Log.</p>
<p>The storage array was configured from 120 1TB, 7200RPM Hitachi drives. It has 12 volumes in total, composed of 10 of the SATA drives (1 parity, 1 Spare), or ~7TB.</p>
<p>The S2N9900 has two controllers, one controller is responsible for LUN&#8217;s 1-6, the other controller is responsible for LUN&#8217;s 7-12. every LUN is presented to all four Fibre Channel ports. This got a little messy, trying to sort out 48 raw disk devices takes some patience and a decent attention span&#8230;</p>
<p>yeah, I did make a few typo&#8217;s here and there, thankfully creating and clearing disk labels is easy.</p>
<pre># camcontrol devlist|grep lun\ 0
                at scbus0 target 0 lun 0 (pass0,da0)
                at scbus1 target 0 lun 0 (pass6,da6)
                at scbus4 target 0 lun 0 (pass24,da24)
                at scbus5 target 0 lun 0 (pass30,da30)</pre>
<pre># camcontrol inquiry da0 -S
108EA1B10001
# camcontrol inquiry da6 -S
108EA1B10001
# camcontrol inquiry da24 -S
108EA1B10001
# camcontrol inquiry da30 -S
108EA1B10001
# gmultipath label -v DDN-v00 /dev/da0 /dev/da6 /dev/da24 /dev/da30
Done.</pre>
<pre># gmultipath status
             Name  Status  Components
multipath/DDN-v00     N/A  da0
                           da6
                           da24
                           da30</pre>
<p>Now, to do that 12 more times&#8230;</p>
<p>Whew, hard work!</p>
<p>Now, to create a simple ZFS volume across all 12 luns:</p>
<pre># zpool create zfs multipath/DDN-v00 multipath/DDN-v01 multipath/DDN-v02 multipath/DDN-v03 multipath/DDN-v04 multipath/DDN-v05 multipath/DDN-v06 multipath/DDN-v07 multipath/DDN-v08 multipath/DDN-v09 multipath/DDN-v10 multipath/DDN-v11 log mfid1

# zpool status
  pool: zfs
 state: ONLINE
 scrub: none requested
config:

	NAME                 STATE     READ WRITE CKSUM
	zfs                   ONLINE       0     0     0
	  multipath/DDN-v00  ONLINE       0     0     0
	  multipath/DDN-v01  ONLINE       0     0     0
	  multipath/DDN-v02  ONLINE       0     0     0
	  multipath/DDN-v03  ONLINE       0     0     0
	  multipath/DDN-v04  ONLINE       0     0     0
	  multipath/DDN-v05  ONLINE       0     0     0
	  multipath/DDN-v06  ONLINE       0     0     0
	  multipath/DDN-v07  ONLINE       0     0     0
	  multipath/DDN-v08  ONLINE       0     0     0
	  multipath/DDN-v09  ONLINE       0     0     0
	  multipath/DDN-v10  ONLINE       0     0     0
	  multipath/DDN-v11  ONLINE       0     0     0
	logs                 ONLINE       0     0     0
	  mfid1              ONLINE       0     0     0

errors: No known data errors</pre>
<h2>Results</h2>
<p>These results wre obtained from two <strong>similar</strong> servers. The other server is using a Winchester Systems Storage array, and has 24GB of system memory. The Winchester Storage is ~40TB of 2TB SATA disks:</p>
<div id="attachment_999" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/winsys-fd-sx2318r.jpg"><img class="size-medium wp-image-999" title="winsys-fd-sx2318r" src="http://www.mywushublog.com/wp-content/uploads/2010/06/winsys-fd-sx2318r-300x253.jpg" alt="" width="300" height="253" /></a><p class="wp-caption-text">Another RAID array, just for a comparison</p></div>
<p>I used IOZone for the test (iozone -a). The default iozone test is using 64k files to 512MB files, and since I&#8217;m trying to see how the server might actually react to the real worl, I&#8217;m okay with this (ie, I fully understand that a LOT of caching is taking place, and I want that for right now).</p>
<div id="attachment_997" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-frewrite.png"><img class="size-medium wp-image-997" title="2d-frewrite" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-frewrite-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">Forward Re-Write</p></div>
<div id="attachment_996" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-freread.png"><img class="size-medium wp-image-996" title="2d-freread" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-freread-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">Forward Re-Read</p></div>
<div id="attachment_995" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-fread.png"><img class="size-medium wp-image-995" title="2d-fread" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-fread-300x192.png" alt="Forward Read" width="300" height="192" /></a><p class="wp-caption-text">Forward Read</p></div>
<p>&nbsp;</p>
<div id="attachment_994" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-bkwdread.png"><img class="size-medium wp-image-994" title="2d-bkwdread" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-bkwdread-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">Backwards Read</p></div>
<p>&nbsp;</p>
<div id="attachment_993" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-randread.png"><img class="size-medium wp-image-993" title="2d-randread" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-randread-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">Random Read</p></div>
<p>&nbsp;</p>
<div id="attachment_992" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-reread.png"><img class="size-medium wp-image-992" title="2d-reread" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-reread-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">Re-Read</p></div>
<p>&nbsp;</p>
<div id="attachment_991" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-recrewrite.png"><img class="size-medium wp-image-991" title="2d-recrewrite" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-recrewrite-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">Rec? Re-Write</p></div>
<div id="attachment_990" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-write.png"><img class="size-medium wp-image-990" title="2d-write" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-write-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">Write</p></div>
<p>&nbsp;</p>
<div id="attachment_998" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-strideread.png"><img class="size-medium wp-image-998" title="2d-strideread" src="http://www.mywushublog.com/wp-content/uploads/2010/06/2d-strideread-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">Strided Read</p></div>
<p>The S2N9900 is a pretty nice device. Although you have to use TELNET (yeesh, couldn&#8217;t they spend a few more bucks on a small ARM processor and use ssh?), the controllers have a decent command line environment with HELP pages. What is also nice is the company provides the documentation for their products for free, and no registration is required. Good Job!</p>
<p>As far as raw read and write speeds, that is hard to nail down. I&#8217;ve been using IOZone, and when I run that, and take a look at &#8216;zpool iostat 1&#8242;, the ZFS Pool stays at a constant 200MB/sec for writes. I&#8217;ve seen in pop up higher, like 250MB to 500MB, but 200 seems to be the ceiling. I&#8217;ve done with and without a dedicated log device, with and without gmultipath, and finally, using the SSD RAID1 as a L2ARC cache device. All results are nearly identical. Reads are pretty crazy though, with 64GB of system memory, reading a file is nearly 1GB/sec.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2010/06/freebsd-and-multipath/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FreeBSD 8.0 = A Great NAS Server</title>
		<link>http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/</link>
		<comments>http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 04:30:23 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[kickassery]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=646</guid>
		<description><![CDATA[I need to share this. When I google for &#8220;Samba performance&#8221;, I never see real numbers, real configuration files, or real hardware environments. All I read are anecdotal recollections, and that is not good enough. I like numbers, and I&#8217;ll let the numbers speak for themselves: &#62; netstat -I em0 ...]]></description>
			<content:encoded><![CDATA[<p>I need to share this. When I google for &#8220;Samba performance&#8221;, I never see real numbers, real configuration files, or real hardware environments. All I read are anecdotal recollections, and that is not good enough. I like numbers, and I&#8217;ll let the numbers speak for themselves:</p>
<pre>    &gt; netstat -I em0 -w 1
                input          (em0)           output
       packets  errs      bytes    packets  errs      bytes colls
         90166     0   98762637      95363     0    5332847     0
         18131     0   24713156      20042     0    1123684     0
             4     0        310          1     0        178     0
             8     0        518          1     0        178     0
         10153     0   10952920      10696     0     598129     0
         92990     0  102837002      98476     0    5514994     0
         92025     0  102680574      97277     0    5439496     0
         92080     0  101799874      97403     0    5448637     0
         75348     0   90861608      80972     0    4537737     0
         90895     0  100323946      95781     0    5360948     0
         89313     0   97371154      94364     0    5278618     0
         81363     0   89229738      85861     0    4803589     0
             2     0        126          3     0        286     0</pre>
<p>I was so shocked that I had to use gstat and zpool iostat to verify the information:</p>
<pre>    dT: 1.002s  w: 1.000s  filter: da0
     L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
       35   1476      0      0    0.0   1476 188421   23.7  100.0| da0

    &gt; zpool iostat  1
                   capacity     operations    bandwidth
    pool         used  avail   read  write   read  write
    ----------  -----  -----  -----  -----  -----  -----
    tank        5.68T  4.32T      1     81   250K  10.1M
    tank        5.68T  4.32T      0  1.37K      0   175M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M</pre>
<p>This is all through Samba (3.3.9), There was no local work being done. I unfortunately didn&#8217;t configure MRTG correctly, so it had built a malformed graph while all this happened. Having a picture from all of this would have been nice.</p>
<p>The underlying storage is a SATABoy2 RAID6 array, with a simple &#8220;flat&#8221; ZFS filesystem (version 13). As cheap as the SATABoy&#8217;s are (and come on, they have a terrible IIS web interface), they can at least keep up with the current load.</p>
<p>I have felt that if you are going to use ZFS, you should let it manage the RAID, and not bother with a hardware RAID controller. While the hardware RAID may be faster, ZFS&#8217;s ability to self-correct bad blocks is a great feature despite the performance set back. However, RAID6 is pretty good in itself, and having dual parity would ideally reduce the risk of a bad block being detrimental.</p>
<p>One thing I noticed with Samba is it doesn&#8217;t seem to be a threaded daemon. When I do a top(1) -H, there are only 2-3 smbd processes, and one of them is running around 30%. Though I don&#8217;t really know how well Samba can scale out, this environment only has about 10 users. I would like to see how samba reacts if there are a couple hundred active users. Furthermore, how does a native Windows server handle a couple hundred users? It may handle it a little better, however, I don&#8217;t think I would enjoy watching NTFS handling a multi-terabyte volume&#8230; it would be like watching a stroke victim eat a bowl of soup. I do admit I am biased and I have no working experience with Windows as a large file server, most of them that I have worked on are horribly limited and underpowered, and no one seems to care if they perform well or not.</p>
<h3>Hardware</h3>
<h4>CPU information</h4>
<pre>    Machine class:    amd64
    CPU Model:    Dual Core AMD Opteron(tm) Processor 285
    No. of Cores:    4
    Cores per CPU:</pre>
<h4>RAM information</h4>
<pre>    Memory information from dmidecode(8)
    Maximum Capacity: 8 GB
    Number Of Devices: 4
    Maximum Capacity: 8 GB
    Number Of Devices: 4

    INFO: Run `dmidecode -t memory` to see further information.

    System memory summary
    Total real memory available:    8048 MB
    Logically used memory:        2876 MB
    Logically available memory:    5172 MB

    Swap information
    Device          1K-blocks     Used    Avail Capacity
    /dev/da1s1b       8373844      28K     8.0G     0%</pre>
<h4>Storage information</h4>
<pre>    Available hard drives:
    cd0:  Removable CD-ROM SCSI-0 device
    cd0: 1.000MB/s transfers
    da2:  Fixed Direct Access SCSI-5 device
    da2: 300.000MB/s transfers
    da2: Command Queueing enabled
    da2: 140009MB (286739329 512 byte sectors: 255H 63S/T 17848C)
    da1:  Fixed Direct Access SCSI-2 device
    da1: 300.000MB/s transfers
    da1: Command Queueing enabled
    da1: 69618MB (142577664 512 byte sectors: 255H 63S/T 8875C)
    da0:  Fixed Direct Access SCSI-5 device
    da0: 200.000MB/s transfers
    da0: Command Queueing enabled
    da0: 10491861MB (21487333120 512 byte sectors: 255H 63S/T 1337524C)

    Raid controllers:
    umass-sim0:
    mpt0:
    vendor='LSI Logic (Was: Symbios Logic, NCR)'
    device='SAS 3000 series, 4-port with 1064 -StorPort'
    isp0:
    vendor='QLogic Corporation'
    device='QLA6322 Fibre Channel Adapter'

    Currently mounted filesystems:
    /dev/da1s1a on /
    devfs on /dev
    tank on /tank
    /dev/ufs/EXPORT on /export

    I/O statistics:
           tty             da0              da1              da2             cpu
     tin  tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
       0    40 63.61 167 10.36  16.53   2  0.03  61.65   0  0.00   1  0  4  0 94
    INFO: Run iostat(8) or gstat(8) to see live statistics.

    Disk usage:
    Filesystem         Size    Used   Avail Capacity  Mounted on
    /dev/da1s1a         58G    3.4G     50G     6%    /
    devfs              1.0K    1.0K      0B   100%    /dev
    tank               9.8T    5.7T    4.1T    58%    /tank
    /dev/ufs/EXPORT    126G    148K    116G     0%    /export</pre>
<h3>Software</h3>
<ul>
<li>FreeBSD 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 amd64</li>
<li>samba-3.3.9         A free SMB and CIFS client and server for UNIX</li>
</ul>
<h4>Samba 3.3.9 Compile-Time Config</h4>
<pre>&gt; make showconfig
===&gt; The following configuration options are available for samba-3.3.9:
     LDAP=on "With LDAP support"
     ADS=on "With Active Directory support"
     CUPS=off "With CUPS printing support"
     WINBIND=on "With WinBIND support"
     SWAT=off "With SWAT WebGUI"
     ACL_SUPPORT=on "With ACL support"
     AIO_SUPPORT=on "With Asyncronous IO support"
     FAM_SUPPORT=on "With File Alteration Monitor"
     SYSLOG=on "With Syslog support"
     QUOTAS=on "With Disk quota support"
     UTMP=off "With UTMP accounting support"
     PAM_SMBPASS=on "With PAM authentication vs passdb backends"
     DNSUPDATE=off "With dynamic DNS update(require ADS)"
     DNSSD=off "With DNS service discovery support"
     EXP_MODULES=on "With experimental modules"
     POPT=on "With system-wide POPT library"
     MAX_DEBUG=off "With maximum debugging"
     SMBTORTURE=off "With smbtorture"
===&gt; Use 'make config' to modify these settings</pre>
<h3>System Tuning</h3>
<h4>The Kernel</h4>
<p>I enabled device polling, and took out debugging in the kernel (Sanders, get it! Mmm, I&#8217;m hungry&#8230;)</p>
<pre>diff /usr/src/sys/amd64/conf/GENERIC /usr/src/sys/amd64/conf/SANDERS
    33d32
    &lt; makeoptions    DEBUG=-g        # Build kernel with gdb(1) debug symbols
    78c77
    &lt;
    ---
    &gt; options        DEVICE_POLLING</pre>
<h4>/boot/loader.conf</h4>
<pre>    ispfw_load="YES"
    kern.hz="2000"
    aio_load="YES"</pre>
<h4>/etc/sysctl.conf</h4>
<pre>    kern.coredump=0
    security.bsd.see_other_uids=0
    security.bsd.see_other_gids=0
    kern.ipc.maxsockbuf=16777216
    kern.ipc.nmbclusters=32768
    kern.ipc.somaxconn=32768
    kern.maxfiles=65536
    kern.maxfilesperproc=32768
    kern.maxvnodes=800000
    net.inet.tcp.delayed_ack=0
    net.inet.tcp.inflight.enable=0
    net.inet.tcp.path_mtu_discovery=0
    net.inet.tcp.recvbuf_auto=1
    net.inet.tcp.recvbuf_inc=524288
    net.inet.tcp.recvbuf_max=16777216
    net.inet.tcp.recvspace=65536
    net.inet.tcp.sendbuf_auto=1
    net.inet.tcp.sendbuf_inc=524288
    net.inet.tcp.sendspace=65536
    net.inet.udp.maxdgram=57344
    net.inet.udp.recvspace=65536
    net.local.stream.recvspace=65536
    net.inet.tcp.sendbuf_max=16777216
    net.inet.tcp.mssdflt=9142</pre>
<h4>rc.conf (em0 flags)</h4>
<p>I want to thank Zilla (see post comments) for the sysctl.conf help.</p>
<pre>    ifconfig_em0="inet xxx.xxx.xxx.xxx  netmask 255.255.255.0 polling tso mtu 9194"</pre>
<h4>smb.conf</h4>
<pre>        min receivefile size = 131072
        aio read size = 1
        aio write size = 1
        use sendfile = yes
        lock directory = /var/run/samba/
        keepalive = 300</pre>
<p>I&#8217;m also using LDAP users and group. I wasn&#8217;t sure if there would be a noticible performance hit for local users or LDAP users. There doesn&#8217;t seem to be one.</p>
<p>We use Active Directory, and since Quest/Vintela still won&#8217;t make a FreeBSD client for the Quest Authentication Servers ( a sales rep once told me &#8220;There are just too many versions of BSD&#8230;&#8221;) , I have to use all the open source utilities like OpenSSL, OpenLDAP Client and Kerberos. I don&#8217;t mind having to do it, but it is always nice if you can maintain one standard process across ALL systems, and we have a lot more Linux and Solaris systems than FreeBSD. I&#8217;m the odd one.</p>
<p>That aside, I use the latest OpenSSL in FreeBSD 8.0, OpenLDAP 2.4.20, and the built-in version of Heimdal Kerberos.</p>
<p>I get similar performance form NFS, however, most desktop users have are either on a Windows or OS X, and CIFS seems to be the unifying network storage protocol.</p>
<p>One thing I have yet to really figure out is configuring Samba to use proper NT ACL&#8217;s. However, if you can live with UNIX style permissions, a setup like this is pretty good at serving out lots and lots of data. Maybe that will be next.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ZFS updated in FreeBSD 7.2!</title>
		<link>http://www.mywushublog.com/2009/07/zfs-updated-in-freebsd-7-2/</link>
		<comments>http://www.mywushublog.com/2009/07/zfs-updated-in-freebsd-7-2/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 21:11:47 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=454</guid>
		<description><![CDATA[FreeBSD 7.x has been using version 6 of ZFS, and originally only 8.0 was going to have the newly updated ZFS version: 13. Last week the core team MFC&#8217;d (Merge From Current) the ZFS updates to 7.2, so I cvsup&#8217;d and re-build my server&#8217;s kernel and world ( with a ...]]></description>
			<content:encoded><![CDATA[<p>FreeBSD 7.x has been using version 6 of ZFS, and originally only 8.0 was going to have the newly updated ZFS version: 13.</p>
<p>Last week the core team MFC&#8217;d (Merge From Current) the ZFS updates to 7.2, so I cvsup&#8217;d and re-build my server&#8217;s kernel and world ( with a simple &#8220;make buildworld &#038;&#038; make buildkernel &#038;&#038; make installworld &#038;&#038; make installkernel ), rebooted, and now I have the latest ZFS version running:</p>
<pre>
[root@server ~]> zpool upgrade -v
This system is currently running ZFS pool version 13.

The following versions are supported:

VER  DESCRIPTION
---  --------------------------------------------------------
 1   Initial ZFS version
 2   Ditto blocks (replicated metadata)
 3   Hot spares and double parity RAID-Z
 4   zpool history
 5   Compression using the gzip algorithm
 6   bootfs pool property
 7   Separate intent log devices
 8   Delegated administration
 9   refquota and refreservation properties
 10  Cache devices
 11  Improved scrub performance
 12  Snapshot properties
 13  snapused property
For more information on a particular version, including supported releases, see:

http://www.opensolaris.org/os/community/zfs/version/N

Where 'N' is the version number.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2009/07/zfs-updated-in-freebsd-7-2/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>FreeBSD 7.0, ZFS and iSCSI</title>
		<link>http://www.mywushublog.com/2008/06/freebsd-70-zfs-and-iscsi/</link>
		<comments>http://www.mywushublog.com/2008/06/freebsd-70-zfs-and-iscsi/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 01:19:50 +0000</pubDate>
		<dc:creator>Mike Carlson</dc:creator>
				<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[kickassery]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=44</guid>
		<description><![CDATA[A friend of mine got my the coolest birthday present I think I&#8217;ve ever recieved, and that was a bunch of new and super kick ass hardware. This will soon replace my current server, which is in such bad shape it cannot compile java code, or perl from source. Before ...]]></description>
			<content:encoded><![CDATA[<p>A friend of mine got my the coolest birthday present I think I&#8217;ve ever recieved, and that was a bunch of new and super kick ass hardware. This will soon replace my current server, which is in such bad shape it cannot compile java code, or perl from source. Before I replace it, I wanted to play around with <a href="http://opensolaris.org/os/community/zfs/">ZFS</a> that comes with <a href="http://www.freebsd.org">FreeBSD</a> 7.0.</p>
<p><img class="aligncenter size-full wp-image-45" title="thanks-chris" src="http://www.mywushublog.com/wp-content/uploads/2008/06/thanks-chris.jpg" alt="" width="500" height="333" /></p>
<p>Here is a quick rundown of it all:</p>
<ul>
<li>Intel Core 2 Duo E6750 (2.66Mhz 4MB cache)</li>
<li>Intel S975XBX2 workstation motherboard</li>
<li>AMCC 3Ware 9650SE 4 port SATA RAID controller (4x PCI-e)
<ul>
<li>Batter backup for the 3Ware so I can enable cached writes</li>
</ul>
</li>
<li>2GB ECC Crucial Memory Kit</li>
<li>750 Watt PC Power &amp; Cooling power supply</li>
<li>ASUS EN6200 LE 16x PCI-e nVidia GFX card</li>
<li>Plextor DVD+RW PX-810SA SATA</li>
<li>4 Western Digital 1TB Drives</li>
</ul>
<p>All of this was of the highest quality, and Chris said since he got my into FreeBSD, he felt I should have a stable and rock solid system since my current &#8220;server&#8221; has died 6 times. So after getting it all put together and powering it up&#8230; it wouldn&#8217;t post. I swapped the cpu with an older Pentium 4D that I&#8217;ve had lying around until my htpc comes back up and that worked. It turns out, the motherboard doesn&#8217;t support the 1333Mhz bus speed of the E6750 Core 2 Duo. So I&#8217;ve done some testing with the p4 as the cpu, and most of the tests were I/O bound and not CPU.</p>
<p>First off was to test out ZFS. Since it is new to FreeBSD (new in general really) I followed a ZFS <a href="http://wiki.freebsd.org/ZFSTuningGuide">tuning guide for 7.0</a> and followed some pretty stock directions:</p>
<pre>$ zpool create tank raidz da0 da1 da2 da3</pre>
<p>Which automatically mounted a 2.7TB filesystem. This was a lot nicer than fooling around with partitioning and filesystem tools. I also like the feature set of ZFS compared to standard RAID&#8217;s like self healing and data checksums. Performance was a little slower. Doing a simple &#8216;dd&#8217; with 1mb block size showed about 101MB/sec</p>
<pre> dd if=/dev/zero of=/tank/1gb.dat bs=1m count=1000<br/>
1000+0 records in<br/>
1000+0 records out<br/>
1048576000 bytes transferred in 10.420047 secs (100630640 bytes/sec)<br/></pre>
<p>Not bad, and since my GigE network cannot saturate that type of I/O I&#8217;m pretty satisfied with those results. I use this system as a network file server, among the other network related services like NAT, www, and mail, so my biggest concern was getting more than 80MB/sec (around gigabit ethernet&#8217;s limit).</p>
<p>BUUUT I am underutilizing my fancy 3Ware raid controller, so I can&#8217;t just leave that alone. I blew away the ZFS volume and created a full RAID5 with the controller. Everything was fine with the exception of fdisk, which isn&#8217;t usable for large volumes. I emailed 3Ware&#8217;s support wondering why my 2.78TB volume was only being partitioned at 722GB. They quickly responded with &#8216;use gpt&#8217;, which I did:</p>
<pre>$ gpt create /dev/da0<br/>
$ gpt add -t ufs /dev/da0<br/>
/dev/da0p1 added<br/>
$ gpt show /dev/da0<br/>
	       start        size  index  contents<br/>
	           0           1         PMBR<br/>
	           1           1         Pri GPT header<br/>
	           2          32         Pri GPT table<br/>
	          34  5859311549      1  GPT part - FreeBSD UFS/UFS2<br/>
	  5859311583          32         Sec GPT table<br/>
	  5859311615           1         Sec GPT header<br/></pre>
<p>I did a newfs -U -O2 and mounted the new /SafeKeg. Another dd test showed higher numbers, about 150MB/sec, and with the tw_cli tool installed I can manage the 3Ware card from FreeBSD itself. Very cool. I did play with iSCSI, exporting a 50GB file to my Windows desktop, but the performance was incredibly slow, like 1-2MB/sec. Terrible! I&#8217;m not sure if Free/NetBSD&#8217;s iscsi-target is at fault, or Window&#8217;s iscs initiator, or if iscsi is just not all that up to snuff. I thought it would be nice to utilize, but I&#8217;d like to expierement with it more to see exactly how much performance I can squeeze out of it.</p>
<p><strong>UPDATE (10/09/2008):</strong></p>
<p>After getting a few comments on my poor iscsi performance, I have patched to the latest version and I have been MUCH happier with the results. On my little home network I&#8217;ve gotten around 40MB/sec for reads and writes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2008/06/freebsd-70-zfs-and-iscsi/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.mywushublog.com/tag/zfs/feed/ ) in 0.44545 seconds, on Feb 5th, 2012 at 10:48 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 5th, 2012 at 11:48 am UTC -->
