Skip to content

Commit 1afdecd

Browse files
committed
Updates to examples and body copy on backups doc
1 parent 19fe0f9 commit 1afdecd

File tree

1 file changed

+95
-108
lines changed

1 file changed

+95
-108
lines changed

content/riak/kv/2.1.4/using/cluster-operations/backing-up.md

Lines changed: 95 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,46 @@ aliases:
2020
[plan backend leveldb]: /riak/kv/2.1.4/setup/planning/backend/leveldb
2121
[plan backend bitcask]: /riak/kv/2.1.4/setup/planning/backend/bitcask
2222
[use ref strong consistency]: /riak/kv/2.1.4/using/reference/strong-consistency
23+
[concept aae]: /riak/kv/2.1.4/learn/concepts/active-anti-entropy/
24+
[aae read repair]: /riak/kv/2.1.4/learn/concepts/active-anti-entropy/#read-repair-vs-active-anti-entropy
2325

24-
Riak KV is a [clustered][concept clusters] system built to survive a wide range of
25-
failure scenarios, including the loss of nodes due to network or
26-
hardware failure. Although this is one of Riak's core strengths, it
27-
cannot withstand _all_ failure scenarios. Like any storage system, it
28-
remains susceptible to contingencies such as accidental or malicious
29-
deletions. Many Riak users confront this possibility by backing up their
30-
data, i.e. duplicating their database onto a different long-term storage
31-
mechanism. This document covers how to perform such backups.
32-
33-
Riak backups can be performed using OS features or filesystems that
34-
support snapshots, such as LVM or ZFS, or by using tools like rsync or
35-
tar. Choosing your Riak backup strategy will largely depend on your
36-
already-established backup methodologies, as well as the backend
37-
configuration of your nodes. When backing up a node, it is important to
38-
back up the data, ring, and configuration directories of your nodes.
39-
40-
Due to Riak's eventually consistent nature, backups can become slightly
41-
inconsistent from node to node. Data could exist on some nodes and not
42-
others at the exact time a backup is made. Any inconsistency will be
43-
corrected once a backup is restored, either by Riak's [active anti-entropy](/riak/kv/2.1.4/learn/concepts/active-anti-entropy/) processes or when the object is read, via [read repair](/riak/kv/2.1.4/learn/concepts/active-anti-entropy/#read-repair-vs-active-anti-entropy).
44-
45-
Additionally, backups must be performed on a stopped node to prevent
46-
data loss as a result of the background merging and compaction processes
47-
of Riak's backends. Downtime of a node can be significantly reduced by
48-
using an OS feature or filesystem that supports snapshotting.
26+
Riak KV is a [clustered][concept clusters] system built to survive a wide range of failure scenarios including the loss of nodes due to network or hardware failure. Although this is one of Riak KV's core strengths, it cannot withstand all failure scenarios.
27+
28+
Backing up data; duplicating the database on a different long-term storage system, is a common approach to mitigating potential failure scenarios.
29+
30+
The following document covers how to perform backups of Riak KV data.
31+
32+
## Overview
33+
34+
Riak KV backups can be performed using operating system features or filesystems that support snapshots, such as LVM or ZFS, or by using tools like rsync or tar.
35+
36+
Choosing your Riak KV backup strategy will depend on your already-established backup methodologies and the backend configuration of your nodes.
37+
38+
The basic process for getting a backup of Riak KV from a node is as follows:
39+
40+
1. Stop the node with `riak stop`.
41+
2. Backup the appropriate data, ring, and configuration directories.
42+
3. Start the node.
43+
44+
Downtime of a node can be significantly reduced by using an OS feature or filesystem that supports snapshotting.
45+
46+
{{% note title="Backups and eventual consistency" %}}
47+
Due to Riak KV's eventually consistent nature, backups can become slightly inconsistent from node to node.
48+
49+
Data could exist on some nodes and not others at the exact time a backup is made. Any inconsistency will be corrected once a backup is restored, either by Riak's [active anti-entropy](/riak/kv/2.1.4/learn/concepts/active-anti-entropy/) processes or when the object is read, via [read repair](/riak/kv/2.1.4/learn/concepts/active-anti-entropy/#read-repair-vs-active-anti-entropy).
50+
{{% /note %}}
4951

5052
## OS-Specific Directory Locations
5153

