|Deletions are marked like this.||Additions are marked like this.|
|Line 180:||Line 180:|
|[[https://help.landscape.canonical.com/LDS/RecommendedDeployment13.09|LDS Recommended Deployment 13.09 ]]
[[https://help.landscape.canonical.com/LDS/BackupNotes|LDS Backup Notes ]]
[[http://www.postgresql.org/docs/9.1/static/backup.html|PostreSQL Backup and Restore ]]
Here are some backup notes for LDS
These are general guidelines that you can follow to backup and restore Landscape Dedicates Server. Please be aware that depending on your specific deployment, additional files and setting may be needed to be backed up and restored. When restoring files from the backup, make sure you restore the original file permission and ownership.
On the Application server
1) Stop the Landscape services on the application server(s):
$ sudo lsctl stop
Please note that LDS can be deployed using several servers, so when you are taking the offline backup route, remember to disable all the Landscape services on all server machines!
2) Take a backup of important files: Remember that upon restoration, you will need to adjust the original file permissions and ownership of these files accordingly.
/etc/landscape: configuration files and the LDS license
/etc/default/landscape-server: file to configure which services will start on this machine
/var/lib/landscape/hash-id-databases: these files are recreated by a weekly cron job, which can take several minutes to run, so backing them up can save time
/etc/apache2/sites-available/: the Landscape Apache vhost configuration file, usually named after the FQDN of the server
/etc/ssl/certs/: the Landscape server X509 certificate is in there
/etc/ssl/private/: the Landscape server X509 key file
/etc/ssl/certs/landscape_server_ca.crt: if in use, this is the CA file for the internal CA used to issue the Landscape server certificates. Clients need to have this file in that case.
/etc/postgresql/9.1/main/: postgresql configuration files, in particular postgresql.conf for the tuning and pg_hba.conf for the access rules. These files may be in a separate host, dedicated to the database (use 8.4 for PostgreSQL version 8.4)
/var/log/landscape/: all the LDS log files (useful - but not mandatory in the restore process)
You may backup any other files that you think are important to your particular case. Files that may not necessarily be part of Landscape or PostgreSQL but that are a part of your custom setup (firewall rules, proxy settings,…etc).
On the Database server
1) Backup the PostgreSQL database as described in the official documentation: The PostgreSQL documentation is quite extensive on backup procedures, we recommend that administrators tasked with database backups read and understand it: http://www.postgresql.org/docs/9.1/static/backup-dump.html A quick way of backing up the database is using pg_dumpall: http://www.postgresql.org/docs/9.1/static/backup-dump.html#BACKUP-DUMP-ALL
On the Database server
When restoring files from the backup, make sure you restore the original file permission and ownership accordingly.
1) Install PostgreSQL and required libraries:
$ sudo apt-get install postgresql-9.1 python-apt postgresql-plpython-9.1 postgresql-contrib-9.1 postgresql-9.1-debversion
2) Create a superuser Landscape can use:
$ sudo -u postgres createuser --createdb --createrole --superuser --pwprompt landscape_superuser (remember this password)
3) Configure PostgreSQL:
Restore from the backup the following files and adjust permissions and ownership accordingly:
4) Restart the service:
$ sudo /etc/init.d/postgresql restart
5) Restoring the Database from the backup as detailed in the official documentation: http://www.postgresql.org/docs/9.1/static/backup-dump.html
On the Application server
1) Adding the Landscape package archive and installing the package:
As part of your LDS purchase, you should have gotten a URL pointing to a private archive which hosts the LDS packages. To access that archive, please follow the instructions on https://landscape.canonical.com/account/<youraccount>/how-to-get-dedicated, replacing <youraccount> with your Landscape account name.
2) Add the sources for LDS: Please add the line corresponding to your version of Ubuntu to a new file, named: /etc/apt/sources.list.d/landscape-dedicated-server.list
Adjust permissions on the sources file:
$ sudo chmod 0640 /etc/apt/sources.list.d/landscape-dedicated-server.list $ sudo chown root:landscape /etc/apt/sources.list.d/landscape-dedicated-server.list
3) Import the signing key for this archive:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 4652B4E6
4) Install the package. Note that it will complain about a missing license file:
$ sudo apt-get update $ sudo apt-get install landscape-server rabbitmq-server apache2-mpm-worker
5) Install the license file by copying it to /etc/landscape:
$ sudo cp license.txt /etc/landscape
Make sure it's readable by everybody, or at least the landscape user:
$ sudo chown root:landscape /etc/landscape/license.txt
6) Configure rabbitmq: Just run the following commands, replacing <password> with the old password. The password can be found in the [broker] section of the /etc/landscape/service.conf file.
$ sudo rabbitmqctl add_user landscape <password> $ sudo rabbitmqctl add_vhost landscape $ sudo rabbitmqctl set_permissions -p landscape landscape ".*" ".*" ".*"
7) Restore from the backup the /etc/rabbitmq/rabbitmq.conf file and adjust permissions and ownership accordingly.
8) Restart the rabbitmq-server service:
$ sudo /etc/init.d/rabbitmq-server restart
9) Restore from the backup the /etc/landscape/service.conf file and adjust permissions and ownership accordingly.
$ sudo setup-landscape-server
11) Restore from the backup the /etc/default/landscape-server file and adjust permissions and ownership accordingly.
12) Restore from the backup the /etc/apache2/sites-available/<YOUR_SITE> file and adjust permissions and ownership accordingly.
13) Restore from the backup the Landscape Server certificate, the CA's certificate and the Landscape Server certificate private key and adjust permissions and ownership accordingly.
14) Enable the following modules:
$ for module in rewrite proxy_http ssl headers expires; do sudo a2enmod $module; done
15) Enable the new site:
$ sudo a2ensite landscape $ sudo service apache2 restart
16) Start Landscape services:
$ sudo lsctl start
17) Access your server at https://<servername>