Difference between revisions of "Docker/C3/Docker-Swarm/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "<div style="margin-left:1.27cm;margin-right:0cm;"></div> {| border="1" |- || '''Visual Cue''' || '''Narration''' |- |- style="border:1pt solid #000000;padding-top:0cm;padding-...")
 
 
Line 1: Line 1:
<div style="margin-left:1.27cm;margin-right:0cm;"></div>
+
 
 
{| border="1"
 
{| border="1"
 
|-
 
|-
Line 5: Line 5:
 
|| '''Narration'''
 
|| '''Narration'''
 
|-
 
|-
|- style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.206cm;padding-right:0.191cm;"
+
 
|| Show slide:  
 
|| Show slide:  
  
<div style="color:#000000;">'''Title Slide'''</div>
+
'''Title Slide'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Hello and welcome to the '''Spoken Tutorial '''on “'''Docker Swarm'''”.
+
||Hello and welcome to the '''Spoken Tutorial '''on “'''Docker Swarm'''”.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''Learning Objectives'''</div>
+
'''Learning Objectives'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">In this tutorial, we will learn about</div>
+
||In this tutorial, we will learn about
  
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">'''Docker Swarm'''</div>
+
* '''Docker Swarm'''
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">Sharing files using '''Network File System'''</div>
+
* Sharing files using '''Network File System'''
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''System Requirements'''</div>
+
'''System Requirements'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">To record this tutorial, I am using </div>
+
||To record this tutorial, I am using  
  
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">'''Ubuntu Linux OS version 22.04''' and</div>
+
* '''Ubuntu Linux OS version 22.04''' and
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">'''Docker version 27.0.2'''</div>
+
* '''Docker version 27.0.2'''
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''Pre-requisites'''</div>
+
'''Pre-requisites'''
  
<div style="color:#000000;">'''https://spoken-tutorial.org/'''</div>
+
'''https://spoken-tutorial.org/'''
  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">To follow this tutorial, </div>
+
||To follow this tutorial,  
  
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">You must have basic knowledge of using Linux terminal</div>
+
* You must have basic knowledge of using Linux terminal
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">For pre-requisite Linux tutorials, please visit this website''' '''</div>
+
* For pre-requisite Linux tutorials, please visit this website.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Slide:</div>
+
||Slide:
  
<div style="color:#000000;">'''Docker-machine installation'''</div>
+
'''Docker-machine installation'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;margin-left:0cm;margin-right:0cm;">'''Docker-machine installation'''</div>
+
||'''Docker-machine installation'''
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">Refer to the Additional Reading material of this tutorial.</div>
+
* Refer to the Additional Reading material of this tutorial.
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">Follow the steps given in the document to install docker-machine.</div>
+
* Follow the steps given in the document to install docker-machine.
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">Docker-machine installation is required to proceed further.</div>
+
* Docker-machine installation is required to proceed further.
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">Docker-machine simplifies setting up and managing Docker Swarm.</div>
+
* Docker-machine simplifies setting up and managing Docker Swarm.
  
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''Docker Swarm '''</div>
+
'''Docker Swarm '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">'''Docker Swarm''' is a '''container orchestration''' tool. </div>
+
||'''Docker Swarm''' is a '''container orchestration''' tool.  
  
<div style="color:#000000;">It allows you to manage a '''cluster''' of '''Docker nodes''' as a single system. </div>
+
It allows you to manage a '''cluster''' of '''Docker nodes''' as a single system.  
  
<div style="color:#000000;">It provides tools to deploy, manage, and '''scale''' '''containerized''' applications.</div>
+
It provides tools to deploy, manage, and '''scale''' '''containerized''' applications.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Let us see the execution of it.
+
||Let us see the execution of it.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Open '''terminal'''  
+
|| Open '''terminal'''  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Open the '''terminal.'''</div>
+
||Open the '''terminal.'''
  
<div style="color:#000000;">First let us''' '''create a Docker '''swarm''' cluster.</div>
+
First let us''' '''create a Docker '''swarm''' cluster.
  
<div style="color:#000000;">Type '''docker swarm init '''and press enter.</div>
+
Type '''docker swarm init '''and press Enter.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight '''Swarm initialised''' row
+
|| Highlight '''Swarm initialised''' row
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">We can see that the '''swarm '''is initialised and made the current '''node '''as '''manager'''.</div>
+
||We can see that the '''swarm '''is initialised and made the current '''node '''as '''manager'''.
  
<div style="color:#000000;">'''Managers '''manage the '''swarm '''cluster.</div>
+
'''Managers '''manage the '''swarm '''cluster.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight''' To add a worker''' section
+
|| Highlight''' To add a worker''' section
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">It gives us the '''swarm''' '''join''' command to add '''worker nodes''' to the '''swarm'''.</div>
+
||It gives us the '''swarm''' '''join''' command to add '''worker nodes''' to the '''swarm'''.
<div style="color:#000000;">It has '''token id''' and '''manager IP''' as parameters.</div>
+
  
<div style="color:#000000;">The values may be different for you according to system configuration.</div>
+
It has '''token id''' and '''manager IP''' as parameters.
  
<div style="color:#000000;">Now copy the command. </div>
+
The values may be different for you according to system configuration.
  
<div style="color:#000000;">We can use this while joining the swarm.</div>
+
Now copy the command.
 +
 
 +
We can use this while joining the swarm.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">First let us create a '''worker node'''.</div>
+
||First let us create a '''worker node'''.
  
<div style="color:#000000;">Workers run containers and execute</div>
+
Workers run containers and execute
  
<div style="color:#000000;">tasks assigned by managers.</div>
+
tasks assigned by managers.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker run -d --privileged --name '''
+
|| Type '''docker run -d --privileged --name '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Enter the command as shown.</div>
+
||Enter the command as shown.
  
<div style="color:#000000;">The '''docker run''' command creates a '''Docker-in-Docker''' worker '''container'''.</div>
+
The '''docker run''' command creates a '''Docker-in-Docker''' worker '''container'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | '''docker dind image''' is pulled and downloaded in our local system.
+
||'''docker dind image''' is pulled and downloaded in our local system.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker exec -it worker '''and paste  
+
|| Type '''docker exec -it worker '''and paste  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Now we will join the '''worker node '''to the '''swarm '''cluster.</div>
+
||Now we will join the '''worker node '''to the '''swarm '''cluster.
  
<div style="color:#000000;">Type the command as shown and paste the copied command and press '''Enter'''.</div>
+
Type the command as shown and paste the copied command and press '''Enter'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see a message that our '''worker node''' have joined the '''swarm'''.
+
||We can see a message that our '''worker node''' have joined the '''swarm'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker node ls '''and press '''Enter'''
+
|| Type '''docker node ls '''and press '''Enter'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Now let us see the list of all the '''nodes''' in the '''swarm'''.</div>
+
||Now let us see the list of all the '''nodes''' in the '''swarm'''.
  
<div style="color:#000000;">Type '''docker node ls '''and press '''Enter'''.</div>
+
Type '''docker node ls '''and press '''Enter'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">We can see two '''nodes'''. </div>
+
||We can see two '''nodes'''.  
  
<div style="color:#000000;">One is the leader i.e '''manager '''and other is the '''worker node '''which we created now.</div>
+
One is the leader i.e '''manager '''and other is the '''worker node '''which we created now.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Now let us see how to deploy '''services''' in a '''swarm cluster''' through an example'''.'''
+
||Now let us see how to deploy '''services''' in a '''swarm cluster''' through an example'''.'''
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">In the terminal, enter the command as shown.</div>
+
||In the terminal, enter the command as shown.
  
<div style="color:#000000;">It creates the '''myExample''' '''service''' using the '''stuser1/node-express''' '''image'''.</div>
+
It creates the '''myExample''' '''service''' using the '''stuser1/node-express''' '''image'''.
  
<div style="color:#000000;">'''Services''' are tasks that run '''containerized''' applications.</div>
+
'''Services''' are tasks that run '''containerized''' applications.
  
<div style="color:#000000;">We will use the previously created image '''stuser1'''/'''node-express''' for this example.</div>
+
We will use the previously created image '''stuser1'''/'''node-express''' for this example.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight '''--publish 3000:3000'''
+
|| Highlight '''--publish 3000:3000'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">It maps''' port '''3000 of the '''container '''to '''port '''3000 on the '''host'''.</div>
+
||It maps''' port '''3000 of the '''container '''to '''port '''3000 on the '''host'''.
  
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Press '''Enter'''
+
|| Press '''Enter'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Now press '''Enter'''.
+
||Now press '''Enter'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | The output confirms the '''service''' has deployed successfully.
+
||The output confirms the '''service''' has deployed successfully.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker service ls''' and press '''Enter'''
+
|| Type '''docker service ls''' and press '''Enter'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Let us verify by retrieving the list of '''services'''.</div>
+
||Let us verify by retrieving the list of '''services'''.
  
<div style="color:#000000;">Enter the''' '''command as shown.</div>
+
Enter the command as shown.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight '''myExample''' row.
+
|| Highlight '''myExample''' row.
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">We can see our '''service myExample''' in the list.</div>
+
||We can see our '''service myExample''' in the list.
  
<div style="color:#000000;">Here replicas indicate the number of tasks in the service.</div>
+
Here replicas indicate the number of tasks in the service.
  
<div style="color:#000000;">For now we only have 1 task running.</div>
+
For now we only have 1 task running.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Let us see how to update the '''service'''.
+
||Let us see how to update the '''service'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Type the command as shown.</div>
+
||Type the command as shown.
  
<div style="color:#000000;">The '''docker service update''' command changes the''' image''' used by the '''service'''.</div>
+
The '''docker service update''' command changes the''' image''' used by the '''service'''.
  
<div style="color:#000000;">Here, we’re switching to the '''nginx''' image which may not be present in the local system.It will automatically pull the '''nginx''' image from Docker Hub and use it.</div>
+
Here, we’re switching to the '''nginx''' image which may not be present in the local system.
  
<div style="color:#000000;">Press '''Enter'''.</div>
+
 
 +
It will automatically pull the '''nginx''' image from Docker Hub and use it.
 +
 
 +
Press '''Enter'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see that the '''service '''is updated successfully.
+
||We can see that the '''service '''is updated successfully.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker service ls '''
+
|| Type '''docker service ls '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Enter the command as shown to get the '''services '''list.
+
||Enter the command as shown to get the '''services '''list.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight '''myExample''' row
+
|| Highlight '''myExample''' row
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see that the '''image '''is updated to '''nginx'''.
+
||We can see that the '''image '''is updated to '''nginx'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker service rollback myExample '''
+
|| Type '''docker service rollback myExample '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | To roll back to the previous '''image''', enter the command as shown.
+
||To roll back to the previous '''image''', enter the command as shown.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see that the rollback is completed.
+
||We can see that the rollback is completed.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker service ls '''and press '''Enter'''
+
|| Type '''docker service ls '''and press '''Enter'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Now verify by using '''docker service ls''' command.
+
||Now verify by using '''docker service ls''' command.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see that the '''image '''is updated back to '''stuser1/node-express'''.
+
||We can see that the '''image '''is updated back to '''stuser1/node-express'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Now let us see how to '''scale''' the '''service'''.
+
||Now let us see how to '''scale''' the '''service'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Type '''docker service scale myExample=2''' </div>
+
||Type '''docker service scale myExample=2'''  
 +
 
 +
||Enter the command as shown.
 +
 
 +
This command adjusts '''myExample '''to run 2 replicas.
  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Enter the command as shown.</div>
+
This means there will be two instances of '''myExample '''running in the '''Swarm'''.
  
<div style="color:#000000;">This command adjusts '''myExample '''to run 2 replicas.</div>
 
  
<div style="color:#000000;">This means there will be two instances of '''myExample '''running in the '''Swarm'''.</div>
+
It will be useful when we need backup or replicated tasks.
<div style="color:#000000;">It will be useful when we need backup or replicated tasks.</div>
+
  
<div style="color:#000000;">It will take some time for the system to find the '''image '''and use it.</div>
+
It will take some time for the system to find the '''image '''and use it.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see that now our service myExample has successfully converged to running 2 tasks.
+
||We can see that now our service myExample has successfully converged to running 2 tasks.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | To scale down, just decrease the number of replicas in the previous command.
+
||To scale down, just decrease the number of replicas in the previous command.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker service ps myExample '''
+
|| Type '''docker service ps myExample '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | To get the history of the service, enter the command as shown.
+
||To get the history of the service, enter the command as shown.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the '''running processes'''
+
|| Highlight the '''running processes'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">We can see that 2 '''processes''' are running.</div>
+
||We can see that 2 '''processes''' are running.
  
<div style="color:#000000;">The '''processes''' that are shown as '''shutdown '''are previously executed.</div>
+
The '''processes''' that are shown as '''shutdown '''are previously executed.
  
<div style="color:#000000;">'''Rejected processes '''are system glitches while searching for images.</div>
+
'''Rejected processes '''are system glitches while searching for images.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker service rm myExample '''
+
|| Type '''docker service rm myExample '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | To remove the '''service''', enter the command as shown.
+
||To remove the '''service''', enter the command as shown.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker service ls '''
+
|| Type '''docker service ls '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Again we will get the list to verify.</div>
+
||Again we will get the list to verify.
  
<div style="color:#000000;">We can see our '''service myExample''' is removed from the list.</div>
+
We can see our '''service myExample''' is removed from the list.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Now let us see how to share files using '''NFS'''.
+
||Now let us see how to share files using '''NFS'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide: </div>
+
||Show Slide:  
  
<div style="color:#000000;">'''Share files using NFS'''</div>
+
'''Share files using NFS'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">'''Network File System (NFS) '''allows file sharing between '''nodes '''in a '''Swarm '''setup.</div>
+
||'''Network File System (NFS) '''allows file sharing between '''nodes '''in a '''Swarm '''setup.
  
<div style="color:#000000;">This setup provides shared, persistent storage for distributed applications.</div>
+
This setup provides shared, persistent storage for distributed applications.
  
<div style="color:#000000;">'''NFS '''is ideal for storing files needed by multiple services or replicas.</div>
+
'''NFS '''is ideal for storing files needed by multiple services or replicas.
  
<div style="color:#000000;">It ensures data consistency and simplifies data management across '''nodes'''.</div>
+
It ensures data consistency and simplifies data management across '''nodes'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Let us see the execution of it.
+
||Let us see the execution of it.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''mkdir -p /srv/nfs/sharefiles '''
+
|| Type '''mkdir -p /srv/nfs/sharefiles '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">First we will create a '''directory '''for files’ storage.</div>
+
||First we will create a '''directory '''for files’ storage.
  
<div style="color:#000000;">Type the command as shown.</div>
+
Type the command as shown.
  
<div style="color:#000000;">The '''-p''' '''flag '''ensures all required parent '''directories '''are created if it is not there.</div>
+
The '''-p''' '''flag '''ensures all required parent '''directories '''are created if it is not there.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Next we will change the ownership.</div>
+
||Next we will change the ownership.
  
<div style="color:#000000;">Type the command as shown.</div>
+
Type the command as shown.
  
<div style="color:#000000;">This command changes ownership to '''nobody '''user and '''nogroup'''.</div>
+
This command changes ownership to '''nobody '''user and '''nogroup'''.
  
<div style="color:#000000;">Enter the password if prompted.</div>
+
Enter the password if prompted.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''sudo chmod 777 /srv/nfs/sharefiles'''  
+
|| Type '''sudo chmod 777 /srv/nfs/sharefiles'''  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Type the command to give read, write and execute permissions to all users.</div>
+
||Type the command to give read, write and execute permissions to all users.
  
<div style="color:#000000;">This makes the '''directory '''accessible to every user across '''nodes'''.</div>
+
This makes the '''directory '''accessible to every user across '''nodes'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''sudo apt-get install -y nfs-kernel-server'''  
+
|| Type '''sudo apt-get install -y nfs-kernel-server'''  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Then we need to install an '''nfs-kernel-server''' for '''NFS '''support on the '''manager'''.</div>
+
||Then we need to install an '''nfs-kernel-server''' for '''NFS '''support on the '''manager'''.
  
<div style="color:#000000;">For that, enter the command as shown.</div>
+
For that, enter the command as shown.
  
<div style="color:#000000;">The '''-y''' option automatically confirms the installation prompt.</div>
+
The '''-y''' option automatically confirms the installation prompt.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''sudo nano /etc/exports'''  
+
|| Type '''sudo nano /etc/exports'''  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Then enter the command as shown.</div>
+
||Then enter the command as shown.
  
<div style="color:#000000;">This opens the '''exports '''file to define '''directories '''for sharing.</div>
+
This opens the '''exports '''file to define '''directories '''for sharing.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">We’ll add our '''directory '''to the file for '''NFS '''access using this command.</div>
+
||We’ll add our '''directory '''to the file for '''NFS '''access using this command.
  
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight '''rw'''
+
|| Highlight '''rw'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | '''rw''' shares the '''directory '''with read and write access.
+
||'''rw''' shares the '''directory '''with read and write access.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight '''sync'''
+
|| Highlight '''sync'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | '''sync '''ensures data consistency.
+
||'''sync '''ensures data consistency.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Then save by pressing '''Ctrl+S '''and exit by pressing '''Ctrl+X'''.
+
||Then save by pressing '''Ctrl+S '''and exit by pressing '''Ctrl+X'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''sudo exportfs -a'''  
+
|| Type '''sudo exportfs -a'''  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Then enter the command as shown.</div>
+
||Then enter the command as shown.
  
<div style="color:#000000;">This shares all '''directories '''in the '''exports '''file for '''NFS '''access.</div>
+
This shares all '''directories '''in the '''exports '''file for '''NFS '''access.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Then we shall restart the '''NFS '''server to apply new configuration settings.</div>
+
||Then we shall restart the '''NFS '''server to apply new configuration settings.
  
<div style="color:#000000;">For that enter the command as shown.</div>
+
For that enter the command as shown.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Let us open an interactive '''shell '''in the '''worker container.'''</div>
+
||Let us open an interactive '''shell '''in the '''worker container.'''
<div style="color:#000000;">Enter the command as shown.</div>
+
Enter the command as shown.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''apk add --no-cache nfs-utils '''
+
|| Type '''apk add --no-cache nfs-utils '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">In the interactive '''shell''', type the command as shown.</div>
+
||In the interactive '''shell''', type the command as shown.
  
<div style="color:#000000;">This instals '''NFS '''utilities, which enable '''NFS client functionality'''.</div>
+
This instals '''NFS '''utilities, which enable '''NFS client functionality'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''mkdir -p /mnt/nfs/sharefiles'''  
+
|| Type '''mkdir -p /mnt/nfs/sharefiles'''  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Let us create a local '''directory '''on the '''worker '''for mounting '''NFS share'''.</div>
+
||Let us create a local '''directory '''on the '''worker '''for mounting '''NFS share'''.
  
<div style="color:#000000;">Enter the command as shown.</div>
+
Enter the command as shown.
  
<div style="color:#000000;">The''' -p flag''' ensures that all necessary parent '''directories '''are created.</div>
+
The''' -p flag''' ensures that all necessary parent '''directories '''are created.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Then type the command as shown.</div>
+
||Then type the command as shown.
<div style="color:#000000;">This '''mounts '''the manager’s '''NFS directory '''to the '''worker’s '''local '''directory'''.</div>
+
 
 +
This '''mounts '''the manager’s '''NFS directory '''to the '''worker’s '''local '''directory'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight '''10.0.2.15'''
+
|| Highlight '''10.0.2.15'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">This is the '''manager node’s IP '''address.</div>
+
||This is the '''manager node’s IP '''address.
  
<div style="color:#000000;">Replace it with your '''manager node’s IP '''address.</div>
+
Replace it with your '''manager node’s IP '''address.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight '''nolock'''
+
|| Highlight '''nolock'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | '''nolock '''option disables file locking for simpler setup in basic configurations.
+
||'''nolock '''option disables file locking for simpler setup in basic configurations.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Press '''Enter'''
+
|
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |
+
|| Type '''df -h | grep nfs''' and press '''Enter'''
 +
||To verify the '''mount''', enter the command as shown.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''df -h | grep nfs''' and press '''Enter'''
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | To verify the '''mount''', enter the command as shown.
+
||We get details of '''mounted filesystems''', filtered for our '''NFS mount'''.
|-
+
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">We get details of '''mounted filesystems''', filtered for our '''NFS mount'''.</div>
+
  
<div style="color:#000000;">We can see our mounted '''sharefiles'''.</div>
+
We can see our mounted '''sharefiles'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''exit''' and press '''Enter'''
+
|| Type '''exit''' and press '''Enter'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | To go back to the manager''' node''', enter the '''exit '''command.
+
||To go back to the manager''' node''', enter the '''exit '''command.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Only narration
+
|| Only narration
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Now we have set up the basic configurations for file sharing in the worker node.</div>
+
||Now we have set up the basic configurations for file sharing in the worker node.
  
<div style="color:#000000;">Let us create a file '''testfile dot txt''' for sharing purposes in the manager node.</div>
+
Let us create a file '''testfile dot txt''' for sharing purposes in the manager node.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Enter the command as shown.</div>
+
||Enter the command as shown.
  
<div style="color:#000000;">This creates a testfile''' '''in the shared directory with the given text in it.</div>
+
This creates a testfile in the shared directory with the given text in it.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker exec -it worker sh '''
+
|| Type '''docker exec -it worker sh '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Again let us open an interactive '''shell '''in the '''worker node '''with this command.
+
||Again let us open an interactive '''shell '''in the '''worker node '''with this command.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" |  
+
||  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Enter the command as shown.</div>
+
||Enter the command as shown.
  
<div style="color:#000000;">This reads the file from the '''worker node '''to verify shared file access of the '''manager node'''.</div>
+
This reads the file from the '''worker node '''to verify shared file access of the '''manager node'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see the text from the '''testfile''' indicating successful sharing of files.
+
||We can see the text from the '''testfile''' indicating successful sharing of files.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker swarm leave'''  
+
|| Type '''docker swarm leave'''  
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | To leave the '''swarm '''cluster, type''' docker swarm leave''' and press enter.
+
||To leave the '''swarm '''cluster, type''' docker swarm leave''' and press Enter.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see that the '''worker node '''has left the '''swarm'''.
+
||We can see that the '''worker node '''has left the '''swarm'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''exit''' and press '''Enter'''
+
|| Type '''exit''' and press '''Enter'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | To go back to the '''manager node''', enter the '''exit '''command.
+
||To go back to the '''manager node''', enter the '''exit '''command.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Type '''docker swarm leave --force '''
+
|| Type '''docker swarm leave --force '''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">To exit the '''swarm '''cluster from the '''manager node''', enter the command as shown.</div>
+
||To exit the '''swarm '''cluster from the '''manager node''', enter the command as shown.
  
<div style="color:#000000;">Here we are extending the '''swarm leave '''command with '''hyphen hyphen force'''.</div>
+
Here we are extending the '''swarm leave '''command with '''hyphen hyphen force'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | Highlight the output
+
|| Highlight the output
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | We can see that the '''manager node '''has left the '''swarm'''.
+
||We can see that the '''manager node '''has left the '''swarm'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''Summary'''</div>
+
'''Summary'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">This brings us to the end of this tutorial. Let us summarise.</div>
+
||This brings us to the end of this tutorial. Let us summarise.
  
<div style="color:#000000;">In this tutorial, we have learnt about</div>
+
In this tutorial, we have learnt about
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">'''Docker Swarm''' </div>
+
* '''Docker Swarm'''  
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">Sharing files using '''Network File System'''</div>
+
* Sharing files using '''Network File System'''
  
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide: </div>
+
||Show Slide:  
  
<div style="color:#000000;">'''Assignment'''</div>
+
'''Assignment'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">As an assignment, please do the following</div>
+
||As an assignment, please do the following
* <div style="color:#000000;margin-left:1.27cm;margin-right:0cm;">Scale '''myExample '''to 5 replicas</div>
+
* Scale '''myExample '''to 5 replicas
  
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''Assignment Observation'''</div>
+
'''Assignment Observation'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | '''myExample '''is upscaled to 5 replicas.
+
||'''myExample '''is upscaled to 5 replicas.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide: </div>
+
||Show Slide:  
  
<div style="color:#000000;">'''About Spoken Tutorial project'''</div>
+
'''About Spoken Tutorial project'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">The video at the following link summarises the '''Spoken Tutorial''' project.</div>
+
||The video at the following link summarises the '''Spoken Tutorial''' project.
  
<div style="color:#000000;">Please download and watch it.</div>
+
Please download and watch it.
 
|-
 
|-
| style="background-color:#ffffff;border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''Spoken Tutorial Workshops'''</div>
+
'''Spoken Tutorial Workshops'''
  
| style="border-top:0.5pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.079cm;padding-right:0.191cm;" | <div style="color:#000000;"><span style="background-color:#ffffff;">The </span><span style="background-color:#ffffff;">'''Spoken Tutorial Project'''</span><span style="background-color:#ffffff;"> team conducts workshops and gives certificates.</span></div>
+
||The '''Spoken Tutorial Project''' team conducts workshops and gives certificates.
  
<div style="color:#000000;">For more details, please write to us.</div>
+
For more details, please write to us.
 
|-
 
|-
| style="background-color:#ffffff;border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''Answers for THIS Spoken Tutorial'''</div>
+
'''Answers for THIS Spoken Tutorial'''
| style="background-color:#ffffff;border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.191cm;color:#000000;" | Please post your timed queries in this forum.
+
|| Please post your timed queries in this forum.
 
|-
 
|-
| style="background-color:#ffffff;border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.095cm;padding-right:0.191cm;" | <div style="color:#000000;">Show Slide:</div>
+
||Show Slide:
  
<div style="color:#000000;">'''FOSSEE Forum'''</div>
+
'''FOSSEE Forum'''
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.199cm;padding-right:0.191cm;color:#000000;" | <span style="background-color:#ffffff;">For any general or technical questions on </span><span style="background-color:#ffffff;">'''Docker'''</span><span style="background-color:#ffffff;">, visit the</span><span style="background-color:#ffffff;">''' FOSSEE forum'''</span><span style="background-color:#ffffff;"> and post your question.</span>
+
| | For any general or technical questions on '''Docker''', visit the''' FOSSEE forum''' and post your question.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Show slide:</div>
+
||Show slide:
  
<div style="color:#000000;">'''Acknowledgement'''</div>
+
'''Acknowledgement'''
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;color:#000000;" | '''Spoken Tutorial '''Project''' '''was established by the''' Ministry of Education''',''' Government of India'''.
+
||'''Spoken Tutorial '''Project''' '''was established by the''' Ministry of Education''',''' Government of India'''.
 
|-
 
|-
| style="border-top:0.5pt solid #000000;border-bottom:0.5pt solid #000000;border-left:0.5pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;">Slide: </div>
+
||Slide:  
 +
 
 +
'''Thank you'''
  
<div style="color:#000000;">'''Thank you'''</div>
 
  
<div style="color:#000000;"></div>
+
||This is '''Pranjal Mahajan, '''a '''FOSSEE''' Semester Long Intern 2024, '''IIT Bombay''' signing off
| style="border:0.5pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.092cm;padding-right:0.191cm;" | <div style="color:#000000;"><span style="background-color:#ffffff;">This is </span><span style="background-color:#ffffff;">'''Pranjal Mahajan, '''</span><span style="background-color:#ffffff;">a </span><span style="background-color:#ffffff;">'''FOSSEE'''</span><span style="background-color:#ffffff;"> Semester Long Intern 2024, </span><span style="background-color:#ffffff;">'''IIT Bombay'''</span><span style="background-color:#ffffff;"> signing off</span></div>
+
Thanks for joining.
<div style="color:#000000;">Thanks for joining.</div>
+
 
|-
 
|-
 
|}
 
|}
<div style="color:#000000;"></div>
 

