Introduction to Docker Swarm | Tutorial for Beginners | Examples | Typical Tasks

Поділитися
Вставка
  • Опубліковано 4 жов 2024
  • In this Docker Swarm tutorial we’ll build the basic Swarm skills that you’ll need in your project work. You’ll learn to set up a Swarm cluster, Deploy applications, explore and manage your stack in the cluster, and we’ll also go through typical maintenance activities that you’ll need.
    You can find the article form of this tutorial on my blog here: takacsmark.com...
    This is a code-along tutorial, so please open up your terminal and get ready. We’ll use a two step approach:
    We’ll set up a cluster and deploy an application first. The goal here is to show you what Swarm is all about and what it’s capable of. We’ll set up a one machine cluster on your local machine first, and then we’ll set up a cluster of two hosts.
    Once you get the big picture in step 1, I’ll explain all details behind. I think it’s easier to learn and understand after you’ve seen the stuff in action.
    In order to get the most out of this article you should be familiar with basic Docker concepts, like containers, images, the Dockerfile and Docker Compose. If you need a refresher on these topics, please go to my previous tutorials first. Alternatively you can get my book for a complete guided experience.

КОМЕНТАРІ • 85

  • @lemurza5236
    @lemurza5236 3 роки тому +2

    I hate it when I find such a great channel that seems to be dead. You should really consider making more content. Your style of teaching is amazing

  • @hosnimahmoudi2579
    @hosnimahmoudi2579 3 роки тому +1

    I bedanke mich fùr Ihre Helfe. Sie sind sehr hilfsbereit.

  • @Karthik1516
    @Karthik1516 9 місяців тому

    I have been using standalone docker for a while, merely as an alternative to virtualization. Now, upgrading all our dedicated servers in the cloud, and thought it was a good time to learn about swarm and build them in a highly available and scalable way. I understood the concept from your talk. Thank You so much.

  • @jameswachira5713
    @jameswachira5713 29 днів тому

    Awesome tutorial. Thank you sir

  • @Blixzful
    @Blixzful 4 роки тому +6

    This is a good talk, but maybe you could continue this with explaining how to manage swarm in production, and how to automate deployments from push to server.

  • @srinidhiii
    @srinidhiii 4 роки тому +1

    wonderful tutorial!!.standing ovation to you sir

  • @gagangupta1255
    @gagangupta1255 5 років тому +2

    God bless you Mark, for creating such an amazing videos- which are far better than the paid tutorials that I have purchased online

  • @stephenremillard9462
    @stephenremillard9462 2 роки тому

    Fantastic explantation in just enough time. Thank you sir!

  • @MehdiBouzidi
    @MehdiBouzidi 3 роки тому

    I'm just at the middle of the video and it's so well explained and interresting !!! THANKS

  • @arsalanahmad1832
    @arsalanahmad1832 4 роки тому +1

    great tutorial, really searched a lot to get this. Thanks a lot. JazakAllah

  • @chromedevext
    @chromedevext 2 роки тому

    Kudos! This is great tutorial

  • @kedareswaraswamy6706
    @kedareswaraswamy6706 2 роки тому

    Great explanation..thankyou

  • @ashmansingh872
    @ashmansingh872 4 роки тому +1

    one of the best tutorial video's on docker..., awesome stuff.

  • @jaychang5631
    @jaychang5631 4 роки тому +1

    I found you use vim and emacs org mode, that's so cool
    you are the only one youtuber that not use vscode or sublime :D

  • @swayamtrading836
    @swayamtrading836 5 років тому

    Great video on docker swarm. As a beginner I really understood the concept.thank you

  • @Cosmetolog_G
    @Cosmetolog_G 4 роки тому

    Thank you! Really enjoyed your tutorial! Currently need to do some docker swarm stuff for some customer :)

  • @mehdimortaz351
    @mehdimortaz351 3 роки тому

    Thank you. Best tutorial that I have seen for the docker swarm. \o/

  • @kailashdim7560
    @kailashdim7560 5 років тому +8

    Nice tutorial . I understand swarm. In the last you comment on kubernetes . would you please upload kubernetes tutorial near future :)
    Thanks again for uploading this tutorial .

  • @believer365days
    @believer365days 4 роки тому

    very good explonation sir.

  • @paramvirdeol5839
    @paramvirdeol5839 5 років тому +1

    This is really great and well put up. Cleared a lot of my queries on docker swarm.

  • @ahmedb.hameed3330
    @ahmedb.hameed3330 4 роки тому

    Nice explanation. Many thanks.

  • @muhammadamhan
    @muhammadamhan 3 роки тому +2

    This tutorial is absolutely amazing. I've subscribed and looking forward for more of your videos. I'd like to give some feedback after I've got the hang of Docker swarm and deployed my application there. The video is great but missing few tiny definitions to make it perfect for beginners in my opinion, and I feel it would have been nice if you included:
    What docker registry is and how to create a repository on docker hub (many beginners might face errors when trying to push an image locally not knowing that they need to create a repo). It could be useful to show how to store the image on local registry container too. Maybe a little example of how to automate the process by providing a yaml definition.. and so on.
    Thanks for your efforts putting together this amazing video. Overall, this is the best video I have found on the internet.

    • @takacsmark
      @takacsmark  3 роки тому +1

      Thanks Muhammad for your kind feedback and the tips!

    • @blissweb
      @blissweb 2 роки тому

      I did my own private registry, was a bit of a pain but got it working eventually. His solution of using the docker hub seems more simple and elegant, would also like to see how that is done.

  • @jagadeesh0014
    @jagadeesh0014 4 роки тому

    Great Tutorial with good examples...

  • @khalilbn
    @khalilbn 4 роки тому

    Thank you mark, i watched all ur docker's videos and they were fantastic and helped me so much in my daily work, hope you keep posting such a great contents 🙂

  • @blissweb
    @blissweb 2 роки тому

    Excellent video. Filled in a few gaps I was having with docker swarm. Kinda shocking the manual stuff that needs to be done to get the containers back on a down host though. I had found this myself and was hoping that this video would give some magic about how the containers could magically come back. Apparently not. In my testing, if I rebooted one of the machines , all the containers would move nicely to the other, but never come back. I can see why people use Kubernetes. 🙂

  • @mehrdaddowlatabadi2319
    @mehrdaddowlatabadi2319 2 роки тому

    great content, thanks

  • @AAKE8D
    @AAKE8D 5 років тому +2

    thanks for your time. really cleared some things for me :)

  • @abdulsalam9117
    @abdulsalam9117 3 роки тому

    What a great tutorial mark, thank you!, auto subscribe :)

  • @davidalsbury5980
    @davidalsbury5980 5 років тому +1

    Thank you! This was a great demo. I've been trying to understand the different parts of Docker and how they all relate. Your demonstration helped clear up a lot of confusion.

    • @houstonlochlan9001
      @houstonlochlan9001 3 роки тому

      you all prolly dont give a damn but does anybody know a trick to log back into an instagram account..?
      I was dumb lost my login password. I appreciate any assistance you can give me

    • @daniellance6892
      @daniellance6892 3 роки тому

      @Houston Lochlan instablaster =)

    • @houstonlochlan9001
      @houstonlochlan9001 3 роки тому

      @Daniel Lance I really appreciate your reply. I got to the site through google and I'm in the hacking process now.
      I see it takes a while so I will get back to you later with my results.

    • @houstonlochlan9001
      @houstonlochlan9001 3 роки тому

      @Daniel Lance it did the trick and I actually got access to my account again. I'm so happy:D
      Thank you so much, you saved my account !

    • @daniellance6892
      @daniellance6892 3 роки тому

      @Houston Lochlan you are welcome :D

  • @RobertCsala
    @RobertCsala 5 років тому

    Mark. We meet again! :)
    Great vid!

  • @alicexj6917
    @alicexj6917 3 роки тому

    You are the best

  • @Izngd
    @Izngd 5 років тому

    Good job Sir, thanks.

  • @sourabhthakur3063
    @sourabhthakur3063 5 років тому

    Fantastic explanation ! thank you :)

  • @jubernunes8756
    @jubernunes8756 5 років тому

    Very nice content put together. Clear and concise throughout, thanks a lot Mark for your amazing effort and for sharing your knowledge.

  • @WaldirBorbaJunior
    @WaldirBorbaJunior 5 років тому

    Great class

  • @SpeedyWinds
    @SpeedyWinds 5 років тому

    Nice content! Thumbs up to your channel.

  • @budi0580
    @budi0580 3 роки тому

    Awesome video... Anw, can docker swarm handle stateful app, like postgres ? 🙏

  • @malinyamato2291
    @malinyamato2291 Рік тому

    good explain :)

  • @Tom9200.
    @Tom9200. 3 роки тому

    Great video, thank you sir!
    Mindig öröm egy magyar kollégától tanulni! :)

  • @joelfankam3719
    @joelfankam3719 5 років тому

    great . can you make a tutorial about distributed volume in cluster or swarm ?

  • @alanfeng99
    @alanfeng99 5 років тому +4

    Great content, if you could improve the sound recording in the future would be superb.

    • @takacsmark
      @takacsmark  5 років тому +1

      Thanks Alan, you are right, I already installed a new microphone desk arm, it sounds great, the next video will be much better.

    • @alanfeng99
      @alanfeng99 5 років тому

      Really like you video! Thanks!

    • @graysonorr8172
      @graysonorr8172 5 років тому

      Clean your ears

    • @takacsmark
      @takacsmark  5 років тому +1

      Hi @@graysonorr8172 , thanks for your support, Alan was actually right, I can do better audio than this and I will. So for the next video we shall all clean our ears and listen to the magic :)

  • @Zinzin09
    @Zinzin09 5 років тому

    This is a great tutorial! Thank you for sharing!
    Is there downtime when you force update services to redistribute Tasks?

  • @Zeid_Al-Seryani
    @Zeid_Al-Seryani 4 роки тому

    what a great tutorial, i have been taking an online devops course, and you are explaining way more better,
    if you may i have a question and i would like you see your suggestions, because i did not try this and i searched about it , but from an experianced person, advise is very priceless,
    Question :
    How can i synchronize multiple database containers for their data persistent, i mean all of these containers should have a shared volume of data , am i correct ?
    if you have an advise ( as best practice ) i would really appreciate yours.
    Much Respect.
    Thank you.

    • @relaxyourmind7223
      @relaxyourmind7223 4 роки тому +1

      perhaps what you need is replication, start your research from there

  • @satishtesting19
    @satishtesting19 3 роки тому

    I am using windows 10 and docker-machine is not recongnized as internal or external command. what need to be installed to get docker-machine cmd working in my case ?

  • @truongnguyenxuan8071
    @truongnguyenxuan8071 4 роки тому

    thanks so muchhh

  • @funkiam9214
    @funkiam9214 3 роки тому

    hi, nice video do you have a docker course on udemy?

  • @jakkrits2086
    @jakkrits2086 4 роки тому

    Where can I find your vimrc?

  • @simonhaas1243
    @simonhaas1243 5 років тому

    Thank you, great introduction.
    One thing I don't get: Why would you run multiple replicas of one service on the same node? On different nodes it would load balance over multiple physical machines resulting in more power (supposed the nodes are not VMs on one host). But multiple replicas on the same host does not give you more power, does it?

    • @CMDRunematti
      @CMDRunematti 4 роки тому

      im quite sure what you say is the end goal but for learning this is easier (you wont have to buy more computers for home : D) also compose only works on a single host device but it still has option to run multiple of the same container so there must be a demand for it

    • @blissweb
      @blissweb 2 роки тому

      I too was curious so went searching for the answer which is ... If one of your containers goes down it will get restarted which could take seconds to minutes. During this restart period you still have another 1 or 2 replicas serving responses. But .. as you say, if this is a swarm, it should go to a replica on another host. I guess if the container does a blocking kind of long running action, multiple replicas would help also if routed correctly.

  • @tamilselvan8343
    @tamilselvan8343 2 роки тому

    Could you please share the yaml location in github?

  • @Raj-si5yz
    @Raj-si5yz 5 років тому

    Hi Adreas,I have created nginx image using stack.I want to add one file in image using stack.Using config and volume we can add file in image.Can you give other method to add file in container using stack

    • @takacsmark
      @takacsmark  5 років тому

      Hi Ankit, have a look at my Dockerfile videos, those videos get you started with your custom images.

    • @Raj-si5yz
      @Raj-si5yz 5 років тому

      Thanx for reply.I seen video.I have created file using volume in stack.But I am asking different way to create file inside container without volume

  • @hafizabdullah7488
    @hafizabdullah7488 5 років тому

    Hi.. Love the video. I want to follow the steps in the video but I'm stuck at creating the docker machine. The console stuck at "Waiting for SSH to be available". I've tried running the command as Admin and also tried running it on Git Bash but it did not help. I'm using Docker Desktop for Windows and Hyper-V. Can someone help me?

    • @takacsmark
      @takacsmark  5 років тому

      Hi, I have not met this issue, so I cannot advise from experience. I found this on Stackoverflow stackoverflow.com/questions/40391389/docker-stuck-on-waiting-for-ssh-to-be-available, have you already tried this?

    • @hafizabdullah7488
      @hafizabdullah7488 5 років тому

      @@takacsmark yup.. still the same problem..

    • @takacsmark
      @takacsmark  5 років тому

      I can't solve the specific problem, I'm afraid, but I can help you proceed with the training :) Just go to labs.play-with-docker.com/ and start up two machines and you're ready set up your Swarm. Hope this helps.

    • @hafizabdullah7488
      @hafizabdullah7488 5 років тому

      @@takacsmark thanks! I have another question. I can use labels in the constraints but can I use it in the environment (in docker-compose.yml) as well?

  • @arig2519
    @arig2519 4 роки тому

    I ran the command as you mentioned:
    docker stack deploy -c docker-compose.yml nodeapp
    I got the error:
    yaml: line 5: found character that cannot start any token
    So I checked in my docker-compose.yml file which is the same as yours:
    version: '3'
    services:
    web:
    build: .
    image: takacsmark/swarm-example:1.0
    ports:
    - 80:3000
    networks:
    - mynet
    db:
    image: mongo:4.0.3
    networks:
    - mynet
    networks:
    mynet:
    In my current folder, I only have Dockerfile, docker-compose.yml & server.js files
    So any suggestion on this error?

    • @arig2519
      @arig2519 4 роки тому

      I installed the dpcker-compose and also gave permissions but now when I run the docker-compose build, I get this error:
      ERROR: yaml.scanner.ScannerError: while scanning for the next token
      found character '\t' that cannot start any token
      in "./../docker-compose.yml", line 5, column 1

    • @takacsmark
      @takacsmark  4 роки тому +1

      Hi Arijit, it seems that your line starts with a tab. Please make sure that you use a text editor that reliably uses spaces at the beginning of the line. You can set any popular code editor to use spaces. I think visual studio code is an easy and popular option.

    • @arig2519
      @arig2519 4 роки тому

      @@takacsmark Thank you! I fixed that. I had used tabs. I fixed it by using spaces.

  • @bentaybijamal2299
    @bentaybijamal2299 4 роки тому

    docker-compose push(ERROR: denied: requested access to the resource is denied)
    docker stack deploy nodeapp -c docker-compose.yml( Error : this node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again
    don't work for me in Step : Set up a cluster with multiple hosts

    • @bentaybijamal2299
      @bentaybijamal2299 4 роки тому

      the problem was : i must execute all my command in Root priviliege

  • @ChazBword
    @ChazBword 4 роки тому

    1:25 in and already thumb'd.

  • @salishsath530
    @salishsath530 8 днів тому

    Thanks for the good explanation, docker-machine (ua-cam.com/video/3-7gZS4ePak/v-deo.html) is deprecated so how can we use the same

  • @BrazucaNY
    @BrazucaNY 4 роки тому

    Brother buy a microphone to make your channel better I love the channel but your audio can improve :) Thank you for aall the videos.

  • @herantd
    @herantd 4 роки тому

    Yet another guide which does not work on windows...