Sie sind auf Seite 1von 31

ADM 202 – Data Access and Protection

L9-1
Learning Goals

9.1 Describe Snapshots

9.2 Configure and Use Snapshots

L9-2
What Is a Snapshot?
• A view of a source volume at a specific point in time

• Use to:
– Recover from user errors, data corruption, or program errors
– Create static data sets for queries or auditing

Volume A

L9-3
Characteristics of a Snapshot
• Read-only point-in-time image of a volume

• Tiny space penalty

• Very quick (seconds)

• Persists until user-set expiration


Snapshot

L9-4
Where Do Snapshots Go?
• Top level of every volume
– .snapshot directory
– Exists even if empty

• Not visible to ls –ltarh command

• Accessed via NFS or Hadoop shell

L9-5
Snapshot Architecture

1
2

3
4

5
6
7
8

L9-6
Snapshot Architecture

1
Snapshot 1
2

9 3
10 4

5
11
6
12
7
8

L9-7
Snapshot Architecture

1
Snapshot 1
2

9 3
10 4

5
11 Snapshot 2
6
12
7
8
13'
13
14

L9-8
Snapshot Architecture

1
Snapshot 1
2

9 3
10 4

5
11 Snapshot 2
6
12
7
8
9' 13'
13
14 15
16
10'

L9-9
Snapshot Architecture

1
Snapshot 1
2

9 3
10 4

5
11 Snapshot 2
6
12
7
8
9' 13'
13
14 15
16
10'

L9-10
Snapshot Architecture

1
Snapshot 1
2

9 3
10 4

5
11 Snapshot 2
6
12
7
8
9' 13'
13
14 15
16
10'
Snapshot 3

L9-11
Snapshot Architecture

1
Snapshot 1
2

9 3
10 4

5
11 Snapshot 2
6
12
7
8
9' 13'
13
14 15
16
10'
Snapshot 3

L9-12
Snapshot Architecture

/myvol/file1

1
Snapshot 1
2

9 3
10 4

5
11 Snapshot 2
6
12
7
8
9' 13'
13
14 15
16
10’
Snapshot 3

L9-13
Use Case: Protection From Human Error

Situation:
You know human error is one of the most common
causes of lost or corrupted data, and you want to
protect against loss of time and data.

L9-14
Use Case: Protection From Human Error

Situation:
You know human error is one of the most common
causes of lost or corrupted data, and you want to
protect against loss of time and data.

Solution:
Make frequent snapshots of key data. To control space requirements, set
reasonable retain times.

L9-15
Learning Goals

9.1 Describe Snapshots

9.2 Configure and Use Snapshots

L9-16
Create a Snapshot

L9-17
Create a Snapshot
• Command line:
$ maprcli volume snapshot create –volume <vol name>
-snapshotname <snapshot name>

• Manual snapshots do not expire automatically

Snapshot

L9-18
Scheduled Snapshots
• Scheduled snapshots automatically expire

• 3 pre-defined schedules:
– Normal data

L9-19
Scheduled Snapshots
• Scheduled snapshots automatically expire

• 3 pre-defined schedules:
– Normal data
– Important data

L9-20
Scheduled Snapshots
• Scheduled snapshots automatically expire

• 3 pre-defined schedules:
– Normal data
– Important data
– Critical data

L9-21
Custom Schedules

$ maprcli schedule create –schedule '<JSON object>'

L9-22
Schedule a Snapshot

$ maprcli volume modify –name <vol> -schedule <schedule ID>

L9-23
Display Schedules in MCS

L9-24
Recover Data From a Snapshot

[root@ip-10-0-0-41 cobra-dev]# hadoop fs –mkdir /recovered-files

L9-25
Recover Data From a Snapshot

[root@ip-10-0-0-41 cobra-dev]# hadoop fs –cp /projects/rnd/cobra/cobra-dev.snapshot/2015-10-


14.08-00-00/* /recovered files

L9-26
Recover Data From a Snapshot
Use Linux commands, if the cluster file system is mounted

L9-27
Preserve a Snapshot
Preserving a snapshot removes its expiration date

L9-28
Maintain Snapshots
• Scheduled snapshots are deleted automatically

• Manual snapshots must be deleted manually (through the CLI or MCS)

Keep on top of your manual snapshots!

L9-29
Lab 9.2: Mapr – Snapshot

1_Lab Seperator

L9-30
Next Steps
ADM 202 – Data Access and Protection

L9-31

Das könnte Ihnen auch gefallen