Lab 3.2: Mount Volume with NFS Server

1. Membuat Direktori di node0

mkdir -p /data/nfs-storage01/

2. Create the NFS Server with docker

docker run -itd --privileged \
  --restart unless-stopped \
  -e SHARED_DIRECTORY=/data \
  -v /data/nfs-storage01:/data \
  -p 2049:2049 \
  itsthenetwork/nfs-server-alpine:12

3. Mounting volume di client nfs

Mounting nfs server di node2

ssh podX-doc2 -l student
sudo apt update
sudo apt install nfs-client -y
sudo mount -v -o vers=4,loud podX-doc1:/ /mnt
atau
sudo mount -v -t nfs4 podX-doc1:/ /mnt
df -h

touch /mnt/file1.txt
touch /mnt/file2.txt
exit

4. Verifikasi di node1. [screenshot-3-2-4]

ls /data/nfs-storage01/

5. Lepaskan montingan nfs di node2

umount /mnt

6. Hapus semua container

Daftar Materi