Latest revision as of 16:12, 7 February 2025

Visual Cue Narration
Show slide:

Title Slide

Hello and welcome to the Spoken Tutorial on “Docker Swarm”.
Show Slide:

Learning Objectives

In this tutorial, we will learn about
  • Docker Swarm
  • Sharing files using Network File System
Show Slide:

System Requirements

To record this tutorial, I am using
  • Ubuntu Linux OS version 22.04 and
  • Docker version 27.0.2
Show Slide:

Pre-requisites

https://spoken-tutorial.org/

To follow this tutorial,
  • You must have basic knowledge of using Linux terminal
  • For pre-requisite Linux tutorials, please visit this website.
Slide:

Docker-machine installation

Docker-machine installation
  • Refer to the Additional Reading material of this tutorial.
  • Follow the steps given in the document to install docker-machine.
  • Docker-machine installation is required to proceed further.
  • Docker-machine simplifies setting up and managing Docker Swarm.
Show Slide:

Docker Swarm

Docker Swarm is a container orchestration tool.

It allows you to manage a cluster of Docker nodes as a single system.

It provides tools to deploy, manage, and scale containerized applications.

Only narration Let us see the execution of it.
Open terminal Open the terminal.

First let us create a Docker swarm cluster.

Type docker swarm init and press Enter.

