5.6. Backing Up and Restoring the luci Configuration


As of the Red Hat Enterprise Linux 6.2 release, you can use the following procedure to make a backup of the luci database, which is stored in the /var/lib/luci/data/luci.db file. This is not the cluster configuration itself, which is stored in the cluster.conf file. Instead, it contains the list of users and clusters and related properties that luci maintains. By default, the backup this procedure creates will be written to the same directory as the luci.db file.
  1. Execute service luci stop.
  2. Execute service luci backup-db.
    Optionally, you can specify a file name as a parameter for the backup-db command, which will write the luci database to that file. For example, to write the luci database to the file /root/luci.db.backup, you can execute the command service luci backup-db /root/luci.db.backup. Note, however, that backup files that are written to places other than /var/lib/luci/data/ (for backups whose filenames you specify when using service luci backup-db) will not show up in the output of the list-backups command.
  3. Execute service luci start.
Use the following procedure to restore a luci database.
  1. Execute service luci stop.
  2. Execute service luci list-backups and note the file name to restore.
  3. Execute service luci restore-db /var/lib/luci/data/lucibackupfile where lucibackupfile is the backup file to restore.
    For example, the following command restores the luci configuration information that was stored in the backup file luci-backup20110923062526.db:
    service luci restore-db /var/lib/luci/data/luci-backup20110923062526.db
    
  4. Execute service luci start.
If you need to restore a luci database but you have lost the host.pem file from the machine on which you created the backup because of a complete reinstallation, for example, you will need to add your clusters back to luci manually in order to re-authenticate the cluster nodes.
Use the following procedure to restore a luci database onto a different machine than the one on which the backup was created. Note that in addition to restoring the database itself, you also need to copy the SSL certificate file to ensure that luci has been authenticated to the ricci nodes. In this example, the backup is created on the machine luci1 and the backup is restored on the machine luci2.
  1. Execute the following sequence of commands to create a luci backup on luci1 and copy both the SSL certificate file and the luci backup onto luci2.
    [root@luci1 ~]# service luci stop
    [root@luci1 ~]# service luci backup-db
    [root@luci1 ~]# service luci list-backups
    /var/lib/luci/data/luci-backup20120504134051.db
    [root@luci1 ~]# scp /var/lib/luci/certs/host.pem /var/lib/luci/data/luci-backup20120504134051.db root@luci2:
  2. On the luci2 machine, ensure that luci has been installed and is not running. Install the package, if is not already installed.
  3. Execute the following sequence of commands to ensure that the authentications are in place and to restore the luci database from luci1 onto luci2.
    [root@luci2 ~]# cp host.pem /var/lib/luci/certs/
    [root@luci2 ~]# chown luci: /var/lib/luci/certs/host.pem
    [root@luci2 ~]# /etc/init.d/luci restore-db ~/luci-backup20120504134051.db
    [root@luci2 ~]# shred -u ~/host.pem ~/luci-backup20120504134051.db
    [root@luci2 ~]# service luci start
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.