Answer for KodeKloud Question - NFS Troubleshooting


The Nautilus production support team was trying to fix issues with their storage server. The storage server has a shared directory /data, which is mounted on all app servers at location /var/www/html so that whatever data they store on the storage server under /data can be shared among all app servers. Somehow NFS server is broken and having some issues.

Identify the root cause of the issue and fix it to make sure sharing works fine among all app servers and storage server

Sample ANSWER:

--------------------

ON Storage Server 

--------------------

#check the /etc/eports file should be as below 

    vi /etc/export

/data 172.16.238.10(rw,sync,no_subtree_check,no_root_squash,fsid=0)

/data 172.16.238.11(rw,sync,no_subtree_check,no_root_squash,fsid=0)

/data 172.16.238.12(rw,sync,no_subtree_check,no_root_squash,fsid=0)


check above details in export file( in my case mount directory  is "/data" your might different )

#run below command 

exportfs -a 

#check nfs-server and rpcbind status (if not, start both )

        systemctl status nfs-server

systemctl status rpcbind

# Start commands

systemctl start nfs-server

systemctl start rpcbind

# these commands for start the service autumatically when server boot 

systemctl enable nfs-server

systemctl enable rpcbind

#run below to check 

    showmount

-----------------------------

Now on all the APP servers 

------------------------------

#check nfs-server and rpcbind status (if not, start both )

# now do the mount part 

mount -t nfs ststor01:/data /var/www/html

# verify our mount by using any of below commands

        mount | grep nfs

df -h 

( do the above steps for all the app servers ) 

----------------

TESTING 

---------------

go to the storage server ( navigate your shared directory on the storage server)

cd /data 

#create a text file 

touch text.txt 

#Now go to each APP server and check inside the /var/www/html

text.txt should be presented if the NFS mount is worked correctly 


Note: ** The question copied for learning purposes.**
Commands are correct but based on your question the server and user name, mount directory might differ so please do check.

No comments:

Post a Comment

Featured Post

Answer for Kodekloud DEVOPS Questions - Init container in Kubernetes

Question: 1. Create a Deployment named as ic-deploy-devops. 2. Configure spec as replicas should be 1 , labels app should be ic-devops , ...