37
Exploring Storage Options for Docker Containers 2015 Modulus | modulus.io

Cloud expo 2015

Embed Size (px)

Citation preview

Exploring Storage Options for Docker Containers

2015 Modulus | modulus.io

@abrongersma Sr. Infrastructure Engineer @ Modulus.io

Docker, LXC, AWS, Joyent, Digital Ocean, VMware

2015 Modulus | modulus.io

Muti-region awesomeness

Modulus.io2015 Modulus | modulus.io

Docker storage is tough

2015 Modulus | modulus.io

(Batteries Included)

2015 Modulus | modulus.io

Default Docker storage options

Docker storage drivers

Device Mapper

AUFS

BTRFS

Overlay

LVM

ZFS (New)

2015 Modulus | modulus.io

Data Volumes

Host folders

Data volume containers

2015 Modulus | modulus.io

Contianer runtime storage (inside container)

Requires (some exceptions)

S3fs, FUSE, BitTorrent Sync, GlusterFS, CIFS, NFS

Great for one container, becomes a hassle with lots of little containers

Privileged mode is scary

2015 Modulus | modulus.io

Storage problems

File uploads

Static assets

Databases

Large datasets

The setup

2x AWS C3XL 4 CPU

7.5 GB Memory 2 x 40 SSD 1 x 40 EBS

AWS VPC 2376, 80, 21, 8000-9000

us-east-1a

Ubuntu 14.04 Docker 1.6.2

2015 Modulus | modulus.io

Requirements

Horizontally scalable app

Replication, Eventual consistently

Present a mount point that can be passed to docker with docker run -v

All services should run on the host machine

2015 Modulus | modulus.io

Demo App

2015 Modulus | modulus.io

https://github.com/abrongersma/storage-demoThanks @harlanj

apt-get install node npm cd /mnt

git clone https://github.com/abrongersma/storage-demo.git cd storage-demo

npm install

run -dt -p 8001:4343 -e “HOST=storage1” -v /mnt/storage-demo:/mnt/storage-demo \ -v /mnt/{YOUR STORAGE}:/mnt/storage-demo/storage \

-w /mnt/storage-demo node:latest node ls.js

Install demo app

Rsync

https://rsync.samba.org/

2015 Modulus | modulus.io

Rsync runs once

Need a tool to trigger on filesystem events

Storage user account

Generate ssh key pair

2015 Modulus | modulus.io

https://github.com/axkibe/lsyncd/ 2015 Modulus | modulus.io

Demo

2015 Modulus | modulus.io

2 way replication is clunky, what about more hosts?

Large number of lsyncd processes running

Need a tool to mange scripts, docker pre-run script, post-run script

Service discovery is a must

Single storage user account, cycle keys

2015 Modulus | modulus.io

2015 Modulus | modulus.io

BitTorrent Sync

https://www.getsync.com/

2015 Modulus | modulus.io

BitTorrent to share files

Closed Source, Pro mode

Direct file transfers

Web Gui

2015 Modulus | modulus.io

2015 Modulus | modulus.io

Demo

2015 Modulus | modulus.io

The more the merrier

Bandwidth consumption

Complex headless install

Excellent with large files

Licensing issues?

2015 Modulus | modulus.io

GlusterFS

http://www.gluster.org/

2015 Modulus | modulus.io

Distributed file system

Commodity hardware

NFS or GlusterFS native client

FUSE(File System in Userspace)

2015 Modulus | modulus.io

2015 Modulus | modulus.io

2015 Modulus | modulus.io

Demo

2015 Modulus | modulus.io

Want to have more than 2 hosts

Not economical to have every docker host as a storage server

Requires lots of open ports

Management overhead

What if it breaks?

2015 Modulus | modulus.io

What about databases?

2015 Modulus | modulus.io

Flockerhttp://clusterhq.com

2015 Modulus | modulus.io

ZFS

Client, Node

Compose / Fig support

Works with local storage

2015 Modulus | modulus.io

2015 Modulus | modulus.io

Still in heavy development

Storage space efficiency

Doesn’t play nicely with others out of the box

Powerstrip looks to fix that

https://github.com/clusterhq/powerstrip-flocker

2015 Modulus | modulus.io

Honorable mentions

2015 Modulus | modulus.io

Ceph Amazon EFS

s3fs

2015 Modulus | modulus.io