summaryrefslogtreecommitdiff
path: root/qpid/doc/book/src/java-broker/Java-Broker-Backup-And-Recovery.xml
blob: 09bb2b4fcc0a8aaeeb84ec3b05d1b9866a331e0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?xml version="1.0"?>
<!DOCTYPE entities [
<!ENTITY %  entities SYSTEM  "commonEntities.xml">
%entities;
]>
<!--

 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.

-->

<chapter id="Java-Broker-Backup-And-Recovery">
  <title>Backup And Recovery</title>
  <section id="Java-Broker-Backup-And-Recovery-Broker">
    <title>Broker</title>
    <para>To perform a complete backup whilst the Broker is shutdown, simply copy all the files the
      exist beneath <literal>${QPID_WORK}</literal>, assuming all virtualhost nodes and virtualhost
      are in their standard location, this will copy all configuration and persistent message data. </para>
    <para>There is currently no safe mechanism to take a complete copy of the entire Broker whilst
      it is running.</para>
  </section>
  <section id="Java-Broker-Backup-And-Recovery-Virtualhost-Node">
    <title>Virtualhost Node</title>
    <para>To perform a complete backup of a Virtualhost node whilst it is stopped (or Broker down),
      simply copy all the files the exist beneath
        <literal>${QPID_WORK}/&lt;nodename&gt;/config</literal>, assuming the virtualhost node is in
      the standard location. This will copy all configuration that belongs to that virtualhost
      node.</para>
    <para>The technique for backing up a virtualhost node whilst it is running depends on its
      type.</para>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-Node-BDB">
      <title>BDB</title>
      <para>Qpid Broker distribution includes the "hot" backup utility <literal>backup.sh</literal>
        which can be found at broker bin folder. This utility can perform the backup when broker is
        running.</para>
      <para><literal>backup.sh</literal> script invokes
          <classname>org.apache.qpid.server.store.berkeleydb.BDBBackup</classname> to do the
        job.</para>
      <para>You can also run this class from command line like in an example below:</para>
      <example>
        <title>Performing store backup by using <classname>BDBBackup</classname> class
          directly</title>
        <cmdsynopsis>
          <command>java</command>
          <arg choice="plain">-cp qpid-bdbstore-&qpidCurrentRelease;.jar</arg>
          <arg choice="plain">org.apache.qpid.server.store.berkeleydb.BDBBackup</arg>
          <sbr/>
          <arg choice="plain">-fromdir <replaceable>${QPID_WORK}/&lt;nodename&gt;/config</replaceable></arg>
          <arg choice="plain">-todir <replaceable>path/to/backup/folder</replaceable></arg>
        </cmdsynopsis>
      </example>
      <para>In the example above BDBBackup utility is called from
        qpid-bdbstore-&qpidCurrentRelease;.jar to backup the store at
          <literal>${QPID_WORK}/&lt;nodename&gt;/config</literal> and copy store logs into
          <literal>path/to/backup/folder</literal>.</para>
      <para>Linux and Unix users can take advantage of <literal>backup.sh</literal> bash script by
        running this script in a similar way.</para>
      <example>
        <title>Performing store backup by using <classname>backup.sh</classname> bash script</title>
        <cmdsynopsis>
          <command>backup.sh</command>
          <arg choice="plain">-fromdir <replaceable>${QPID_WORK}/&lt;nodename&gt;/config</replaceable></arg>
          <arg choice="plain">-todir <replaceable>path/to/backup/folder</replaceable></arg>
        </cmdsynopsis>
      </example>
    </section>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-Node-BDB-HA">
      <title>BDB-HA</title>
      <para>See <xref linkend="Java-Broker-Backup-And-Recovery-Virtualhost-Node-BDB"/></para>
    </section>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-Node-Derby">
      <title>Derby</title>
      <para>Not yet supported</para>
    </section>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-Node-JDBC">
      <title>JDBC</title>
      <para>The responsibility for backup is delegated to the database server itself. See the
        documentation accompanying it. Any technique that takes a consistent snapshot of the
        database is acceptable.</para>
    </section>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-Node-JSON">
      <title>JSON</title>
      <para>JSON stores its config in a single text file. It can be safely backed up using standard
        command line tools.</para>
    </section>
  </section>
  <section id="Java-Broker-Backup-And-Recovery-Virtualhost">
    <title>Virtualhost</title>
    <para>To perform a complete backup of a Virtualhost whilst it is stopped (or Broker down),
      simply copy all the files the exist beneath
        <literal>${QPID_WORK}/&lt;name&gt;/messages</literal>, assuming the virtualhost is in the
      standard location. This will copy all messages that belongs to that virtualhost.</para>
    <para>The technique for backing up a virtualhost whilst it is running depends on its
      type.</para>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-BDB">
      <title>BDB</title>
      <para>Use the same backup utility described above, but use the path
          <literal>${QPID_WORK}/&lt;name&gt;/messages</literal> instead.</para>
    </section>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-Derby">
      <title>Derby</title>
      <para>Not yet supported</para>
    </section>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-JDBC">
      <title>JDBC</title>
      <para>The responsibility for backup is delegated to the database server itself. See the
        documentation accompanying it. Any technique that takes a consistent snapshot of the
        database is acceptable.</para>
    </section>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-Provided">
      <title>Provided</title>
      <para>The contents of the virtualhost will be backed up as part of virtualhost node that
        contains it.</para>
    </section>
    <section id="Java-Broker-Backup-And-Recovery-Virtualhost-BDBHA">
      <title>BDB-HA</title>
      <para>The contents of the virtualhost will be backed up as part of virtualhost node that
        contains it.</para>
    </section>
  </section>

</chapter>