How To Manage Docker Swarm NFS Volume // Docker Volume Explained // Docker Swarm Volume Sharing
#dockervolume, #dockerswarm, #nfs Hello Friends, Welcome back to my channel. Today we are going to see about how you manage volume in a docker swarm. In my last tutorial we have seen how to setup NFS share, we are going to make use of that nfs share to add as volume in docker swarm. Check out my tutorial listed below for how to setup NFS server and create your share. We are going to make use of the NFS share and will create docker volume in each nodes which are mapped to local driver and connected to NFS shared location. There are few pre-requisites which you need to install on docker nodes and also make changes in /etc/exports file to give access to the docker nodes to the share. ----------------------------------------------------------------------------------------- How to Setup NFS share: https://youtu.be/DJtvQYicALM --------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- How to setup Docker Swarm: https://youtu.be/wLZ4j730bDo ------------------------------------------------------------------------------------- Pre-requisite Update the file with your node ip address vi /etc/exports /root/nfs 192.168.1xx.xxx(rw,sync,no_root_squash,no_subtree_check) /root/nfs 192.168.1xx.1xx(rw,sync,no_root_squash,no_subtree_check) /root/nfs 192.168.xxx.1xx(rw,sync,no_root_squash,no_subtree_check) exportfs -a ------------------------------------------------------------------------------------------------- On Docker nodes install nfs utils yum install nfs-utils ---------------------------------------------------------------------------------------------------- Add firewall exceptions firewall-cmd --permanent --zone=public --add-service=nfs firewall-cmd --reload --------------------------------------------------------------------------------------------------- Create NFS docker volume on all nodes docker volume create --driver local --name db_data --opt type=nfs4 --opt device=:/root/nfs/data --opt o=addr=192.168.xxx.1xx,rw,nolock --------------------------------------------------------------------------------------------------- Create Docker service with NFS volume docker service create --name db --network mynetwork --mount type=volume,source=db_data,target=/var/lib/postgresql/data -e POSTGRES_PASSWORD=password --replicas 2 postgres:9.4 ------------------------------------------------------------------------------------------------ Follow me @: https://www.instagram.com/thetips4you https://www.youtube.com/channel/UCoOq-DtESvayx5yJE5H6-qQ https://www.facebook.com/thetipsforyou http://www.thetips4you.com ---------------------------------------------------------------------------------------------------- ================================================== Music credit: "Royalty Free Music from Bensound"
#dockervolume, #dockerswarm, #nfs Hello Friends, Welcome back to my channel. Today we are going to see about how you manage volume in a docker swarm. In my last tutorial we have seen how to setup NFS share, we are going to make use of that nfs share to add as volume in docker swarm. Check out my tutorial listed below for how to setup NFS server and create your share. We are going to make use of the NFS share and will create docker volume in each nodes which are mapped to local driver and connected to NFS shared location. There are few pre-requisites which you need to install on docker nodes and also make changes in /etc/exports file to give access to the docker nodes to the share. ----------------------------------------------------------------------------------------- How to Setup NFS share: https://youtu.be/DJtvQYicALM --------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- How to setup Docker Swarm: https://youtu.be/wLZ4j730bDo ------------------------------------------------------------------------------------- Pre-requisite Update the file with your node ip address vi /etc/exports /root/nfs 192.168.1xx.xxx(rw,sync,no_root_squash,no_subtree_check) /root/nfs 192.168.1xx.1xx(rw,sync,no_root_squash,no_subtree_check) /root/nfs 192.168.xxx.1xx(rw,sync,no_root_squash,no_subtree_check) exportfs -a ------------------------------------------------------------------------------------------------- On Docker nodes install nfs utils yum install nfs-utils ---------------------------------------------------------------------------------------------------- Add firewall exceptions firewall-cmd --permanent --zone=public --add-service=nfs firewall-cmd --reload --------------------------------------------------------------------------------------------------- Create NFS docker volume on all nodes docker volume create --driver local --name db_data --opt type=nfs4 --opt device=:/root/nfs/data --opt o=addr=192.168.xxx.1xx,rw,nolock --------------------------------------------------------------------------------------------------- Create Docker service with NFS volume docker service create --name db --network mynetwork --mount type=volume,source=db_data,target=/var/lib/postgresql/data -e POSTGRES_PASSWORD=password --replicas 2 postgres:9.4 ------------------------------------------------------------------------------------------------ Follow me @: https://www.instagram.com/thetips4you https://www.youtube.com/channel/UCoOq-DtESvayx5yJE5H6-qQ https://www.facebook.com/thetipsforyou http://www.thetips4you.com ---------------------------------------------------------------------------------------------------- ================================================== Music credit: "Royalty Free Music from Bensound"