wiki:ConfiguringAServer

Configuring a Server

Server basic setup

Create a user to run the server under:

useradd _bbstored

Create /etc/boxbackup/raidfile.conf and /etc/boxbackup/bbstored.conf, storing backups in /mnt/backup:

/usr/local/sbin/raidfile-config /etc/boxbackup 4096 /mnt/backup
/usr/local/sbin/bbstored-config /etc/boxbackup hostname _bbstored

(See OpenSSLNotes if you get an OpenSSL error)

(set hostname to the address the clients will use to contact this server) Are you using a NAT device or firewall? See the note below.

Read the output for details of what to do next. There is an example at the end of this page, but do follow the instructions output when you run the script yourself.

Make sure the user can write to the raid file directories! For more precise control, create a backup directory within each of the raid root directories, and change their permissions accordingly.

If there are other users on this server, you will probably want to stop other users reading the certificates.

 chown -R _bbstored /etc/boxbackup/bbstored
 chmod -R go-rwx /etc/boxbackup/bbstored

Configuration for hosts behind a NAT device or firewall

The hostname specified is used for 1) the name in the server's certificate and 2) the address the server will listen on.

If the IP address of the machine isn't the same as the IP address it appears to have to the outside world (because the NAT device or firewall translates it), then this will fail. The server will look up the hostname, and then fail to bind to that address since it is not a local address.

To get around this, you have two options. Either specify the local IP address with the bbstored-config command (the name in the certificate won't match the real address, but this is not a problem at the moment), or specify the real address, but edit the bbstored.conf file and correct the ListenAddresses directive later to reflect the local address.

Get certified

As per the instructions in the certificates and accounts management page, sign your certificate and install it as directed.

Start the server

 /usr/local/sbin/bbstored

Add this to your system startup scripts.

Please read the Troubleshooting page if you have problems.

If you configured the server so the configuration file is somewhere other than /etc/boxbackup/bbstored.conf, run the server as, for example,

 /usr/local/sbin/bbstored /some/other/config/dir/bbstored.conf

root not required

The backup server is configured to be run as root, but changes user to the user you specify as soon as it can -- this is simply for convenience when starting the daemon in system start up scripts. However, you can run without root entirely by making a small change to the configuration file.

Example configuration output

This is an example of output from the bbstored-config script. Important: Follow the instructions output by your script, not the ones here -- they may be different for your system.

 # /usr/local/sbin/bbstored-config /etc/boxbackup server.example.com _bbstored                                    
 Checking permissions on /raid/0.0/backup
 Checking permissions on /raid/0.1/backup
 Checking permissions on /raid/0.2/backup
 
 Setup bbstored config utility.
 
 Configuration:
    Writing configuration file: /etc/boxbackup/bbstored.conf
    Writing empty accounts file: /etc/boxbackup/bbstored/accounts.txt
    Server hostname: server.example.com
    RaidFile config: /etc/boxbackup/raidfile.conf
 
 Creating /etc/boxbackup/bbstored
 Creating blank accounts file
 Generating private key...
  [OpenSSL output omitted]
 
 Writing configuration file /etc/boxbackup/bbstored.conf
 
 ===================================================================
 
 bbstored basic configuration complete. 
 
 What you need to do now...
 
 1) Sign /etc/boxbackup/bbstored/server.example.com-csr.pem
    using the bbstored-certs utility.
 
 2) Install the server certificate and root CA certificate as
       /etc/boxbackup/bbstored/server.example.com-cert.pem
       /etc/boxbackup/bbstored/clientCA.pem
 
 3) You may wish to read the configuration file
       /etc/boxbackup/bbstored.conf
    and adjust as appropraite.
 
 4) Create accounts with bbstoreaccounts
 
 5) Start the backup store daemon with the command
       /usr/local/sbin/bbstored
    in /etc/rc.local, or your local equivalent.
 
 ===================================================================

Log files

You may wish to see what's going on with the server. Edit /etc/syslog.conf, and add

 local6.info                         /var/log/box
 local5.info                         /var/log/raidfile

Note separators must be tabs, otherwise it ignores you.

 touch /var/log/box
 touch /var/log/raidfile

And then get them rotated, by adding in /etc/newsyslog.conf

 /var/log/box                644  7    2000 *     Z
 /var/log/raidfile           644  7    2000 *     Z

Then restart syslogd.

Logrotate on Linux

Here is an excellent explanation of log rotation on Linux: http://www.ducea.com/2006/06/06/rotating-linux-log-files-part-2-logrotate/ . In a nutshell, as root, edit /etc/logrotate.conf (on Ubuntu, do 'sudo vim /etc/logrotate.conf'), and add an edited version of the following lines to the bottom (see man logrotate for details):

/var/log/box { 
    missingok 
    daily 
    delaycompress 
    mailfirst 
    mail <your email address> 
    create 0664 _bbstored users 
    rotate 7 
} 

Edits to this Linux Logs section welcome!

RAID setup

The use of Box Backup's built-in software RAID is no longer encouraged. On new installations, please disable it.

You can disable RAID by specifying the same path three times when running raidfile-config to create /etc/boxbackup/raidfile.conf:

 /usr/local/sbin/raidfile-config /etc/boxbackup 4096 /mnt/backup

4096 is the block size. Under BSD with FFS, set this to your filing system's fragment size (most likely an 8th of the block size), otherwise the block size of the filing system, for maximum efficiency. 4096 bytes is a common block size for ext2/ext3/ext4 on Linux.

Edit /etc/boxbackup/raidfile.conf if you have another set of three discs you want to use -- just add another section for each set.

Choose your destination wisely

Box Backup provides a low-bandwidth path between the client bbackupd and server bbstored. Do not place a slow network between bbstored and the disk, or use a slow disk. Or if you do, then don't come complaining to us about it.

Users have reported problems (very poor performance) with some cheap NAS devices (e.g. Iomega StorCenter? 150d, Linksys NSS6000). If you back up to such a device and have poor performance, please check how it performs with a lot of small files in general (e.g. time copying a Linux source tree onto it) and consider raising a bug report with the manufacturer.

If you want external storage it is recommended to use e.g. USB or FireWire? harddisks or eSATA, all of them have very high data bandwidth. Unfortunately the cable lengths are limited.

Last modified 3 years ago Last modified on May 2, 2012, 11:46:43 AM