Private Cloud mit Ceph und OpenStack

Preview:

Citation preview

Private Cloud mit Ceph und OpenStack

Daniel Schneller daniel.schneller@centerdevice.de @dschneller

Lukas Pustina lukas.pustina@centerdevice.de @drivebytesting

Aus dem täglichen Wahnsinn des Cloud Betriebs

Wer sind wir?

@dschneller @drivebytesting

Was machen wir?

Wo kamen wir her?

Warum wollten wir davon weg?

Wohin wollten wir?

Private Cloud

Hardwareabstraktion

Bare Metal Hardware

Virtual Environment

Application

Virtualization

Storage NetworkCompute

Bare Metal Hardware

Baseline BenchmarksErwartungen definieren

StorageDisk I/O pro Node

Netzwerk

IEEE 802.3ad != IEEE 802.3ad

> cat /etc/network/interfaces ... auto bond2 iface bond2 inet manual bond-slaves p2p3 p2p4 # interfaces to bond bond-mode 802.3ad # activate LACP bond-miimon 100 # monitor link health bond-xmit_hash_policy layer3+4 # use Layer 3+4 for link selection pre-up ip link set dev bond2 mtu 9000 # set Jumbo Frames

auto vlan-ceph-clust iface vlan-ceph-clust inet static pre-up ip link add link bond2 name vlan-ceph-clust type vlan id 105 pre-up ip link set dev vlan-ceph-clust mtu 9000 # Jumbo Frames post-down ip link delete vlan-ceph-clust address ... netmask ... network ... broadcast ... ...

[node01] > iperf -s -B node01.ceph-cluster [node02] > iperf -c node01.ceph-cluster [node03] > iperf -c node01.ceph-cluster

Storage

“Unified, distributed storage system designed for excellent performance, reliability and scalability”

Hoch skalierbar

Commodity Hardware

Kein Single Point of Failure

Ceph Komponenten

OSD DaemonsObject Storage Device Daemons

Ceph Benchmark

Virtualisierung

OpenStack Komponenten

CenterDevice

Gesamtarchitektur

Bare Metal

Ceph

Node 1 Node 2 Node 3 Node 4

OSD 1

OSD 48

Node 5

Node 1 Node 2 Node 3 Node 4

CD-VM1

VMs

Bare Metal

Ceph

Node 6

CD-VM2

Node 7

CD-VM3

Node 8

CD-VM4

ES Mo

CD CD

ES Mo

CD CD

ES Mo

CD CD

ES Mo

CD CD

Node …

VM …

VM …

Gesamtarchitektur

OSD 1

OSD 48

Node 5

Node 3Node 1

Rados GW

Node 2

Rados GW Rados GW

Node 4

Rados GW

CD-VM1

VMs

Bare Metal

Ceph

Node 6

CD-VM2

Node 7

CD-VM3

Node 8

CD-VM4

ES Mo

CD CD

ES Mo

CD CD

ES Mo

CD CD

ES Mo

CD CD

Node …

VM …

VM …

Gesamtarchitektur

OSD 1

OSD 48

Node 5

Node 1

Rados GW

Node 2

Rados GW

Node 3

Rados GW

Node 4

Rados GW

CD-VM1

HAProxyVMs

Bare Metal

Ceph

Node 6

CD-VM2

Node 7

CD-VM3

Node 8

CD-VM4

HAProxy HAProxyHAProxy

ES Mo

CD CD

ES Mo

CD CD

ES Mo

CD CD

ES Mo

CD CD

Node …

VM …

VM …

Gesamtarchitektur

OSD 1

OSD 48

Node 5

Node 1

Rados GW

Node 2

Rados GW

Node 3

Rados GW

Node 4

Rados GW

CD-VM1

HAProxyVMs

Bare Metal

Ceph

Node 6

CD-VM2

Node 7

CD-VM3

Node 8

CD-VM4

HAProxy HAProxyHAProxy

ES Mo

CD CD

ES Mo

CD CD

ES Mo

CD CD

ES Mo

CD CD

Node …

VM …

VM …

Gesamtarchitektur

OSD 1

OSD 48

Vorteile

Nachteile

Hardware Caveats

Bonding ModesHalbe Kraft voraus!

