Install and Configure NFS Server

Ticker

6/recent/ticker-posts

Install and Configure NFS Server

Question:  For our infrastructure in Stratos Datacenter, we need to serve our website code from a common/shared location that can be shared among all app nodes. To solve this, we came up with a solution to use the NFS (Network File System) server where we can store the data and mount the share among our app nodes. The dedicated NFS server will be our storage server. To accomplish this task, perform the following steps:

Install required NFS packages on storage server.

Configure storage server to act as an NFS server.

Make a NFS share /app on storage server.

Install and configure NFS client packages on all app nodes and configure them to act as NFS client.

Mount /app directory on all app nodes at /var/www/app directory (Create the directories if don't exist).

Start and enable required services.

There is an /tmp/index.html file on jump host. Copy this file on NFS server (storage server) under /app and make sure it gets replicated to all app servers in mounted location.


Please Note:-  Perform the below commands based on your question server,  user name & other details that might differ. So please read the task carefully before executing it. 

All the Best 👍


Solution:  

1. At first login on storage server  ssh natasha@ststor01

2. Switch to  root user : sudo su -

3. Install  NFS Packages  & configure  Up the NFS Server:  

      yum install -y nfs-utils  nfs-utils-lib  


4.  Edit the  /etc/exportfs  file and correct the changes as per below

    Note : - Mountpoint would differ so please check your task refer below video 

5. Start service: systemctl enable nfs-server && systemctl start nfs-server

6. After  changes  exportfs -av

7. To scp (copy) index.html from Jump server need to 

    Install openssh package  on storage server


8. To scp (copy) index.html from Jump server  on storage server & move to /webdata


Now log in to  the APP Server and mount the file system

1. At first login to one of the App server  ssh tony@stapp01

2.  Switch to  root user : sudo su -

3.  Install  NFS Packages  & configure  Up the NFS Server:  

      yum install -y nfs-utils  nfs-utils-lib 

4.  Start service: systemctl enable nfs-server && systemctl start nfs-server

5.  validate the export list  by   showmount -e ststor01

6.  Make directory  & Mount  the filesystem 

       mkdir -p /var/www/web


7.  Mount  the filesystem  as per the task request

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

8. Validate  mount point  mounted successfully as per the task request



Please Note :- I have shown only for stapp01
You have to do this in all app server stapp01,stapp02, stapp03. 

7.  Click on Finish & Confirm to complete the task successfully

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this , 
please go through and share your comments. Like and share the knowledge



Post a Comment

0 Comments

Latest Posts

KodeKloud Kubernetes Security CKS  Lab Challenge 4 |  Audit-policy | Install & configure falco utility | Inspect the API server audit logs and identify the user