Highlight Swarm initialised row We can see that the swarm is initialised and made the current node as manager.

Managers manage the swarm cluster.

Highlight To add a worker section It gives us the swarm join command to add worker nodes to the swarm.

It has token id and manager IP as parameters.

The values may be different for you according to system configuration.

Now copy the command.

We can use this while joining the swarm.

Only narration First let us create a worker node.

Workers run containers and execute

tasks assigned by managers.

Type docker run -d --privileged --name Enter the command as shown.

The docker run command creates a Docker-in-Docker worker container.

Highlight the output docker dind image is pulled and downloaded in our local system.
Type docker exec -it worker and paste Now we will join the worker node to the swarm cluster.

Type the command as shown and paste the copied command and press Enter.

Highlight the output We can see a message that our worker node have joined the swarm.
Type docker node ls and press Enter Now let us see the list of all the nodes in the swarm.

Type docker node ls and press Enter.

Highlight the output We can see two nodes.

One is the leader i.e manager and other is the worker node which we created now.

Only narration Now let us see how to deploy services in a swarm cluster through an example.
In the terminal, enter the command as shown.

It creates the myExample service using the stuser1/node-express image.

Services are tasks that run containerized applications.

We will use the previously created image stuser1/node-express for this example.

Highlight --publish 3000:3000 It maps port 3000 of the container to port 3000 on the host.
Press Enter Now press Enter.
Highlight the output The output confirms the service has deployed successfully.
Type docker service ls and press Enter Let us verify by retrieving the list of services.