[node01] > iperf -s -B node01.ceph-cluster […] [ 4] local 10.102.5.11 port 5001 connected with 10.102.5.12 port 49412 [ 5] local 10.102.5.11 port 5001 connected with 10.102.5.12 port 49413 [ 6] local 10.102.5.11 port 5001 connected with 10.102.5.13 port 59947 [ 7] local 10.102.5.11 port 5001 connected with 10.102.5.13 port 59946 [ ID] Interval Transfer Bandwidth [ 4] 0.0-10.0 sec 342 MBytes 286 Mbits/sec [ 5] 0.0-10.0 sec 271 MBytes 227 Mbits/sec [SUM] 0.0-10.0 sec 613 MBytes 513 Mbits/sec [ 6] 0.0-10.0 sec 293 MBytes 246 Mbits/sec [ 7] 0.0-10.0 sec 338 MBytes 283 Mbits/sec [SUM] 0.0-10.0 sec 631 MBytes 529 Mbits/sec ???

Bonding ModesHalbe Kraft voraus!

CAUTIONTRUST

NOTHING!

CAUTIONMEASURE

EVERYTHING!

Bonding und VLANsEin Switch als Weihnachtsbaum

Bonding und VLANsEin Switch als Weihnachtsbaum

01: Handle up event of interface Po4 02: VPC Po4(VPC ID: 4) UP on self. Inform peer to program peer-link to BLOCK traffic 03: Received control message of type MLAG_INTERFACE_DOWN, for VPC ID 4 04: Handle down event of interface Po2 05: VPC Po2(VPC ID: 2) DOWN on self. Inform peer to program peer-link to ALLOW traffic 06: Handle up event of interface Po2 07: VPC Po2(VPC ID: 2) UP on self. Inform peer to program peer-link to BLOCK traffic 08: Handle down event of interface Po42 09: VPC Po42(VPC ID: 42) DOWN on self. Inform peer to program peer-link to ALLOW traffic 10: Handle up event of interface Po42 11: VPC Po42(VPC ID: 42) UP on self. Inform peer to program peer-link to BLOCK traffic 12: Received control message of type MLAG_INTERFACE_DOWN, for VPC ID 42 13: Received control message of type MLAG_INTERFACE_UP, for VPC ID 14 14: Handle down event of interface Po16 15: VPC Po16(VPC ID: 16) DOWN on self. Inform peer to program peer-link to ALLOW traffic 16: Received control message of type MLAG_INTERFACE_DOWN, for VPC ID 39 17: Received control message of type MLAG_INTERFACE_UP, for VPC ID 42 […]

Bonding und VLANsEin Switch als Weihnachtsbaum

CAUTIONTRUST

NOTHING!

CAUTIONFIRMWARE FAILS, TOO!

BIOS Updates3 Betriebssysteme und diverse Gigabytes

BIOS Updates3 Betriebssysteme und diverse Gigabytes

CAUTIONKNOW THE

TOOLCHAIN!

Ceph Caveats

ScrubbingIntegrität hat ihren Preis.

CAUTIONDISK I/O

INTENSIVE!

CAUTIONSCHEDULEMANUALLY!

RADOS GatewayUse as recommended for maximum happiness

CAUTIONOBEY USER

LIMITS!

CAUTIONKNOW THE

CONFIGCAUTIONNO SNAPSALLOWED!

OpenStack Caveats

Netzwerk – Total trivial

Node 5

CD-VM1

Node 6

CD-VM2

Node 7

LB1

HAProxy

Node 8

LB2

HAProxy

Der Wolf im Netzpelz

Netzwerk – Total trivialDer Wolf im Netzpelz

https://openstack.redhat.com/Networking_in_too_much_detail

Netzwerk – Total trivialDer Wolf im Netzpelz

VHOST_NET_ENABLED=0

# To load the vhost_net module, which in some cases can speed up

# network performance, set VHOST_NET_ENABLED to 1.

$ cat /etc/default/qemu-kvm

Netzwerk – Total trivialDer Wolf im Netzpelz

# To load the vhost_net module, which in some cases can speed up

# network performance, set VHOST_NET_ENABLED to 1.

VHOST_NET_ENABLED=1

$ cat /etc/default/qemu-kvm

Netzwerk – Total trivialDer Wolf im Netzpelz

# To load the vhost_net module, which in some cases can speed up

# network performance, set VHOST_NET_ENABLED to 1.

VHOST_NET_ENABLED=1

$ cat /etc/default/qemu-kvmCAUTIONVIRTUAL

NETWORKS!

Live Migration“Der sich den Wolf patcht”

CAUTIONCHECK BUG TRACKERS!

CAUTIONYOU’RE NOT

DEFAULT!

Heat StacksEin Wolf kommt selten allein

CAUTIONCHECK BUG TRACKERS!

CAUTIONYOU’RE NOT

THE DEFAULT!

Fazit

Fazit

http://bit.ly/1FktZok #AllesKaputt

