After you complete the Back up the Dogtag server files and database procedure, you can perform the Dogtag restore.
Note
.dogtag_restored
file in /etc/salt
.To restore the Dogtag server files and database:
Verify that you have completed the steps described in Prepare for the Dogtag backup and restore.
Select from the following options:
Restore Dogtag files and database automatically as described in Restore the services using Backupninja pipeline.
Restore Dogtag files and database manually:
Log in to the Salt Master node.
In cluster/openstack/barbican.yml
, configure the following pillar:
parameters:
dogtag:
server:
initial_data:
engine: rsync
source: ${_param:backupninja_backup_host}
host: ${_param:openstack_barbican_node01_hostname}.${_param:cluster_domain}
home_dir: '/path/to/backups/' # defaults to '/srv/volumes/backup/backupninja' if not defined
Stop the database service on secondary nodes to temporarily disable replication:
salt -C 'I@dogtag:server:role:slave' service.stop 'dirsrv@pki-tomcat.service'
Apply the restore
state.
Mirantis recommends running the following command using Linux GNU Screen or alternatives.
salt -C 'I@dogtag:server:role:master' state.sls dogtag.server.restore
Start the database service on secondary nodes to enable replication:
salt -C 'I@dogtag:server:role:slave' service.start 'dirsrv@pki-tomcat.service'
Verify that all services are running:
salt -C 'I@dogtag:server' service.status "dirsrv@pki-tomcat.service"
Expected system response:
kmn02.example.domain.local:
True
kmn03.example.domain.local:
True
kmn01.example.domain.local:
True
Apply the states below in the following strict order:
salt -C 'I@salt:master' state.sls salt,reclass
salt -C 'I@dogtag:server and *01*' state.sls dogtag.server
salt -C 'I@dogtag:server' state.sls dogtag.server
salt -C 'I@haproxy:proxy' state.sls haproxy
salt -C 'I@barbican:server and *01*' state.sls barbican.server
salt -C 'I@barbican:server' state.sls barbican.server
salt -C 'I@barbican:server' cmd.run "rm /etc/barbican/alias/*"
salt -C 'I@barbican:server' service.restart apache2
If the barbican.server
state fails with the
"Rendering SLS 'base:barbican.server' failed: Jinja variable
'dict object' has no attribute 'key'"
error that may occur,
for example, due to the mine data deletion after calling the
mine.flush
function:
Obtain the Dogtag certificate location:
salt -C 'I@dogtag:server:role:master' pillar.get dogtag:server:export_pem_file_path
Example of system response:
/etc/dogtag/kra_admin_cert.pem
Apply the following state:
Note
In the state below, substitute the certificate path with the one you obtained in the previous step.
salt -C 'I@dogtag:server:role:master' mine.send dogtag_admin_cert \
mine_function=cmd.run 'cat /etc/dogtag/kra_admin_cert.pem'
Rerun the failed Barbican state.