Enter the command as shown.

Highlight myExample row. We can see our service myExample in the list.

Here replicas indicate the number of tasks in the service.

For now we only have 1 task running.

Only narration Let us see how to update the service.
Type the command as shown.

The docker service update command changes the image used by the service.

Here, we’re switching to the nginx image which may not be present in the local system.


It will automatically pull the nginx image from Docker Hub and use it.

Press Enter.

Highlight the output We can see that the service is updated successfully.
Type docker service ls Enter the command as shown to get the services list.
Highlight myExample row We can see that the image is updated to nginx.
Type docker service rollback myExample To roll back to the previous image, enter the command as shown.
Highlight the output We can see that the rollback is completed.
Type docker service ls and press Enter Now verify by using docker service ls command.
Highlight the output We can see that the image is updated back to stuser1/node-express.
Only narration Now let us see how to scale the service.
Type docker service scale myExample=2 Enter the command as shown.

This command adjusts myExample to run 2 replicas.

This means there will be two instances of myExample running in the Swarm.


It will be useful when we need backup or replicated tasks.

It will take some time for the system to find the image and use it.

Highlight the output We can see that now our service myExample has successfully converged to running 2 tasks.
Only narration To scale down, just decrease the number of replicas in the previous command.
Type docker service ps myExample To get the history of the service, enter the command as shown.
Highlight the running processes We can see that 2 processes are running.

