Skip to content

Instantly share code, notes, and snippets.

@dbirks
Last active July 13, 2022 09:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dbirks/da79e2032e055ce613619804e5b59184 to your computer and use it in GitHub Desktop.
Save dbirks/da79e2032e055ce613619804e5b59184 to your computer and use it in GitHub Desktop.
Install Urbackup on CentOS 7 using ZFS

Installing Urbackup on CentOS using ZFS

Here's the details on installing Urbackup on the ZFS file system on the stable CentOS 7.

  • Install CentOS 7. I'll be using the Minimal install.
    • Once you have the .iso, write it to a CD or USB drive. I recommend using Rufus if you're on Windows to write it to USB.
    • Go ahead and boot to it.
    • Most of the defaults on the Installation Summary page should be good. However you will want to:
      • Confirm the time zone is correct.
      • Click the disk you want to install to.
      • Enable the network and set a hostname.
    • On the next page, set a root password and make a user account.
      • Check the box to make the user administrator.
    • After it's finished installing, reboot and log in as the user you created.
  • (Side note, you may want to ssh into your machine now to make copy and pasting commands easier.)
  • First thing you'll want to do is get your system up to date with sudo yum update
  • Install some other programs with sudo yum install vim wget
  • Install ZFS using the guide here. I'll list the commands below as well.
  • Download the package: sudo yum localinstall http://download.zfsonlinux.org/epel/zfs-release$(rpm -E %dist).noarch.rpm
  • Add zfsonlinux's gpg key with gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
  • Modify the repo file with sudo vim /etc/yum.repos.d/zfs.repo so that zfs-kmod is the only repository enabled. The guide mentioned above might make it more clear.
  • Install ZFS with sudo yum install zfs
  • Enable the ZFS kernel module with sudo modprobe zfs
  • Now we can create a pool of disks.
  • Check which disks are available with lsblk. The disk with your OS on it will probably be sda, with the other disks being sdb, sdc, or the like.
  • I just have one disk right now, so I'm going to create a pool named ocean with the command sudo zpool create ocean sdb -f
    • The -f flag is to force an overwrite of data. It is very important to double-check that sdb is referring to the actual disk you want to erase.
  • I am also going to enable compression with sudo zfs set compression=lz4 ocean
  • By default, your pool will now be mounted at /ocean.
  • Now we can install Urbackup.
  • Set up uroni's repo.
    • Change directories into the repo listings with cd /etc/yum.repos.d/
    • Download the repo config file with sudo wget http://download.opensuse.org/repositories/home:uroni/CentOS_7/home:uroni.repo
  • Install Urbackup with sudo yum install urbackup-server
  • Start Urbackup with sudo systemctl start urbackup-server
  • Enable it to start on boot with sudo systemctl enable urbackup-server
  • Make a subdirectory for Urbackup to store its files in with sudo mkdir /ocean/urbackup
  • Give ownership to the urbackup user with sudo chown urbackup:urbackup /ocean/urbackup
  • Now we can configure Urbackup.
  • Go to the web config page at http://hostname:55414.
  • Under Settings, you'll want to change the backup storage path to /ocean/urbackup.

That completes the server setup! You'll want to install the clients on each of the machines now.

@dashdanw
Copy link

dashdanw commented Apr 9, 2020

thanks this was really helpful, it's worth mentioning that this was also useful:
https://github.com/openzfs/zfs/wiki/RHEL-and-CentOS

additionally you need to make sure that you open up the ports or you might not be able to connect

sudo firewall-cmd --add-port=55413/tcp --permanent && \
sudo firewall-cmd --add-port=55414/tcp --permanent && \
sudo firewall-cmd --add-port=55415/tcp --permanent && \
sudo firewall-cmd --add-port=35623/udp --permanent && \
sudo firewall-cmd firewall-cmd --reload

@crsleeth
Copy link

Should be sufficient:

firewall-cmd --permanent --add-service=urbackup-server
firewall-cmd --reload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment