backup of scale€¦ · about me • 22 years old • since 2015 linux system engineer • cbo...

38
Backup Of Scale Bareos Active Client And Puppet Tobias Groß September 27, 2016

Upload: others

Post on 24-Apr-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Backup Of ScaleBareos Active Client And Puppet

Tobias GroßSeptember 27, 2016

Page 2: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Table Of Contents

Introduction

Networking

Bareos Client Modes

Network Setups

Configuration

Puppet

Trocla

Hiera

Conclusion

2/34

Page 3: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Introduction

Page 4: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

About Me

• 22 years old• Since 2015 linux system engineer• CBO (Chief Backup Officer)• [email protected]

3/34

Page 5: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Globalways AG

• ISP in Stuttgart• 3 data centers• Large fiber network• Project hosting

4/34

Page 6: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Environment And Goals

Environment:• Many private customer networks• Puppet (95%+ coverage)• Large ceph cluster• Mainly virtualized machines

Goals:• No port forwarding• Zero configuration backup• Transport encryption• Fully puppet managed

5/34

Page 7: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Networking

Page 8: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Standard Client

• Default mode• Control channel initiated by director• Data channel initiated by file daemon

Pro

• Simple configuration

6/34

Page 9: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Passive Client

• Passive mode (since bareos 13.2)• Control channel initiated by director• Data channel initiated by storage daemon• Passive = yes

Pro

• Client needs no DNS• Client can be firewalled completely

7/34

Page 10: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Active Client

• Active mode (since bareos 16.2)• Control channel initiated by file daemon• Data channel initiated by file daemon• Connection from client to director = yes

Pro

• Director/SD needs no knowledge aboutclient network

• Director/SD needs no DNS• No port forwardings needed

8/34

Page 11: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Simple Network

• Every client mode suitable• Default mode least configuration

9/34

Page 12: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

2 Networks

• Clients behind NAT• Central bareos server• Standard and passive maybe suitable• Active client needs no port forwarding

10/34

Page 13: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

n Networks

• Clients behind NAT• Central bareos server• Standard and passive not suitable• Active client needs no port forwarding

11/34

Page 14: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Unknown Networks

• Default mode not possible• Passive mode not possible• Active mode works

Use transport encryption and verify peer when using unknown networks!

12/34

Page 15: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Firewall Configuration

Networks Standard Passive ActiveSimple 0 0 0

2 2m 2m 0n nm nm 0

Unknown - - 0

Number of port forwardings neededm: Number of clients per network

13/34

Page 16: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Goals

Goals:

• No port forwarding 3

• Zero configuration backup• Transport encryption• Fully puppet managed

14/34

Page 17: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Configuration

Page 18: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Puppet

• Puppet language• Agent/master architecture• Facts and catalogs• PuppetDB - exported resources

15/34

Page 19: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Modules

• Generalized collection of code• One purpose per module• forge.puppet.com

16/34

Page 20: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

globalways-bareos

• Install, configure and manage director, sd, fd, bconsole and webui• Complete mapping of configuration parameters• Only Ubuntu and Debian (for now)• Not yet published

17/34

Page 21: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Puppet - Classes

class bareos::file_daemon::install inherits bareos {if $::bareos::file_daemon_install {

package { $::bareos::file_daemon_package_name:ensure => $::bareos::file_daemon_package_ensure,

}}

}

18/34

Page 22: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Puppet - Defines

define bareos::storage_daemon::autochanger ($device,$changer_command,$changer_device,$description = undef,

) {concat::fragment{ "storage_daemon-autochanger-${title}":

target => $::bareos::storage_daemon_config_file,content => template('bareos/storage_daemon/_autochanger.erb')

}}

19/34

Page 23: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Puppet - Templates

Autochanger {Name = <%= @title %>Device = <%= @device %>Changer Command = <%= @changer_command %>Changer Device = <%= @changer_device %>

<% if @description -%>Description = <%= @description %>

<% end -%>}

20/34

Page 24: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Puppet - Exported Resources

[...]@@concat { $::bareos::file_daemon_config_export_target:

tag => $::bareos::director_tag,}[...][...]Concat <<| tag == $::bareos::director_tag |>> {

notify => Service[$::bareos::director_service_name],owner => 'bareos',group => 'bareos',mode => '0600',

}[...] 21/34

Page 25: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Profiles

• Wrapper around modules• Defaults for corporation wide setup

22/34

Page 26: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

globalways-profile::bareos

• Default for clients (profile::bareos::client)• Cronjob for truncating old backups• Zabbix monitoring• Creates one mysql catalog per customer• Not to be published

23/34

Page 27: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Goals

Goals:

• No port forwarding 3

• Zero configuration backup• Transport encryption• Fully puppet managed 3

24/34

Page 28: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Trocla

• Password store• Nice integration into puppet• Moneta backend

25/34

Page 29: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Puppet - Passwords

String $password = trocla("${::fqdn}_bareos_fd_password",'plain',{ length => 63,

charset => 'alphanumeric'})

26/34

Page 30: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Puppet - X.509 Certificates

String $client_cert = trocla("${::fqdn}_${director_tag}_cert",'x509',{ ca => "${director_tag}_ca",

days => '3650','C' => 'DE','ST' => 'BW','L' => 'Stuttgart','O' => 'Globalways AG','OU' => 'Backup','CN' => "${::fqdn}",render => 'certonly' })

27/34

Page 31: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Goals

Goals:

• No port forwarding 3

• Zero configuration backup• Transport encryption 3

• Fully puppet managed 3

28/34

Page 32: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Hiera

• Key/value lookup tool for puppet• Client configuration in yaml/json• Merge configuration file hierarchy

29/34

Page 33: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Configuration - Client

---classes:

- profile::bareos::client

• Installs file daemon• Configures with default director• Creates ssl certificates• DB backup scripts• Exports config for director• Configures monitoring server

30/34

Page 34: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Configuration - Server

---classes:

- profile::bareos::serverp::b::server::director_tag: 'dir'p::b::server::storage_daemon_tag: 'sd'p::b::server::mountpoint: '/mnt/bareos'p::b::server::devices: 256p::b::server::catalogs:

- '1337'p::b::server::clients:

'test.example.com':'customer_id': '1337''random_number': '1''fileset': 'windows_test.example.com''retention_period': '42 days''password': 's3cr3t!¡'

• Installs director, sd, fd, bconsole and webui• Configures sd with 256 devices• Creates catalogs• Builds new ca• Collects all exported resources• Backups also nonpuppet clients• Configures monitoring server

31/34

Page 35: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Goals

Goals:

• No port forwarding 3

• Zero configuration backup 3

• Transport encryption 3

• Fully puppet managed 3

32/34

Page 36: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Conclusion

Page 37: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Old Vs. New

33/34

Page 38: Backup Of Scale€¦ · About Me • 22 years old • Since 2015 linux system engineer • CBO (Chief Backup Officer) • tobias.gross@globalways.net 3/34

Thank you!

34/34