The processes that are shown as shutdown are previously executed.

Rejected processes are system glitches while searching for images.

Type docker service rm myExample To remove the service, enter the command as shown.
Type docker service ls Again we will get the list to verify.

We can see our service myExample is removed from the list.

Only narration Now let us see how to share files using NFS.
Show Slide:

Share files using NFS

Network File System (NFS) allows file sharing between nodes in a Swarm setup.

This setup provides shared, persistent storage for distributed applications.

NFS is ideal for storing files needed by multiple services or replicas.

It ensures data consistency and simplifies data management across nodes.

Only narration Let us see the execution of it.
Type mkdir -p /srv/nfs/sharefiles First we will create a directory for files’ storage.

Type the command as shown.

The -p flag ensures all required parent directories are created if it is not there.

Next we will change the ownership.

Type the command as shown.

This command changes ownership to nobody user and nogroup.

Enter the password if prompted.

Type sudo chmod 777 /srv/nfs/sharefiles Type the command to give read, write and execute permissions to all users.

This makes the directory accessible to every user across nodes.

Type sudo apt-get install -y nfs-kernel-server Then we need to install an nfs-kernel-server for NFS support on the manager.

For that, enter the command as shown.

The -y option automatically confirms the installation prompt.

Type sudo nano /etc/exports Then enter the command as shown.

