Skip to content

Instantly share code, notes, and snippets.

@linuxkathirvel
Last active April 16, 2019 12:21
Show Gist options
  • Save linuxkathirvel/e7751063faf5bfb6215cbf5e27003ba7 to your computer and use it in GitHub Desktop.
Save linuxkathirvel/e7751063faf5bfb6215cbf5e27003ba7 to your computer and use it in GitHub Desktop.
NFS installation in CentOS7 for JIRA and Confluence Data Center

NFS installation in CentOS7 for JIRA and Confluence Data Center

This NFS setup was tested in CentOS 7

Server Side

Install NFS

#!/bin/bash

sudo yum install nfs-utils libnfsidmap

sudo systemctl enable rpcbind
sudo systemctl enable nfs-server

sudo systemctl start rpcbind
sudo systemctl start nfs-server

sudo systemctl start rpc-statd
sudo systemctl start nfs-idmapd

Create NFS Share

sudo mkdir /data/sharedhomejira
sudo chmod 777 /data/sharedhomejira/

Add NFS mount in exports file

sudo vi /etc/exports

/data/sharedhomejira 192.168.12.7(rw,sync,no_root_squash)
# 192.168.12.7 is allowed IP to access NFS mount

# Exports all directories listed in /etc/exports
sudo exportfs -a
# Displays a list of shares files and export options on a server
sudo exportfs -v
# Reexport all directories after modifying /etc/exports
sudo exportfs -r

Client Side

Install NFS client packages

sudo yum install nfs-utils libnfsidmap
sudo systemctl enable rpcbind
sudo systemctl start rpcbind

Mount NFS shares on clients

# To list NFS mounts
sudo showmount -e 192.168.12.5
# 192.168.12.5 will be the IP of NFS server
# create a mount point to mount 
sudo mkdir /sharedjira
sudo mount 192.168.12.5:/data/sharedhomejira /sharedjira
# To check nfs is mounted or not
sudo mount | grep nfs
df -hT
# Create test file
touch /sharedjira/test

Automount NFS Shares

sudo vim /etc/fstab
192.168.12.5:/data/sharedhomejira/ /sharedjira nfs rw,sync,hard,intr 0 0

Source is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment