Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RPI Swarm Cluster

RPI Swarm Cluster

DevOps CodeLabs
Raspberry Pi (RPI) Cluster with Docker Swarm
http://eueung.github.io/docker-stuff/cluster

1ec13070abf6996a0bc06b9be103ea85?s=128

Eueung Mulyana

May 08, 2016
Tweet

Transcript

  1. Sample Cases - RPIs Docker Swarm Eueung Mulyana http://eueung.github.io/docker-stuff/cluster CodeLabs

    | Attribution-ShareAlike CC BY-SA 1 / 30
  2. Outline Swarm on RPIs - A 3-Node Cluster Docker Machine

    - Generic Driver 2 / 30
  3. Docker Swarm on RPIs A 3-Node Cluster 3 / 30

  4. $ f l a s h - - h o

    s t n a m e n o d e 1 h y p r i o t - r p i - 2 0 1 6 0 3 0 6 - 1 9 2 3 1 7 . i m g $ f l a s h - - h o s t n a m e n o d e 2 h y p r i o t - r p i - 2 0 1 6 0 3 0 6 - 1 9 2 3 1 7 . i m g $ f l a s h - - h o s t n a m e n o d e 3 h y p r i o t - r p i - 2 0 1 6 0 3 0 6 - 1 9 2 3 1 7 . i m g # - d / d e v / m m c b l k 0 d o e s n ' t w o r k 4 / 30 Step #1 Prepare & Flash
  5. 5 / 30 Step #2 Connect Everything Plug & Power-Up

  6. $ p i n g - c 3 n o

    d e 1 . l o c a l P I N G n o d e 1 . l o c a l ( 1 9 2 . 1 6 8 . 1 . 1 0 2 ) 5 6 ( 8 4 ) b y t e s o f d a t a . 6 4 b y t e s f r o m 1 9 2 . 1 6 8 . 1 . 1 0 2 : i c m p _ s e q = 1 t t l = 6 4 t i m e = 3 . 5 1 m s . . . - - - n o d e 1 . l o c a l p i n g s t a t i s t i c s - - - 3 p a c k e t s t r a n s m i t t e d , 3 r e c e i v e d , 0 % p a c k e t l o s s , t i m e 6 0 2 6 m s r t t m i n / a v g / m a x / m d e v = 1 . 6 7 3 / 2 . 8 5 9 / 3 . 5 1 1 / 0 . 8 4 0 m s $ p i n g - c 3 n o d e 2 . l o c a l P I N G n o d e 2 . l o c a l ( 1 9 2 . 1 6 8 . 1 . 1 0 1 ) 5 6 ( 8 4 ) b y t e s o f d a t a . 6 4 b y t e s f r o m 1 9 2 . 1 6 8 . 1 . 1 0 1 : i c m p _ s e q = 1 t t l = 6 4 t i m e = 3 . 6 0 m s . . . - - - n o d e 2 . l o c a l p i n g s t a t i s t i c s - - - 3 p a c k e t s t r a n s m i t t e d , 3 r e c e i v e d , 0 % p a c k e t l o s s , t i m e 6 0 2 5 m s r t t m i n / a v g / m a x / m d e v = 1 . 8 0 6 / 2 . 4 9 1 / 3 . 6 0 8 / 0 . 7 9 6 m s $ p i n g - c 3 n o d e 3 . l o c a l P I N G n o d e 3 . l o c a l ( 1 9 2 . 1 6 8 . 1 . 1 0 0 ) 5 6 ( 8 4 ) b y t e s o f d a t a . 6 4 b y t e s f r o m 1 9 2 . 1 6 8 . 1 . 1 0 0 : i c m p _ s e q = 1 t t l = 6 4 t i m e = 3 . 0 9 m s . . . - - - n o d e 3 . l o c a l p i n g s t a t i s t i c s - - - 3 p a c k e t s t r a n s m i t t e d , 3 r e c e i v e d , 0 % p a c k e t l o s s , t i m e 2 0 0 3 m s r t t m i n / a v g / m a x / m d e v = 1 . 6 8 4 / 2 . 1 8 6 / 3 . 0 9 0 / 0 . 6 4 0 m s 6 / 30 Step #3 Test Connectivity
  7. $ s s h r o o t @ n

    o d e 1 . l o c a l $ s s h r o o t @ n o d e 2 . l o c a l $ s s h r o o t @ n o d e 3 . l o c a l # r o o t / h y p r i o t H y p r i o t O S : r o o t @ n o d e 1 i n ~ H y p r i o t O S : r o o t @ n o d e 1 i n ~ $ d o c k e r v e r s i o n C l i e n t : V e r s i o n : 1 . 1 0 . 2 A P I v e r s i o n : 1 . 2 2 G o v e r s i o n : g o 1 . 4 . 3 G i t c o m m i t : c 3 9 5 9 b 1 B u i l t : W e d F e b 2 4 0 9 : 5 1 : 3 8 2 0 1 6 O S / A r c h : l i n u x / a r m S e r v e r : V e r s i o n : 1 . 1 0 . 2 A P I v e r s i o n : 1 . 2 2 G o v e r s i o n : g o 1 . 4 . 3 G i t c o m m i t : c 3 9 5 9 b 1 B u i l t : W e d F e b 2 4 0 9 : 5 1 : 3 8 2 0 1 6 O S / A r c h : l i n u x / a r m $ d o c k e r - m a c h i n e - - v e r s i o n d o c k e r - m a c h i n e v e r s i o n 0 . 4 . 1 ( 5 4 9 d 0 1 6 ) 7 / 30 Step #4 Check Docker
  8. H y p r i o t O S :

    r o o t @ n o d e 1 i n ~ $ d o c k e r i n f o C o n t a i n e r s : 0 R u n n i n g : 0 P a u s e d : 0 S t o p p e d : 0 I m a g e s : 2 5 S e r v e r V e r s i o n : 1 . 1 0 . 2 S t o r a g e D r i v e r : o v e r l a y B a c k i n g F i l e s y s t e m : e x t f s E x e c u t i o n D r i v e r : n a t i v e - 0 . 2 L o g g i n g D r i v e r : j s o n - f i l e P l u g i n s : V o l u m e : l o c a l N e t w o r k : n u l l h o s t b r i d g e K e r n e l V e r s i o n : 4 . 1 . 1 7 - h y p r i o t o s - v 7 + O p e r a t i n g S y s t e m : R a s p b i a n G N U / L i n u x 8 ( j e s s i e ) O S T y p e : l i n u x A r c h i t e c t u r e : a r m v 7 l C P U s : 4 T o t a l M e m o r y : 9 2 5 . 5 M i B N a m e : n o d e 1 I D : H X 6 D : Z A U S : R C V C : O A 6 Y : N T U 6 : K J 2 P : K U I F : B E 6 Q : A N I X : U 3 N E : C M D O : T C H X 8 / 30 Step #4 Check Docker
  9. H y p r i o t O S :

    r o o t @ n o d e 1 i n ~ $ d o c k e r p u l l h y p r i o t / r p i - s w a r m U s i n g d e f a u l t t a g : l a t e s t l a t e s t : P u l l i n g f r o m h y p r i o t / r p i - s w a r m a 3 e d 9 5 c a e b 0 2 : P u l l c o m p l e t e f 1 2 f 8 8 3 f f 8 0 2 : P u l l c o m p l e t e D i g e s t : s h a 2 5 6 : 0 5 8 8 1 0 6 5 9 b 2 c f a 2 6 e 6 8 a a b d 9 4 9 9 f e 5 e b 9 b 7 0 b 2 d 0 b c 7 5 3 c d c a f c f f 0 0 3 5 9 0 4 9 6 0 9 S t a t u s : D o w n l o a d e d n e w e r i m a g e f o r h y p r i o t / r p i - s w a r m : l a t e s t $ d o c k e r i m a g e s R E P O S I T O R Y T A G I M A G E I D C R E A T E D S I Z E h y p r i o t / r p i - s w a r m l a t e s t 0 7 f a f c b 4 6 e c 6 3 1 h o u r s a g o 1 3 . 9 7 < n o n e > < n o n e > c 2 9 8 d e 0 6 2 1 9 0 8 w e e k s a g o 1 3 . 2 7 9 / 30 Step #5 Update Swarm
  10. $ s s h r o o t @ n

    o d e 1 . l o c a l $ s s h - k e y g e n - t r s a - C " r o o t @ n o d e 1 " G e n e r a t i n g p u b l i c / p r i v a t e r s a k e y p a i r . E n t e r f i l e i n w h i c h t o s a v e t h e k e y ( / r o o t / . s s h / i d _ r s a ) : E n t e r p a s s p h r a s e ( e m p t y f o r n o p a s s p h r a s e ) : E n t e r s a m e p a s s p h r a s e a g a i n : Y o u r i d e n t i f i c a t i o n h a s b e e n s a v e d i n / r o o t / . s s h / i d _ r s a . Y o u r p u b l i c k e y h a s b e e n s a v e d i n / r o o t / . s s h / i d _ r s a . p u b . T h e k e y f i n g e r p r i n t i s : d 8 : 7 6 : 6 6 : 1 a : 4 5 : 5 f : 9 e : 9 f : 7 d : c d : 2 1 : c a : 5 5 : c 7 : 1 d : b e r o o t @ n o d e 1 T h e k e y ' s r a n d o m a r t i m a g e i s : + - - - [ R S A 2 0 4 8 ] - - - - + | . . + + | | . . o o . + | | . . o o o | | o . . o . o * | | . S + o E * | | . * . | | . | | | | | + - - - - - - - - - - - - - - - - - + # n o p a s s p h r a s e # i f n e c e s s a r y # s s h - k e y g e n - f " ~ / . s s h / k n o w n _ h o s t s " - R n o d e 1 . l o c a l $ s s h - c o p y - i d - i ~ / . s s h / i d _ r s a . p u b r o o t @ n o d e 1 . l o c a l $ s s h - c o p y - i d - i ~ / . s s h / i d _ r s a . p u b r o o t @ n o d e 2 . l o c a l $ s s h - c o p y - i d - i ~ / . s s h / i d _ r s a . p u b r o o t @ n o d e 3 . l o c a l 10 / 30 Step #6 Prepare for Machine Operation
  11. $ s u d o a p t - g

    e t i n s t a l l b c # g e n e r a t e - t o k e n . s h # - - - - - - # ! / b i n / b a s h e x p o r t T O K E N = $ ( f o r i i n $ ( s e q 1 3 2 ) ; d o e c h o - n $ ( e c h o " o b a s e = 1 6 ; $ ( ( $ R A N D O M % 1 6 ) ) " | e c h o $ T O K E N # - - - - - - # c l u s t e r . t o k e n # - - - - - - e x p o r t T O K E N = 4 0 5 C 5 E 6 8 9 3 E 2 8 B E 7 2 6 F 8 9 C 0 8 B B 1 6 6 6 C F # - - - - - - $ s o u r c e c l u s t e r . t o k e n & & e c h o $ T O K E N 11 / 30 Step #7 Generate Token Using Docker Hub Discovery Backend Service
  12. H y p r i o t O S :

    r o o t @ n o d e 1 i n ~ $ d o c k e r - m a c h i n e c r e a t e - d h y p r i o t - - s w a r m - - s w a r m - m a s t e r - - s w a r m - d i s c o v e r y t o k e n : / / $ T O I m p o r t i n g S S H k e y . . . T o s e e h o w t o c o n n e c t D o c k e r t o t h i s m a c h i n e , r u n : d o c k e r - m a c h i n e e n v n o d e 1 H y p r i o t O S : r o o t @ n o d e 1 i n ~ $ d o c k e r - m a c h i n e c r e a t e - d h y p r i o t - - s w a r m - - s w a r m - d i s c o v e r y t o k e n : / / $ T O K E N - - h y p r i o t - i I m p o r t i n g S S H k e y . . . T o s e e h o w t o c o n n e c t D o c k e r t o t h i s m a c h i n e , r u n : d o c k e r - m a c h i n e e n v n o d e 2 H y p r i o t O S : r o o t @ n o d e 1 i n ~ $ d o c k e r - m a c h i n e c r e a t e - d h y p r i o t - - s w a r m - - s w a r m - d i s c o v e r y t o k e n : / / $ T O K E N - - h y p r i o t - i I m p o r t i n g S S H k e y . . . T o s e e h o w t o c o n n e c t D o c k e r t o t h i s m a c h i n e , r u n : d o c k e r - m a c h i n e e n v n o d e 3 H y p r i o t O S : r o o t @ n o d e 1 i n ~ $ d o c k e r - m a c h i n e l s N A M E A C T I V E D R I V E R S T A T E U R L S W A R M n o d e 1 h y p r i o t R u n n i n g t c p : / / 1 9 2 . 1 6 8 . 1 . 1 0 2 : 2 3 7 6 n o d e 1 ( m a s t e r ) n o d e 2 h y p r i o t R u n n i n g t c p : / / 1 9 2 . 1 6 8 . 1 . 1 0 1 : 2 3 7 6 n o d e 1 n o d e 3 h y p r i o t R u n n i n g t c p : / / 1 9 2 . 1 6 8 . 1 . 1 0 0 : 2 3 7 6 n o d e 1 12 / 30 Step #8 Execute Machine
  13. H y p r i o t O S :

    r o o t @ n o d e 1 i n ~ $ e v a l $ ( d o c k e r - m a c h i n e e n v - - s w a r m n o d e 1 ) H y p r i o t O S : r o o t @ n o d e 1 i n ~ $ d o c k e r p s C O N T A I N E R I D I M A G E C O M M A N D C R E A T E D a f 2 f 6 f 4 3 1 1 4 1 h y p r i o t / r p i - s w a r m : l a t e s t " / s w a r m j o i n - - a d v e r t " 5 m i n u t e s a g o 3 6 a 7 2 2 9 c a d 5 a h y p r i o t / r p i - s w a r m : l a t e s t " / s w a r m j o i n - - a d v e r t " A b o u t a n h o u r a f b c 8 6 1 a 6 6 0 d e h y p r i o t / r p i - s w a r m : l a t e s t " / s w a r m j o i n - - a d v e r t " A b o u t a n h o u r a 9 e 8 4 9 9 7 6 b 1 0 b h y p r i o t / r p i - s w a r m : l a t e s t " / s w a r m m a n a g e - - t l s v " A b o u t a n h o u r a 13 / 30 Step #9 Ready for Testing
  14. H y p r i o t O S :

    r o o t @ n o d e 1 i n ~ $ d o c k e r r u n - d - p 8 0 8 0 : 8 0 h y p r i o t / r p i - n a n o - h t t p d 0 1 b e 8 9 a 4 1 f d c 7 c 3 c a a d b 4 f 9 8 5 e 9 c f 4 3 1 6 1 a 1 5 f 9 9 1 e 0 6 e f 2 d 4 7 f e 7 e 6 c 6 c 7 9 e 3 2 b $ d o c k e r r u n - d - p 8 0 8 0 : 8 0 h y p r i o t / r p i - n a n o - h t t p d 6 2 8 b a 5 2 6 6 2 1 a f 3 3 c a 2 8 9 3 0 3 f 6 f 5 4 a 8 0 c 4 f e 1 3 9 b c e c e 3 8 e 2 0 2 f f 4 e a 5 b d 4 e c 8 e 5 a $ d o c k e r p s C O N T A I N E R I D I M A G E C O M M A N D C R E A T E D 6 2 8 b a 5 2 6 6 2 1 a h y p r i o t / r p i - n a n o - h t t p d " / h t t p d 8 0 " 1 4 s e c o n d s a g o 0 1 b e 8 9 a 4 1 f d c h y p r i o t / r p i - n a n o - h t t p d " / h t t p d 8 0 " A b o u t a m i n u t e a f 2 f 6 f 4 3 1 1 4 1 h y p r i o t / r p i - s w a r m : l a t e s t " / s w a r m j o i n - - a d v e r t " 1 0 m i n u t e s a g o 3 6 a 7 2 2 9 c a d 5 a h y p r i o t / r p i - s w a r m : l a t e s t " / s w a r m j o i n - - a d v e r t " A b o u t a n h o u r a f b c 8 6 1 a 6 6 0 d e h y p r i o t / r p i - s w a r m : l a t e s t " / s w a r m j o i n - - a d v e r t " A b o u t a n h o u r a 9 e 8 4 9 9 7 6 b 1 0 b h y p r i o t / r p i - s w a r m : l a t e s t " / s w a r m m a n a g e - - t l s v " A b o u t a n h o u r a 14 / 30 Step #9 Ready for Testing
  15. H y p r i o t O S :

    r o o t @ n o d e 1 i n ~ $ d o c k e r i n f o C o n t a i n e r s : 6 R u n n i n g : 6 - P a u s e d : 0 - S t o p p e d : 0 I m a g e s : 5 S e r v e r V e r s i o n : s w a r m / 1 . 2 . 1 - R o l e : p r i m a r y S t r a t e g y : s p r e a d F i l t e r s : h e a l t h , p o r t , c o n t a i n e r s l o t s , d e p e n d e n c y , a f f i n i t y , c o n s t r a i n t N o d e s : 3 n o d e 1 : 1 9 2 . 1 6 8 . 1 . 1 0 2 : 2 3 7 6 - I D : M H E R : 4 B E C : J 5 E R : 3 T J L : I H 5 5 : U F W Y : O N G H : 2 S 4 I : R 4 V P : U N S 5 : N T G 4 : F J 3 J - S t a t u s : H e a l t h y - C o n t a i n e r s : 2 - R e s e r v e d C P U s : 0 / 4 - R e s e r v e d M e m o r y : 0 B / 9 7 1 . 8 M i B - L a b e l s : e x e c u t i o n d r i v e r = n a t i v e - 0 . 2 , k e r n e l v e r s i o n = 4 . 1 . 1 7 - h y p r i o t o s - v 7 + , o p e r a t i n g s y - E r r o r : ( n o n e ) - U p d a t e d A t : 2 0 1 6 - 0 5 - 0 8 T 0 1 : 4 2 : 1 1 Z - S e r v e r V e r s i o n : 1 . 1 0 . 2 n o d e 2 : 1 9 2 . 1 6 8 . 1 . 1 0 1 : 2 3 7 6 - C o n t a i n e r s : 2 - R e s e r v e d C P U s : 0 / 4 - R e s e r v e d M e m o r y : 0 B / 9 7 1 . 8 M i B n o d e 3 : 1 9 2 . 1 6 8 . 1 . 1 0 0 : 2 3 7 6 - C o n t a i n e r s : 2 - R e s e r v e d C P U s : 0 / 4 - R e s e r v e d M e m o r y : 0 B / 9 7 1 . 8 M i B . . . K e r n e l V e r s i o n : 4 . 1 . 1 7 - h y p r i o t o s - v 7 + - O p e r a t i n g S y s t e m : l i n u x - A r c h i t e c t u r e : a r m C P U s : 1 2 T o t a l M e m o r y : 2 . 8 4 7 G i B N a m e : 9 e 8 4 9 9 7 6 b 1 0 b 15 / 30 Step #9 Ready for Testing
  16. C O N T A I N E R I

    D I M A G E C O M M A N D C R E A T E D 6 2 8 b a 5 2 6 6 2 1 a h y p r i o t / r p i - n a n o - h t t p d " / h t t p d 8 0 " 1 4 s e c o n d s a g o 0 1 b e 8 9 a 4 1 f d c h y p r i o t / r p i - n a n o - h t t p d " / h t t p d 8 0 " A b o u t a m i n u t e 16 / 30 Step #9 Ready for Testing
  17. C O N T A I N E R I

    D I M A G E C O M M A N D C R E A T E D 6 2 8 b a 5 2 6 6 2 1 a h y p r i o t / r p i - n a n o - h t t p d " / h t t p d 8 0 " 1 4 s e c o n d s a g o 0 1 b e 8 9 a 4 1 f d c h y p r i o t / r p i - n a n o - h t t p d " / h t t p d 8 0 " A b o u t a m i n u t e 17 / 30 Step #9 Ready for Testing
  18. Generic Driver More with Docker Machine 18 / 30

  19. $ d o c k e r - m a

    c h i n e v e r s i o n d o c k e r - m a c h i n e v e r s i o n 0 . 7 . 0 , b u i l d a 6 5 0 a 4 0 $ s o u r c e c l u s t e r . t o k e n & & e c h o $ T O K E N $ . / p r e p a r e - n o d e . s h n o d e 1 . l o c a l $ . / p r e p a r e - n o d e . s h n o d e 2 . l o c a l $ . / p r e p a r e - n o d e . s h n o d e 3 . l o c a l # ! / b i n / b a s h # p r e p a r e - n o d e . s h f u n c t i o n g e t i p ( ) { ( t r a c e r o u t e $ 1 2 > & 1 | h e a d - n 1 | c u t - d \ ( - f 2 | c u t - d \ ) - f 1 ) } I P _ A D D R E S S = $ ( g e t i p $ 1 ) # e c h o $ I P _ A D D R E S S s s h - k e y g e n - R $ I P _ A D D R E S S s s h - c o p y - i d - o S t r i c t H o s t K e y C h e c k i n g = n o - o C h e c k H o s t I P = n o r o o t @ $ I P _ A D D R E S S s s h r o o t @ $ I P _ A D D R E S S s e d - i \ ' s / I D = r a s p b i a n / I D = d e b i a n / g \ ' / e t c / o s - r e l e a s e # - - - - - # c l u s t e r . t o k e n e x p o r t T O K E N = 4 0 5 C 5 E 6 8 9 3 E 2 8 B E 7 2 6 F 8 9 C 0 8 B B 1 6 6 6 F E 19 / 30 Prepare the Nodes
  20. # ! / b i n / b a s

    h # a c t i v a t e - m a s t e r . s h f u n c t i o n g e t i p ( ) { ( t r a c e r o u t e $ 1 2 > & 1 | h e a d - n 1 | c u t - d \ ( - f 2 | c u t - d \ ) - f 1 ) } I P _ A D D R E S S = $ ( g e t i p $ 1 ) e c h o $ I P _ A D D R E S S e c h o $ T O K E N d o c k e r - m a c h i n e - D c r e a t e - d g e n e r i c \ - - e n g i n e - s t o r a g e - d r i v e r = o v e r l a y - - s w a r m - - s w a r m - m a s t e r \ - - s w a r m - i m a g e h y p r i o t / r p i - s w a r m : 1 . 2 . 1 \ - - s w a r m - d i s c o v e r y = " t o k e n : / / $ T O K E N " \ - - g e n e r i c - i p - a d d r e s s = $ ( g e t i p $ 1 ) \ $ 1 20 / 30 Activate Master Node
  21. $ . / a c t i v a t

    e - m a s t e r . s h n o d e 1 . l o c a l R u n n i n g p r e - c r e a t e c h e c k s . . . C r e a t i n g m a c h i n e . . . ( n o d e 1 . l o c a l ) N o S S H k e y s p e c i f i e d . C o n n e c t i n g t o t h i s m a c h i n e n o w a n d i n t h e f u t u r e w i W a i t i n g f o r m a c h i n e t o b e r u n n i n g , t h i s m a y t a k e a f e w m i n u t e s . . . D e t e c t i n g o p e r a t i n g s y s t e m o f c r e a t e d i n s t a n c e . . . W a i t i n g f o r S S H t o b e a v a i l a b l e . . . D e t e c t i n g t h e p r o v i s i o n e r . . . P r o v i s i o n i n g w i t h d e b i a n . . . C o p y i n g c e r t s t o t h e l o c a l m a c h i n e d i r e c t o r y . . . C o p y i n g c e r t s t o t h e r e m o t e m a c h i n e . . . S e t t i n g D o c k e r c o n f i g u r a t i o n o n t h e r e m o t e d a e m o n . . . C o n f i g u r i n g s w a r m . . . . . . 21 / 30 Activate Master Node ssh root@node1.local docker rm .. docker rmi .. docker pull hypriot/rpi- swarm:1.2.1
  22. $ . / a c t i v a t

    e - a g e n t . s h n o d e 2 . l o c a l $ . / a c t i v a t e - a g e n t . s h n o d e 3 . l o c a l . . . # ! / b i n / b a s h # a c t i v a t e - a g e n t . s h f u n c t i o n g e t i p ( ) { ( t r a c e r o u t e $ 1 2 > & 1 | h e a d - n 1 | c u t - d \ ( - f 2 | c u t - d \ ) - f 1 ) } I P _ A D D R E S S = $ ( g e t i p $ 1 ) e c h o $ I P _ A D D R E S S e c h o $ T O K E N d o c k e r - m a c h i n e - D c r e a t e - d g e n e r i c \ - - e n g i n e - s t o r a g e - d r i v e r = o v e r l a y - - s w a r m \ - - s w a r m - i m a g e h y p r i o t / r p i - s w a r m : 1 . 2 . 1 \ - - s w a r m - d i s c o v e r y = " t o k e n : / / $ T O K E N " \ - - g e n e r i c - i p - a d d r e s s = $ ( g e t i p $ 1 ) \ $ 1 22 / 30 Activate Agents ssh root@node1.local docker rm .. docker rmi .. docker pull hypriot/rpi- swarm:1.2.1
  23. $ d o c k e r - m a

    c h i n e l s N A M E A C T I V E D R I V E R S T A T E U R L S W A R M a g e n t 1 - v i r t u a l b o x S t o p p e d a g e n t 2 - v i r t u a l b o x S t o p p e d d e f a u l t - v i r t u a l b o x S t o p p e d m a n a g e r - v i r t u a l b o x S t o p p e d n o d e 1 . l o c a l * ( s w a r m ) g e n e r i c R u n n i n g t c p : / / 1 9 2 . 1 6 8 . 1 . 1 0 2 : 2 3 7 6 n o d e 1 . l o c a l n o d e 2 . l o c a l - g e n e r i c R u n n i n g t c p : / / 1 9 2 . 1 6 8 . 1 . 1 0 1 : 2 3 7 6 n o d e 1 . l o c a l 23 / 30 Check
  24. $ c u r l - s L h t

    t p s : / / d o w n l o a d . g e t c a r i n a . c o m / d v m / l a t e s t / i n s t a l l . s h | s h D o w n l o a d i n g d v m . s h . . . # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 1 0 0 , 0 % D o w n l o a d i n g b a s h _ c o m p l e t i o n # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 1 0 0 , 0 % D o w n l o a d i n g d v m - h e l p e r . . . # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 1 0 0 , 0 % D o c k e r V e r s i o n M a n a g e r ( d v m ) h a s b e e n i n s t a l l e d t o / h o m e / e m / . d v m R u n t h e f o l l o w i n g c o m m a n d t o s t a r t u s i n g d v m . T h e n a d d i t t o y o u r b a s h p r o f i l e ( e . g . ~ / s o u r c e / h o m e / e m / . d v m / d v m . s h $ s o u r c e / h o m e / e m / . d v m / d v m . s h $ d v m i n s t a l l 1 . 1 0 . 2 I n s t a l l i n g 1 . 1 0 . 2 . . . N o w u s i n g D o c k e r 1 . 1 0 . 2 24 / 30 Install DVM Docker (Client) Version Manager
  25. $ d o c k e r v e r

    s i o n C l i e n t : V e r s i o n : 1 . 1 0 . 2 A P I v e r s i o n : 1 . 2 2 G o v e r s i o n : g o 1 . 5 . 3 G i t c o m m i t : c 3 9 5 9 b 1 B u i l t : M o n F e b 2 2 2 2 : 3 7 : 3 3 2 0 1 6 O S / A r c h : l i n u x / a m d 6 4 S e r v e r : V e r s i o n : 1 . 1 1 . 1 A P I v e r s i o n : 1 . 2 3 G o v e r s i o n : g o 1 . 5 . 4 G i t c o m m i t : 5 6 0 4 c b e B u i l t : T u e A p r 2 6 2 3 : 4 3 : 4 9 2 0 1 6 O S / A r c h : l i n u x / a m d 6 4 $ d v m l s - > 1 . 1 0 . 2 s y s t e m ( 1 . 1 1 . 1 ) $ d v m u s e 1 . 1 0 . 2 25 / 30 Install DVM Docker (Client) Version Manager
  26. $ e v a l $ ( d o c

    k e r - m a c h i n e e n v - - s w a r m n o d e 1 . l o c a l ) $ d o c k e r i n f o C o n t a i n e r s : 3 R u n n i n g : 3 - P a u s e d : 0 - S t o p p e d : 0 I m a g e s : 6 S e r v e r V e r s i o n : s w a r m / 1 . 2 . 1 R o l e : p r i m a r y S t r a t e g y : s p r e a d F i l t e r s : h e a l t h , p o r t , c o n t a i n e r s l o t s , d e p e n d e n c y , a f f i n i t y , c o n s t r a i n t N o d e s : 2 n o d e 1 . l o c a l : 1 9 2 . 1 6 8 . 1 . 1 0 2 : 2 3 7 6 - C o n t a i n e r s : 2 - R e s e r v e d C P U s : 0 / 4 - R e s e r v e d M e m o r y : 0 B / 9 7 1 . 8 M i B - S e r v e r V e r s i o n : 1 . 1 0 . 2 n o d e 2 . l o c a l : 1 9 2 . 1 6 8 . 1 . 1 0 1 : 2 3 7 6 - C o n t a i n e r s : 1 - R e s e r v e d C P U s : 0 / 4 K e r n e l V e r s i o n : 4 . 1 . 1 7 - h y p r i o t o s - v 7 + - O p e r a t i n g S y s t e m : l i n u x - A r c h i t e c t u r e : a r m C P U s : 8 - T o t a l M e m o r y : 1 . 8 9 8 G i B 26 / 30 Ready for Testing
  27. $ d o c k e r r u n

    - d - p 8 0 8 0 : 8 0 h y p r i o t / r p i - n a n o - h t t p d 9 5 4 5 8 e c f 5 c 3 f e 3 5 7 7 f 9 2 c b b b 4 0 8 b c 0 2 f a c e f 7 d e 4 6 1 8 f 2 6 6 7 1 7 8 0 5 e 0 4 2 2 f 8 e 3 0 b $ d o c k e r p s C O N T A I N E R I D I M A G E C O M M A N D C R E A T E D 9 5 4 5 8 e c f 5 c 3 f h y p r i o t / r p i - n a n o - h t t p d " / h t t p d 8 0 " 8 s e c o n d s a g o d f 3 a 4 5 3 a c 6 9 4 h y p r i o t / r p i - s w a r m : 1 . 2 . 1 " / s w a r m j o i n - - a d v e r t " 1 7 m i n u t e s a g o c 0 d 2 6 b 7 f 6 d 6 f h y p r i o t / r p i - s w a r m : 1 . 2 . 1 " / s w a r m j o i n - - a d v e r t " 4 5 m i n u t e s a g o c 7 9 6 d 9 b 3 2 0 5 2 2 0 2 8 5 1 b 3 2 1 f 9 " / s w a r m m a n a g e - - t l s v " 4 6 m i n u t e s a g o 27 / 30 Ready for Testing
  28. Refs 28 / 30

  29. Refs 1. Installing Docker Swarm on HypriotOS 2. Let Docker

    Swarm all over your Raspberry Pi Cluster 3. How to setup a Docker Swarm cluster with Raspberry Pi's 4. getcarina/dvm: Docker Version Manager 5. Manage Docker clients with the Docker Version Manager | Carina by Rackspace 29 / 30
  30. END Eueung Mulyana http://eueung.github.io/docker-stuff/cluster CodeLabs | Attribution-ShareAlike CC BY-SA 30

    / 30