Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Discovering Docker Volume Plugins and Apps using VirtualBox

782 views

Published on

There are right and wrong ways to use containers with persistent applications. Lucky for you, doing it the right way is much easier nowadays with Docker Volume Plugins. This talk will focus on doing some basic education including mostly live demos to show how you can take advantage of these new capabilities for expanding how you leverage containers.

Published in: Technology
  • Be the first to comment

Discovering Docker Volume Plugins and Apps using VirtualBox

  1. 1. Discovering+Docker+ Volume+Plugins+and+ Apps+using+VirtualBox Clint&Kitson&*&Developer& Advocate&Leader emccode.github.io
  2. 2. descrip(on There%are%right%and%wrong%ways%to%use%containers%with%persistent% applica4ons.%Lucky%for%you,%doing%it%the%right%way%is%much%easier% nowadays%with%Docker%Volume%Plugins.%This%talk%will%focus%on%doing% some%basic%educa4on%including%mostly%live%demos%to%show%how%you% can%take%advantage%of%these%new%capabili4es%for%expanding%how% you%leverage%containers.
  3. 3. Agenda • Docker(Volume(Plugin(overview • Volume(Plugins(with(VirtualBox(in(ac9on • Inves9ga9ng(applica9ons(and(running(with(Volume(Plugin • Thinking(about(availability • Performing(failAover(of(a(container(to(another(container(host
  4. 4. Situa&on/Problem • When&I&run&a&persistent&applica1on&in&a&container,&where&does& my&data&get&stored? • Possibly&a&data&volume • Possibly&container&volume • Possibly&an&exis1ng&private&mounted&volume&from&networked& storage • ..&howto&build&a&snowflake • Container&hosts&should&be&immutable
  5. 5. Enter&Docker&Extensibility • Volume • Network • Authoriza2on • Composable8and8sustainable • Consumed8solely8through8Docker8API • Up8to8consuming8ecoAsystem8to8leverage8func2onality,8ie.8 container8schedulers
  6. 6. What%are%Docker%Volume% Plugins • Drama&cally*simplifies*external*storage* for*usage*with*containers • Service*that*runs*alongside*Docker* daemon*receiving*Plugin*requests • Extensible*storage*orchestra&on • Lunch*is*ready*at*/var/lib/ plugin/volumes/vol1/data • Serves*requests*for*Volume*Create/ Remove/Mount/Unmount/Path
  7. 7. How$do$we$play? • VirtualBox,can,be,used,similar,to, explore • VirtualBox,is,popular,and,works,well, on,laptops • Provides,shared,storage,pla;orm, through,Virtual,Media • or,GCE,,AWS,EC2,,Openstack,Cinder,, EMC,ScaleIO/XtremIO/Isilon/VMAX • or,other,Volume,Plugins • MulIple,container,hosts,(VMs),to, ensure,failover,and,immutability
  8. 8. Typical(Install(and(Configure • Install curl -sSL https://dl.bintray.com/emccode/rexray/install | sh - • /etc/rexray/config.yml rexray: logLevel: warn storageDrivers: - virtualbox mount: volume: preempt: false virtualbox: endpoint: http://10.0.2.2:18083 tls: false volumePath: "/Users/clintonkitson/Repos/vagrant-rexray/Volumes" controllerName: SATA
  9. 9. Super&Simple&Example&using& Vagrant&and&VirtualBox • Requires • Vagrant • VirtualBox25.0.10+ • VBoxManage setproperty websrvauthlibrary null • vboxwebsrv -H 0.0.0.0 -v -b
  10. 10. Vagrant'example git clone https://github.com/jonasrosland/vagrant-rexray cd vagrant-rexray vagrant up vagrant ssh rexray-1
  11. 11. Discover)REX-Ray)and) VirtulBox)on)rexray-1 sudo su rexray rexray volume --help rexray volume ls rexray volume create --volumename=testing --size=1 rexray volume mount --volumename=testing ls /var/lib/rexray/volumes/testing/data rexray volume unmount --volumename=testing rexray stop rexray start
  12. 12. docker'volume'create'.' rexray.1 docker volume docker volume create --driver=rexray --name=meetup1 --opt=size=2 docker volume ls
  13. 13. docker'run'with'busybox docker run -ti --volume-driver=rexray -v meetup1:/meetup1 busybox df /meetup1 touch /meetup1/hello exit
  14. 14. docker'run'to'verify'with'busybox docker run -ti --volume-driver=busybox -v meetup1:/meetup1 busybox ls /meetup1 exit
  15. 15. docker'run'with'sharing' volume docker run -tid --name=container1 --volume-driver=rexray -v meetup1:/meetup1 busybox docker run -ti --volumes-from=container1 busybox ls /meetup1 exit docker exec container1 ls /meetup1 docker stop container1
  16. 16. Discovering+Volumes+and+Container+Images • REX%Ray(Docs(on(Applica2ons • Dockerfile(includes(a(VOLUME(instruc2on • VOLUME(["/data"] • Up(to(container(image(maintainer(to(properly(designate( appropriate(loca2on(of(persistent(data • Makes(a(container(workload(portable • Enables(immutable(hosts
  17. 17. Discovering+Apps+and+Volumes+using+postgres • postgres)on)docker)hub • Dockerfile)for)postgres)9.5 • VOLUME)/var/lib/postgresql/data
  18. 18. running&postgres&,&internal&data&volume docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres docker rm -f some-postgres
  19. 19. running&postgres&,&external&data&volume docker volume create --driver=rexray --name=pdata --opt=size=3 docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d --volume-driver=rexray -v pdata:/var/lib/postgresql/data postgres ls /var/lib/rexray/volumes/pdata/data docker logs some-postgres exit
  20. 20. try$a$failover$,$on$rexray,2 vagrant ssh rexray-2 sudo su docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d --volume-driver=rexray -v pdata:/var/lib/postgresql/data postgres
  21. 21. Thinking'About'Availability • Always(sharing(isn't(the(answer • Safety(first(for(ext4/xfs • Failure(scenarios? • Container(dies? • Container(run>me(borks? • Kernel(problems? • Host(unresponsive? • ..(volumes(are(typically(aGached(and( locked(to(hosts
  22. 22. turn%on%volume%mount%pre,emp-on • vi$/etc/rexray/config.yml • set$rexray.volume.mount.preempt: true • rexray$stop • rexray$start
  23. 23. do#a#failover#+#on#rexray+2 docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d --volume-driver=rexray -v data:/var/lib/postgresql/data postgres
  24. 24. Summary • Volume(plugins(are(great • Keep(container(hosts(immutable • Persistent(volumes(can(be(orchestrated(for(containers • Container(images(with(volumes(specified(are(easy(to(make( persistent
  25. 25. EMC${code}$+$emccode.github.io • Looking(for(folks(that(are(passionate(about(Containers,(Open( Source,(and(DevOps • REX?Ray • RackHD • mesos?module?dvdi • OSS(ContribuCon(?(Docker,(Mesos,(others
  26. 26. THANK&YOU emccode.github.io

×