Centos NFS Setup

pre-requirements

  • Centos 7

install nfs

1
yum -y install rpcbind nfs-utils

create nfs_data

1
2
3
4
mkdir -p /mnt/data/nfs_data
# example for mysql
mkdir -p /mnt/data/nfs_data/mysql
chown -R systemd-bus-proxy:ssh_keys /mnt/data/nfs_data/mysql

modify /etc/exports

1
/mnt/data/nfs_data/mysql 192.168.3.0/24(rw,no_root_squash)

reload nfs config

1
exportfs -r

start services

1
2
3
4
systemctl start rpcbind
systemctl start nfs
systemctl enable rpcbind
systemctl enable nfs

check script

1
2
rpcinfo -p
showmount -e