D-DAY 2015 Electric sheep SERVEBOX

Post on 16-Apr-2017

338 views 1 download

Transcript of D-DAY 2015 Electric sheep SERVEBOX

by ElectricSheep.IO

ServeBoxOU COMMENT NOUS AVONS TROUVÉ DESMOUTONS ÉLECTRIQUES SUR LA ROUTE

par Fabrice Nourisson / (un développeur hédoniste)@duckmole

DÉROULEMENT DE L'ATELIER15 min la route vers le devops et ElectricSheep.IO

30 min live démo d'ElectricSheep.IO

UNE ÉQUIPE EN ROUTEPOUR LE DEVOPS

ServeBox est une société de développement passée au devops pour les besoins de ses clients

UNE ÉQUIPE EN ROUTEPOUR LE DEVOPS

Production de code

UNE ÉQUIPE EN ROUTEPOUR LE DEVOPS

Déploiement

UNE ÉQUIPE EN ROUTEPOUR LE DEVOPS

Opérations

Monitoring et Alerte Reprise d'activité ?

LES DEVS ET LE BACKUPSolutions existantes trop lourdes

Mauvaise maîtrise du bashUne configuration par serveur et par projet

Alerte en cas d'échecTéléversement (upload) vers des systèmes tiers

LES DEVS ET LE BACKUP

Une DSL

LES DEVS ET LE BACKUP

La centralisation

One server to rule them all

LES DEVS ET LE BACKUP

Notifications claires

LES DEVS ET LE BACKUP

Confidentialité

QUI L'UTILISE ET POUR QUOI ?

SonarSource backup ses bases de données

et fichiers

Servebox backup les bases de données

des applications

e-labo backup ~70environnements clients

(CMS)

POURQUOI PAS VOUS ?

UTILISER

humans [at] electricsheep [dot] io

Getting Started

CONTRIBUER

Code sur github

Doc. sur readme.io

ET MAINTENANT LE LIVE CODING

INSTALLATIONcurl https://github.com/servebox/electric_sheep/releases/download/v0.5.0/electric­sheep­ubuntu_0.5.0­1_amd64.debmd5 electric­sheep­ubuntu_0.5.0­1_amd64.debdpkg ­i electric­sheep­ubuntu_0.5.0­1_amd64.deb

Doc d'installation

CRÉATION ET INSTALLATION DES CLÉS SSHssh­keygen ­t rsa ­N '' ­f electric_sheep_rsassh­copy­id ­i electric_sheep_rsa.pub servebox@ornithorynque.comssh­copy­id ­i electric_sheep_rsa.pub servebox@have­fun­with­tdd.com

Doc. de création des clés ssh

SAUVEGARDE DU SITE WORDPRESS HAVE-FUN-WITH-TDD

SheepFile

Commande

host "have­fun­with­tdd", hostname: "192.168.50.4", private_key: "electric_sheep_rsa"  working_directory "/backups"

  job "have­fun­with­tdd­files" do    schedule "daily", at: "00:00"    resource "directory", path: "/var/www", host: "have­fun­with­tdd"    remotely as: "servebox" do      tar_gz delete_source: true    end    move to: "localhost", using: "scp", as: "servebox"  end

  job "have­fun­with­tdd­db" do    schedule "daily", at: "00:00"    resource "database", name: "wordpress", host: "have­fun­with­tdd"    remotely as: "servebox" do      mysql_dump user: "wordpress", password: "wordpress"      tar_gz delete_source: true    end    move to: "localhost", using: "scp", as: "servebox"  end

electric_sheep

Cookbook pour wordpress

SAUVEGARDE DE LA BASE DE DONNÉESPOSTGRESQL DU SITE ORNITHORYNQUE

host "ornithorynque", hostname: "192.168.50.5", private_key: "electric_sheep_rsa"  working_directory "/backups"

  job "ornithorynque­db" do    schedule "daily", at: "00:00"    resource "database", name: "hello_phoenix_dev", host: "ornithorynque"    remotely as: "servebox" do      postgresql_dump user: "electric_sheep", password: "password"    end    remotely as: "servebox" do      tar_gz delete_source: true    end    move to: "localhost", using: "scp", as: "servebox"  end