52-
The default Riak data, ring, strong consistency, and configuration
53-
directories for each of the supported operating systems is as follows:
54+
The default Riak KV data, ring, and configuration directories for each of the supported operating systems is as follows:
5455

55-
<div class="note">
56-
<div class="title">Note on upgrading</div>
57-
If you are upgrading to Riak version 2.0 or later from a pre-2.0
58-
release, you can use either your old <code>app.config</code>
59-
configuration file or the newer <code>riak.conf</code> if you wish.
56+
{{% note title="Note on upgrading" %}}
57+
If you are upgrading to Riak KV version 2.0 or later from a pre-2.0 release, you can use either your old `app.config` configuration file or the newer `riak.conf` if you wish.
6058

61-
If you have installed Riak 2.0 directly, you should use only
62-
<code>riak.conf</code>.
59+
If you have installed Riak 2.0 directly, you should use only `riak.conf`.
6360

64-
More on configuring Riak can be found in the [configuration files][config reference]
65-
doc.
66-
</div>
61+
More on configuring Riak KV can be found in the [configuration reference](/riak/kv/2.1.4/configuring/reference).
62+
{{% /note %}}
6763

6864
#### Debian and Ubuntu
6965

@@ -73,6 +69,8 @@ Bitcask | `/var/lib/riak/bitcask`
7369
LevelDB | `/var/lib/riak/leveldb`
7470
Ring | `/var/lib/riak/ring`
7571
Configuration | `/etc/riak`
72+
Cluster Metadata | `/var/lib/riak/cluster_meta`
73+
Search | `/var/lib/riak/yz`
7674
Strong consistency | `/var/lib/riak/ensembles`
7775

7876
#### Fedora and RHEL
@@ -83,6 +81,8 @@ Bitcask | `/var/lib/riak/bitcask`
8381
LevelDB | `/var/lib/riak/leveldb`
8482
Ring | `/var/lib/riak/ring`
8583
Configuration | `/etc/riak`
84+
Cluster Metadata | `/var/lib/riak/cluster_meta`
85+
Search | `/var/lib/riak/yz`
8686
Strong consistency | `/var/lib/riak/ensembles`
8787

8888
#### FreeBSD
@@ -93,6 +93,8 @@ Bitcask | `/var/db/riak/bitcask`
9393
LevelDB | `/var/db/riak/leveldb`
9494
Ring | `/var/db/riak/ring`
9595
Configuration | `/usr/local/etc/riak`
96+
Cluster Metadata | `/var/db/riak/cluster_meta`
97+
Search | `/var/db/riak/yz`
9698
Strong consistency | `/var/db/riak/ensembles`
9799

98100
#### OS X
@@ -103,6 +105,8 @@ Bitcask | `./data/bitcask`
103105
LevelDB | `./data/leveldb`
104106
Ring | `./data/riak/ring`
105107
Configuration | `./etc`
108+
Cluster Metadata | `./data/riak/cluster_meta`
109+
Search | `./data/riak/yz`
106110
Strong consistency | `./data/ensembles`
107111

108112
**Note**: OS X paths are relative to the directory in which the package
@@ -116,6 +120,8 @@ Bitcask | `/var/db/riak/bitcask`
116120
LevelDB | `/var/db/riak/leveldb`
117121
Ring | `/var/db/riak/ring`
118122
Configuration | `/opt/local/etc/riak`
123+
Cluster Metadata | `/var/db/riak/cluster_meta`
124+
Search | `/var/db/riak/yz`
119125
Strong consistency | `/var/db/riak/ensembles`
120126

121127
#### Solaris
@@ -126,31 +132,31 @@ Bitcask | `/opt/riak/data/bitcask`
126132
LevelDB | `/opt/riak/data/leveldb`
127133
Ring | `/opt/riak/ring`
128134
Configuration | `/opt/riak/etc`
135+
Cluster Metadata | `/opt/riak/cluster_meta`
136+
Search | `/opt/riak/yz`
129137
Strong consistency | `/opt/riak/data/ensembles`
130138