This opens the exports file to define directories for sharing.

We’ll add our directory to the file for NFS access using this command.
Highlight rw rw shares the directory with read and write access.
Highlight sync sync ensures data consistency.
Only narration Then save by pressing Ctrl+S and exit by pressing Ctrl+X.
Type sudo exportfs -a Then enter the command as shown.

This shares all directories in the exports file for NFS access.

Then we shall restart the NFS server to apply new configuration settings.

For that enter the command as shown.

Let us open an interactive shell in the worker container.

Enter the command as shown.

Type apk add --no-cache nfs-utils In the interactive shell, type the command as shown.

This instals NFS utilities, which enable NFS client functionality.

Type mkdir -p /mnt/nfs/sharefiles Let us create a local directory on the worker for mounting NFS share.

Enter the command as shown.

The -p flag ensures that all necessary parent directories are created.

Then type the command as shown.

This mounts the manager’s NFS directory to the worker’s local directory.

Highlight 10.0.2.15 This is the manager node’s IP address.

Replace it with your manager node’s IP address.

Highlight nolock nolock option disables file locking for simpler setup in basic configurations.
Type df -h | grep nfs and press Enter To verify the mount, enter the command as shown.
Highlight the output We get details of mounted filesystems, filtered for our NFS mount.

We can see our mounted sharefiles.

