Hello all,
I'd like to contribute the method that ultimately worked for me re: configuring NFS (and also NIS) under FC16. I can't claim that it is the best way - but hopefully it will solve some problems for an admin who is having difficulty.
I. NFS Setup and Configuration
[complete these steps on server and on nodes]
In part, I used these guides for reference:
http://fedoraproject.org/wiki/Admini...uide_Draft/NFS
http://www.server-world.info/en/note?os=Fedora_16&p=nfs
Initial Load of NFS
yum install -y nfs-utils system-config-nfs
Set Up Domain Name
In /etc/idmapd.conf edit the line which requires the domain name:
Domain = localdomain
II. NFS Setup and Configuration
[server steps]
Export Home Directories
Open the file for editing:
vi /etc/exports
Then place the following text in /etc/exports (The * allows for mymachinesrv, mymachine1, mymachine2, etc):
/home mymachine*(rw,sync)
Run These Commands:
systemctl start rpcbind.service
systemctl start nfs-server.service
systemctl start nfs-lock.service
systemctl start nfs-idmap.service
systemctl enable rpcbind.service
systemctl enable nfs-server.service
systemctl enable nfs-lock.service
systemctl enable nfs-idmap.service
Mount the Filesystem
Issue the following commands:
mkdir /NFS4exports
mkdir /NFS4exports/home
Append the following to /etc/fstab:
# BIND Mounting The Filesystem
/home /NFS4exports/home none bind 0 0
(Use tabs in the above line, except for a space between the zeros.)
Then issue the following:
mount -a -t none
Append these lines to /etc/exports:
/NFS4exports mymachine*(rw,insecure,sync,wdelay,no_subtree_chec k,no_root_squash,fsid=0)
/NFS4exports/home mymachine*(rw,insecure,sync,wdelay,no_subtree_chec k,nohide,no_root_squash)
Reboot might be necessary.
III. NFS Setup and Configuration
[node steps – wait until NFS server configuration is complete]
Comment out this line in /etc/fstab like so:
# UUID=77186543-da7b-47d3-8b96-969a19f1ffa9 /home ext4 defaults 1 2
systemctl start rpcbind.service
systemctl start nfs-lock.service
systemctl start nfs-idmap.service
systemctl start netfs.service
systemctl enable rpcbind.service
systemctl enable nfs-lock.service
systemctl enable nfs-idmap.service
systemctl enable netfs.service
Issue these commands as a test to ensure that mounting is working:
mount -t nfs mymachinesrv:/home /home
df –h
this command’s output should include something similar to the following:
mymachinesrv:/home/ 93G 1.6G 87G 2% /home
Add this line to the end of the /etc/fstab file to automount when the node boots:
mymachinesrv:/home /home nfs defaults 0 0
(Use tabs in the above line, except for a space between the zeros.)
NFS testing (server must be booted up):
rpcinfo –p mymachinesrv
showmount –e mymachinesrv
Test: Go to the /home directory and see if your nonuser directory (ie testuser) is present. If it is, NFS configuration is successful. You cannot cd into this directory, even from root. Only the user (ie testuser) can enter this directory. This can be more fully tested only after NIS is installed.
IF YOU ARE NOT GOING TO BE USING NIS YOU CAN STOP HERE
IV. NIS Setup and Configuration
[server-only steps]
Issue this command to load the packages you need for the NIS server:
yum –y install ypserv rpcbind
type at the prompt:
domainname nismymachinesrv
ypdomainname nismymachinesrv
systemctl enable ypserv.service
systemctl start ypserv.service
rpcinfo -u mymachinesrv ypserv
should now show:
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
want to add more NIS servers? – run the following command even if you aren’t going to add any more:
/usr/lib64/yp/ypinit –m
Enter these commands at the terminal (ensure these services are started and will start at boot time):
yum install ypbind
systemctl enable ypbind.service
systemctl start ypbind.service
systemctl enable yppasswdd.service
systemctl start yppasswdd.service
systemctl enable ypxfrd.service
systemctl start ypxfrd.service
TEST: You can check that these services are running with this command:
systemctl --no-pager list-units --all | grep .service
Cron Setup (so nis table is made every 5 min)
crontab –e
enter the following to run it every five minutes:
*/5 * * * * cd /var/yp/; make
Also you must run the following to enable crontab:
systemctl start crond.service
systemctl enable crond.service
NOTES on CRONTAB:
http://www.adminschoice.com/crontab-quick-reference
V. NIS Setup and Configuration
[node-only steps]
verify:
rpcinfo –u mymachinesrv ypbind
should now show:
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting
Load portmap and ypbind:
yum install portmap
yum install ypbind
Set ypbind to begin and automatically load on boot:
systemctl enable ypbind.service
systemctl start ypbind.service
TEST: You can check that these services are running with this command:
systemctl --no-pager list-units --all | grep .service