Cookbook pour PostgreSQL

CRÉATION DES CLÉS GPGgpg ­­gen­keygpg ­­batch ­­armor ­­output electric_sheep.public.gpg.asc ­­export electricsheep.io@servebox.comgpg ­­batch ­­armor ­­output electric_sheep.private.gpg.asc ­­export­secret­key electricsheep.io@servebox.com

Doc. pour la création des clés gpg

CHIFFREMENT DES MOTS DE PASSEelectric_sheep encrypt ­k electric_sheep.public.gpg.asc "password"

Doc. pour chiffrer les mots de passe

SHEEPFILE AVEC MOTS DE PASSE CHIFFRÉShost "ornithorynque", hostname: "192.168.50.5", private_key: "electric_sheep_rsa"  working_directory "/backups"  decrypt with: "electric_sheep.private.gpg.asc"

  job "ornithorynque­db" do    schedule "daily", at: "00:00"    resource "database", name: "hello_phoenix_dev", host: "ornithorynque"    remotely as: "servebox" do      postgresql_dump user: "electric_sheep", password: encrypted("xxxx")    end    remotely as: "servebox" do      tar_gz    end    move to: "localhost", using: "scp", as: "servebox"    locally do      encrypt delete_source: true    end  end

Doc. pour chiffrer les mots de passe

RÉCUPÉRATION DE LA CLÉ PUBLIQUE GPG POURLE CHIFFREMENT DES SAUVEGARDES

gpg ­­armor ­­output fabrice.public.gpg.asc ­­export fabrice@nourisson­pytel.fr

Doc. pour générer la clé publique

CHIFFREMENT DES SAUVEGARDEShost "ornithorynque", hostname: "192.168.50.5", private_key: "electric_sheep_rsa"  working_directory "/backups"  decrypt with: "electric_sheep.private.gpg.asc"  encrypt with: 'fabrice.public.gpg.asc'

  job "ornithorynque­db" do    schedule "daily", at: "00:00"    resource "database", name: "hello_phoenix_dev", host: "ornithorynque"    remotely as: "servebox" do      postgresql_dump user: "electric_sheep", password: encrypted("xxxx")    end    remotely as: "servebox" do      tar_gz delete_source: true    end    move to: "localhost", using: "scp", as: "servebox"    locally do      encrypt delete_source: true    end  end

Doc. pour chiffrer les sauvegardes

SheepFile

host "ornithorynque", hostname: "192.168.50.5", private_key: "electric_sheep_rsa"  working_directory "/backups"  decrypt with: "electric_sheep.private.gpg.asc"  encrypt with: 'fabrice.public.gpg.asc'

  job "ornithorynque­db" do    schedule "daily", at: "00:00"    resource "database", name: "hello_phoenix_dev", host: "ornithorynque"    remotely as: "servebox" do      postgresql_dump user: "electric_sheep", password: encrypted("xxxx")    end    remotely as: "servebox" do      tar_gz delete_source: true    end    move to: "localhost", using: "scp", as: "servebox"    locally do      encrypt delete_source: true    end  end

host "have­fun­with­tdd", hostname: "192.168.50.4", private_key: "electric_sheep_rsa"  working_directory "/backups"

  job "have­fun­with­tdd­files" do    schedule "daily", at: "00:00"    resource "directory", path: "/var/www", host: "have­fun­with­tdd"    remotely as: "servebox" do      tar_gz delete_source: true    end    move to: "localhost", using: "scp", as: "servebox"  end

  job "have­fun­with­tdd­db" do    schedule "daily", at: "00:00"    resource "database", name: "wordpress", host: "have­fun­with­tdd"    remotely as: "servebox" do      mysql_dump user: "wordpress", password: "wordpress"      tar_gz delete_source: true    end    move to: "localhost", using: "scp", as: "servebox"  end

#DEVOPSDDAY #ESIO

MERCI

by http://electricsheep.io

ServeBox

DEVELOPERS,GIVE YOUR BACKUPS SOME LOVE