This is a step per step guide on how to install and configure Wal-E on a Ubuntu 16.04 or Ubuntu 14.04 server.
-
First install the required packages from apt
apt install -y python3-setuptools daemontools \ python3-pip python3-venv lzop \ software-properties-common \ apt-transport-https pvfor Ubuntu 14.04 use
apt install -y python3-setuptools daemontools python3-pip lzop \ software-properties-common apt-transport-https pv # then install virtualenv pip3 install virtualenv -
Create a virtual environment for Wal-E
python3 -m venv /opt/wal-efor Ubuntu 14.04 use
python3 -m virtualenv /opt/wal-e -
In some cases you may get an error which says you're missing
python3-venvand you need to install it. In this case you need to update your locales with
export LC_ALL="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" sudo dpkg-reconfigure locales
-
Upgrade PIP
/opt/wal-e/bin/pip3 install --upgrade pip -
Install Wal-E and required Swift clients
/opt/wal-e/bin/pip3 install wal-e python-swiftclient python-keystoneclient -
Create Wal-E environment folder which holds the configuration
mkdir -p /etc/wal-e.d/env -
Create the environment files for Wal-E
-
WALE_SWIFT_PREFIX
swift://CONTAINER_NAME
- SWIFT_AUTHURL
https://example.com:8010/auth/v1.0
- SWIFT_USER
storage_account:access_key_id
The storage account is from your QNAP OSS. Mostly it is the same as the user you created in QNAP management.
- SWIFT_PASSWORD
access_key_secret
- SWIFT_AUTH_VERSION
1
QNAP OSS uses Swift auth version 1.
-
Change owner of Wal-E environment folder to the database user, mostly
postgres.cd /etc chown -R postgres:postgres wal-e.d/ -
Add the following parameters to your
postgresql.confto enable WAL archivingwal_level = archive # hot_standby and logical in 9.x is also acceptable. wal_level should be 'hot_standby' in our setup archive_mode = on archive_command = 'envdir /etc/wal-e.d/env /opt/wal-e/bin/wal-e wal-push %p' archive_timeout = 60
You need to restart PostgreSQL to take the changes effect.
That's it.
There is some issue related to this guide.