Aber OpenSource ermöglicht Selbsthilfe.

Zum Schluss

Folien bei Slidesharehttp://www.slideshare.net/dschneller

http://www.cloudfibel.de

code

cent

ric

Clo

ud F

ibel

1.

20

15

Verteilte, skalierbare, und cloudfähige Anwendungen sind die Zukunft der IT. Dafür sind Skalierbarkeit, Ausfallsicherheit und Verfügbarkeit die Treiber dieser Entwicklung. Der Weg aus der klassischen IT in die Cloud ist jedoch steinig. Begeben Sie sich auf ihn, stehen Sie vor zahllosen Ent-scheidungen und der Auswahl aus einer Vielzahl von Technologien. Dazu gehören insbesondere diejenigen zur Virtualisierung der Speicher- und Rechenkapazitäten sowie der automatischen Provisionierung Ihres Systems.

Wir setzen dafür bei der codecentric AG auf die Virtualisierungsplattform OpenStack mit Docker, den Storage Cluster Ceph und das Provisionie-rungswerkzeug Ansible, mit denen wir eine private Cloud für die Firma CenterDevice erfolgreich umgesetzt haben.

OpenStack und Ceph sind mächtige Plattformen, die sich hervorragend ergänzen und aussergewöhnliche Leistung bieten. Docker ermöglicht auf effektive Art, Software zu bündeln und sie auf Entwickler-, Test- und Produktivsystemen mit wenigen Anpassungen zu betreiben. Ansible ist die neue Generation eines Provisionierungswerkzeug, das speziell an die Bedürfnisse von Cloudumgebungen angepasst ist.

Als Sonderausgabe des Softwerkers soll diese Cloud Fibel Ihnen helfen, das Thema Cloud besser kennenzulernen. Dazu stellen wir die vier oben genannten Technologien vor und beschreiben ihren Einsatz in der Praxis. Zum Schluss zeigt eine nicht ganz ernstgemeinte Detektivgeschichte die Jagd nach einer Fehlkonfiguration in einer echten Cloud.

Viel Spaß beim Lesen. Für alle Fragen, die offen bleiben, sind wir für Sie da.Dr. Lukas Pustina und Daniel Schneller

LIEBE LESER,

PRAXIS AUS DEM NÄHKÄSTCHENÜBERBLICK

6 OPENSTACK - PRIVATSACHE

18 DOCKER - DIENSTE IN CONTAINERN

29 CEPH - MÄCHTIG FLEXIBEL

42 ANSIBLE - EINFACH LEISTUNGSFÄHIG

58 DOCKER TOOLS

68 CEPH BENCHMARKS

74 HARDWARE FÄLLT AUS

78 NEVER CHANGE A RUNNING SYSTEM

80 PROVISIONIERUNG VON IAAS CLOUDS

86 JINJA2 FÜR BESSERE ANSIBLE TEMPLATES

93 SSH ZWEIFAKTOR-AUTHENTIFIZIERUNG

100 EIN OPENSTACK-KRIMI

Cloud Fibel | www.cloudfibel.decodecentric AG | Merscheider Straße 1 | 42699 Solingen

Herausgeber: Mirko Novakovic | Redaktionsleitung: Claudia FröhlingDesign: Valentina Arambasic | Leserservice: marketing@codecentric.de

Wir danken Software & Support Media für die Erlaubnis zum Abdruck einiger Artikel.Copyright codecentric AG 2015 | www.codecentric.de

3

Blog Posts

• https://blog.codecentric.de/en/2015/03/true-kvm-live-migration-openstack-icehouse-ceph-based-vm-storage/

• https://blog.codecentric.de/en/2014/06/provisioning-iaas-clouds-dynamic-ansible-inventories-openstack-metadata/

• https://blog.codecentric.de/en/2014/08/jinja2-better-ansible-playbooks-templates/

• https://blog.codecentric.de/en/2014/06/ansible-simple-yet-powerful-automation/

• https://blog.codecentric.de/en/2014/09/openstack-crime-story-solved-tcpdump-sysdig-iostat-episode-1/

• https://blog.codecentric.de/en/2014/12/haproxy-http-header-rate-limiting/

• https://blog.codecentric.de/en/2014/12/centerdevice-cloud-architecture-revisited/

• https://blog.codecentric.de/en/2013/12/never-change-running-system-wrong/

• https://blog.codecentric.de/en/2013/11/hardware-will-fail-just-way-expect/

Vielen Dank.Daniel Schneller daniel.schneller@centerdevice.de @dschneller

Dr. Lukas Pustina lukas.pustina@centerdevice.de @drivebytesting

Recommended