Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.

This article describes the way to make a Disaster Recovery Site of a Confluence Installation

Indholdsfortegnelse

Assumptions taken below

WhatWhere
Confluence Installation Directory/opt/confluence
Confluence Home Directory

/opt/confluence-data

MySQL BackupSetup and working, backing up to /backup/mysqlbackup/
Disaster Recovery (Stand by) Server DNS name

drserver.site.dk

rsync between serversSetup and working via SSH keys

 

rsyncing MySQL, Confluence Installation and Confluence Home

...

Files

The MySQL backup of the Confluence database and the files of the installation must be syncronised to the alternate server (called drserver.site.dk)

...

code
Kodeblok
title/scripts/CreateConfluenceDatabase.sql
drop database confluence;
create database confluence CHARACTER SET utf8 COLLATE utf8_bin;
grant all privileges on confluence.* to confluence@localhost identified by 'confconf';
flush privileges;

 

 

Why change the server.xml and setenv.sh

...

Now, change the files as needed.

 

Restore Confluence script

This is the script that restores the Confluence on the DR server drserver.site.dk - It needs the files from above to work.

Kodeblok
#!/bin/bash

if [ `id | grep "uid=0(root)" | wc -l` -lt 1 ]
then
	echo "must be executed as root"
	exit 1
fi


if [ -f /mysqlbackup/confluence.sql ]
then
	rm /mysqlbackup/confluence.sql
fi


echo "Unpacking Confluence database backup"
gunzip -c /mysqlbackup/confluence.sql.gz > /mysqlbackup/confluence.sql
 
echo "Dropping and Creating Confluence and JIRA databases"
mysql -uroot -password < /scripts/CreateConfluenceDatabase.sql


echo "Importing Confluence database backup into MySQL - This takes a while..."
mysql -uroot -password < /mysqlbackup/confluence.sql


if [ $? -eq 0 ]
then
	echo "Import finished ok"
else
	echo "mysql client ended with exit code different from 0. Stopping script"
	exit 1
fi

echo "Copying server.xml and setenv.sh to Confluence configuration"
cp /scripts/server.xml.confluence /opt/confluence/conf/server.xml
cp /scripts/setenv.sh.confluence /opt/confluence/bin/setenv.sh
rm /opt/confluence/logs/catalina.out

echo "Ready for Starting Confluence for http://drserver.site.dk"
echo "Start with: /opt/confluence/bin/startup.sh;tail -f /opt/confluence/logs/catalina.out"