131-
> **Note on strong consistency directories**
132-
>
133-
> The listings above show directories for data related to Riak's
134-
[strong consistency][use ref strong consistency] feature. This feature is purely optional, so `/ensembles` directories will not exist in your installation if this feature is not being used. For more information, see [Using Strong Consistency](/riak/kv/2.1.4/developing/app-guide/strong-consistency) and [Managing Strong Consistency](/riak/kv/2.1.4/using/cluster-operations/strong-consistency).
139+
{{% note title="Note on strong consistency directories" %}}
140+
The listings above show directories for data related to Riak's [strong consistency][use ref strong consistency] feature. This feature is purely optional, so `/ensembles` directories will not exist in your installation if this feature is not being used. For more information, see [Using Strong Consistency](/riak/kv/2.1.4/developing/app-guide/strong-consistency) and [Managing Strong Consistency](/riak/kv/2.1.4/using/cluster-operations/strong-consistency).
141+
{{% /note %}}
135142

136143
## Performing Backups
137144

138-
> **Deprecation notice**
139-
>
140-
> In previous versions of Riak, there was a [`riak-admin backup`](/riak/kv/2.1.4/using/admin/riak-admin/#backup) command commonly used for
141-
backups. This functionality is now deprecated. We strongly recommend
142-
using the backup procedure documented below instead.
145+
{{% note title="Deprecation notice" %}}
146+
In previous versions of Riak KV, there was a [`riak-admin backup`](/riak/kv/2.1.4/using/admin/riak-admin/#backup) command commonly used for
147+
backups. This functionality is now deprecated. We strongly recommend using the backup procedure documented below instead.
148+
{{% /note %}}
149+
150+
Backups can be accomplished through a variety of common methods. Standard utilities such `cp`, `rsync`, and `tar` can be used as well as any backup system already in place in your environment.
151+
152+
A simple shell command such as the following examples is sufficient for creating a backup of your Bitcask or LevelDB data, ring, and Riak KV configuration directories for a binary package-based Riak KV Linux
153+
installation.
143154

144-
Backups of both Bitcask and LevelDB can be accomplished through a
145-
variety of common methods. Standard utilities such `cp`, `rsync`, and
146-
`tar` can be used as well as any backup system or method already in
147-
place in your environment. Please remember that the node must *not* be
148-
running while performing the backup.
155+
The following examples use `tar`:
149156

150-
A simple shell command such as the following example is sufficient for
151-
creating a backup of your Bitcask or LevelDB data, ring, and Riak
152-
configuration directories for a binary package-based Riak Linux
153-
installation. The following examples use `tar`:
157+
{{% note %}}
158+
Backups must be performed on a stopped node to prevent data loss.
159+
{{% /note %}}
154160

155161
### Bitcask
156162

@@ -166,6 +172,20 @@ tar -czf /mnt/riak_backups/riak_data_`date +%Y%m%d_%H%M`.tar.gz \
166172
/var/lib/riak/leveldb /var/lib/riak/ring /etc/riak
167173
```
168174

175+
### Cluster Metadata
176+
177+
```bash
178+
tar -czf /mnt/riak_backups/riak_data_`date +%Y%m%d_%H%M`.tar.gz \
179+
/var/lib/riak/cluster_meta
180+
```
181+
182+
### Search / Solr Data
183+
184+
```bash
185+
tar -czf /mnt/riak_backups/riak_data_`date +%Y%m%d_%H%M`.tar.gz \
186+
/var/lib/riak/yz
187+
```
188+
169189
### Strong Consistency Data
170190

171191
Persistently stored data used by Riak's [strong consistency][use ref strong consistency] feature
@@ -176,26 +196,11 @@ tar -czf /mnt/riak_backups/riak_data_`date +%Y%m%d_%H%M`.tar.gz \
176196
/var/lib/riak/ensembles
177197
```
178198

179-
The basic process for getting a backup of Riak from a node is as
180-
follows:
181-
182-
1. Stop the node with `riak stop`
183-
2. Back up the appropriate data, ring, configuration, and strong consistency
184-
(if applicable) directories as relevant to your operating system
185-
3. Start the node
186-
187-
Consult the [Bitcask][plan backend bitcask] and [LevelDB][plan backend leveldb] documentation to learn more
188-
about these backends.
189-
190199
## Restoring a Node
191200

192-
The method you use to restore a node will differ depending on a
193-
combination of factors, including node name changes and your network
194-
environment.
201+
The method you use to restore a node will differ depending on a combination of factors, including node name changes and your network environment.
195202

196-
If you are replacing a node with a new node that has the same node name
197-
(typically a fully qualified domain name or IP address), then restoring
198-
the node is a simple process:
203+
If you are replacing a node with a new node that has the same node name (typically a fully qualified domain name or IP address), then restoring the node is a simple process:
199204

200205
1. Install Riak on the new node.
201206
2. Restore your old node's configuration files, data directory, and ring
@@ -217,15 +222,11 @@ additionally:
217222
4. Plan the changes to the cluster with `riak-admin cluster plan`
218223
5. Finally, commit the cluster changes with `riak-admin cluster commit`
219224

220-
> **Further information**
221-
>
222-
> For more information on the `riak-admin cluster` commands,
223-
refer to our documentation on [cluster administration](/riak/kv/2.1.4/using/admin/).
225+
{{% note %}}
226+
For more information on the `riak-admin cluster` commands, refer to our documentation on [cluster administration](/riak/kv/2.1.4/using/admin/).
227+
{{% /note %}}
224228

225-
For example, if there are five nodes in the cluster with the original
226-
node names `riak1.example.com` through `riak5.example.com` and you wish
227-
to restore `riak1.example.com` as `riak6.example.com`, you would execute
228-
the following commands on `riak6.example.com`.
229+
For example, if there are five nodes in the cluster with the original node names `riak1.example.com` through `riak5.example.com` and you wish to restore `riak1.example.com` as `riak6.example.com`, you would execute the following commands on `riak6.example.com`.
229230

230231
1. Join to any existing cluster node.
231232

@@ -258,34 +259,20 @@ the following commands on `riak6.example.com`.
258259
riak-admin cluster commit
259260
```
260261

261-
Your [configuration files][config reference] should also be changed to match the new
262-
name in addition to running the commands (the `-name` setting in
263-
`vm.args` in the older config system, and the `nodename` setting in
264-
`riak.conf` in the newer system). If the IP address of any node has
265-
changed, verify that the changes are reflected in your configuration
266-
files to ensure that the HTTP and Protocol Buffers interfaces are
267-
binding to the correct addresses.
268-
269-
A robust DNS configuration can simplify the restore process if the IP
270-
addresses of the nodes change, but the hostnames are used for the node
271-
names and the hostnames stay the same. Additionally, if the HTTP and
272-
Protocol Buffers interface settings are configured to bind to all IP
273-
interfaces (0.0.0.0), then no changes will need to be made to your
274-
configuration files.
275-
276-
When performing restore operations involving `riak-admin cluster
277-
force-replace`, we recommend that you start only one node at a time and
278-
verify that each node that is started has the correct name for itself
279-
and for any other nodes whose names have changed.
280-
281-
To do this, first verify that the correct name is present your
282-
configuration file. Then, once the node is started, run `riak attach` to
283-
connect to the node. It may be necessary to enter an Erlang atom and
284-
press enter to obtain a prompt, by typing `x.` and pressing enter. The
285-
prompt obtained should contain the correct node name. Disconnect from
286-
the attached session with **Ctrl-G q**. Finally, run `riak-admin
287-
member_status` to list all of the nodes and verify that all nodes listed
288-
have the correct names.
262+
Your [configuration files][config reference] should also be changed to match the new name in addition to running the commands (the `-name` setting in `vm.args` in the older config system, and the `nodename` setting in `riak.conf` in the newer system).
263+
264+
If the IP address of any node has changed, verify that the changes are reflected in your configuration files to ensure that the HTTP and Protocol Buffers interfaces are binding to the correct addresses.
265+
266+
A robust DNS configuration can simplify the restore process if the IP addresses of the nodes change, but the hostnames are used for the node names and the hostnames stay the same. Additionally, if the HTTP and Protocol Buffers interface settings are configured to bind to all IP interfaces (0.0.0.0), then no changes will need to be made to your configuration files.
267+
268+
When performing restore operations involving `riak-admin cluster force-replace`, we recommend that you start only one node at a time and verify that each node that is started has the correct name for itself
269+
and for any other nodes whose names have changed:
270+
271+
1. Verify that the correct name is present your configuration file.
272+
2. Once the node is started, run `riak attach` to connect to the node. The prompt obtained should contain the correct node name.
273+
- (It may be necessary to enter an Erlang atom by typing `x.` and pressing Enter)
274+
3. Disconnect from the attached session with **Ctrl-G + q**.
275+
4. Finally, run `riak-admin member_status` to list all of the nodes and verify that all nodes listed have the correct names.
289276

290277
## Restoring a Cluster
291278

0 commit comments

Comments
 (0)