Type exit and press Enter To go back to the manager node, enter the exit command.
Only narration Now we have set up the basic configurations for file sharing in the worker node.

Let us create a file testfile dot txt for sharing purposes in the manager node.

Enter the command as shown.

This creates a testfile in the shared directory with the given text in it.

Type docker exec -it worker sh Again let us open an interactive shell in the worker node with this command.
Enter the command as shown.

This reads the file from the worker node to verify shared file access of the manager node.

Highlight the output We can see the text from the testfile indicating successful sharing of files.
Type docker swarm leave To leave the swarm cluster, type docker swarm leave and press Enter.
Highlight the output We can see that the worker node has left the swarm.
Type exit and press Enter To go back to the manager node, enter the exit command.
Type docker swarm leave --force To exit the swarm cluster from the manager node, enter the command as shown.

Here we are extending the swarm leave command with hyphen hyphen force.

Highlight the output We can see that the manager node has left the swarm.
Show Slide:

Summary

This brings us to the end of this tutorial. Let us summarise.

In this tutorial, we have learnt about

  • Docker Swarm
  • Sharing files using Network File System
Show Slide:

Assignment

As an assignment, please do the following
  • Scale myExample to 5 replicas
Show Slide:

Assignment Observation

myExample is upscaled to 5 replicas.
Show Slide:

About Spoken Tutorial project

The video at the following link summarises the Spoken Tutorial project.

Please download and watch it.

Show Slide:

Spoken Tutorial Workshops

The Spoken Tutorial Project team conducts workshops and gives certificates.

For more details, please write to us.

Show Slide:

Answers for THIS Spoken Tutorial

Please post your timed queries in this forum.
Show Slide:

FOSSEE Forum

For any general or technical questions on Docker, visit the FOSSEE forum and post your question.
Show slide:

Acknowledgement

Spoken Tutorial Project was established by the Ministry of Education, Government of India.
Slide:

Thank you


This is Pranjal Mahajan, a FOSSEE Semester Long Intern 2024, IIT Bombay signing off

Thanks for joining.

Contributors and Content Editors

Madhurig, Nirmala Venkat