-
Notifications
You must be signed in to change notification settings - Fork 80
/
Install and Configure NFS Server.txt
57 lines (39 loc) · 2.46 KB
/
Install and Configure NFS Server.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
For our infrastructure in Stratos Datacenter we have a requirement to serve our website code from a common/shared location that can be shared among all app nodes. For this we came up with a solution to use NFS (Network File System) server that can store the data and we can mount the share among our app nodes. The dedicated NFS server going to be our storage server. To accomplish this task do the following given steps:
1.Install required NFS packages on storage server.
2.Configure storage server to act as an NFS server.
3.Make a NFS share /app on storage server.
4.Install and configure NFS client packages on all app nodes and configure them to act as NFS client.
5.Mount /app directory on all app nodes at /var/www/code directory (Create the directories if don't exist).
6.Start and enable required services.
ON STORAGE SERVER
=================
1 sudo systemctl start nfs
2 sudo yum install nfs-utils nfs-utils-lib -y
3 systemctl start nfs
4 systemcttl enable nfs
5 systemctl enable nfs
6 cd /app/
7 ls
8 cd
9 sudo vi /etc/exports ---- HERE SHARED /web FOLDER WITH CLIENT SERVER
/app 172.16.238.10(rw,sync,no_subtree_check,no_root_squash,fsid=0)
/app 172.16.238.11(rw,sync,no_subtree_check,no_root_squash,fsid=0)
/app 172.16.238.12(rw,sync,no_subtree_check,no_root_squash,fsid=0)
10 systemctl restart nfs
ON ALL APPLICATIONS SERVER (TONY,STEVE,BANNER)(REPEAT SAME STEPS ON ALL APP SERVERS)
====================================================================================
1 sudo yum install nfs-utils nfs-utils-lib -y
2 systemctl start nfs
3 systemctl enable nfs
4 systemctl status nfs
5 sudo showmount -e 172.16.238.15 -- IT SHOWS SHARE DIRECTORY AND IP ADDRESS SHOWS HERE
6 mkdir /var/www
7 mkdir /var/www/data
8 cd /var/www/data/
9 ls
10 sudo mount -t nfs 172.16.238.15:/app /var/www/data ---THAT /app FOLDER DATA WHERE TO STORE IN CLIENT SERVER GIVE PATH HERE(/var/www/data)
11 sudo mount | grep nfs --- IT SHOW WHICH DIRECTORY ON WHICH DIRECTORY
12 sudo vi /etc/fstab
172.16.238.15:/app /var/www/data nfs defaults 0 0
--The above mount command(5) mounted the nfs shared directory on to nfs client temporarily, to mount an NFS directory permanently on your system across the reboots, we need to make an entry in “/etc/fstab“.
13 sudo systemctl restart nfs