Editing NFS server inside container

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 7: Line 7:
 
== Kernel NFS server ==
 
== Kernel NFS server ==
  
Kernel-space NFS server is supported by latest RHEL5 and RHEL6 based kernels and since vzctl-3.0.24.
+
Kernel-space NFS server is supported by latest RHEL5 and RHEL6 based kernels and since vzctl-3.0.24. NB! Currently only NFSv3 is supported - no NFSv4 support yet.
  
NB! Currently only NFSv3 is supported - no NFSv4 support yet.
 
 
=== Prerequisites ===
 
 
In order to run an NFS server inside a container, make sure:
 
In order to run an NFS server inside a container, make sure:
* '''nfsd kernel module is loaded on host system before starting a container'''
+
* nfsd kernel module is loaded on host system before starting a container
* '''nfsd feature for a container is turned on''' (<code>vzctl set $CTID --feature nfsd:on --save</code>)
+
* nfsd feature for a container is turned on (<code>vzctl set $CTID --feature nfsd:on --save</code>)
 
 
=== Setup ===
 
* Make sure that rpcbind service is started before nfs service:
 
: <code>chkconfig rpcbind on && service rpcbind start</code>
 
* Disable NFSv4 and nfsd module loading warnings in /etc/sysconfig/nfs by uncommenting the following lines:
 
MOUNTD_NFS_V3="yes"
 
RPCNFSDARGS="-N 4"
 
NFSD_MODULE="noload"
 
* Start NFS service:
 
: <code>chkconfig nfs on && service nfs start</code>
 
 
 
=== Troubleshooting ===
 
 
 
Make sure that:
 
# you have enabled nfsd feature for your container
 
# nfsd kernel module is loaded before you started the container
 
 
 
==== rpcbind ====
 
 
 
If you see this:
 
<pre>
 
# service nfs start
 
...
 
Starting NFS services:                                    [  OK  ]
 
Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
 
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
 
</pre>
 
  
It means you haven't started rpcbind service. Solution:
+
Setup NFSv3 inside RHEL6/CentOS6/SL6 container:
<pre>chkconfig rpcbind on && service rpcbind start</pre>
+
* Make sure that rpcbind service is started before nfs service: <pre>chkconfig rpcbind on && service rpcbind start</pre>
 
+
* Disable NFSv4 and nfsd module loading warnings in /etc/sysconfig/nfs:
==== nfsd module ====
+
<pre>vi /etc/sysconfig/nfs
If you see this:
+
--- MODIFY ---
<pre>
+
MOUNTD_NFS_V3="yes"
# service nfs start
+
RPCNFSDARGS="-N 4"
....
+
NFSD_MODULE="noload"
Starting NFS daemon: rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).
+
--- MODIFY ---
Please try, as root, 'mount -t nfsd nfsd /proc/fs/nfsd' and then restart rpc.nfsd to correct the problem
 
                                                          [FAILED]
 
# mount -t nfsd nfsd /proc/fs/nfsd
 
mount: unknown filesystem type 'nfsd'
 
 
</pre>
 
</pre>
 
+
* Start NFS service:<pre>chkconfig nfs on && service nfs start</pre>
It means you haven't loaded nfsd kernel module on host before starting container.
 
 
 
==== warnings ====
 
 
 
If you see this:
 
<pre>
 
# /etc/init.d/nfs start
 
FATAL: Module nfsd not found.
 
FATAL: Error running install command for nfsd
 
...
 
</pre>
 
 
 
It is actually harmless, you don't need to do anything. In case you want this to go away, uncomment (or add) the line
 
 
 
NFSD_MODULE="noload"
 
 
 
in <code>/etc/sysconfig/nfs</code> file.
 
  
 
== User-space NFS server ==
 
== User-space NFS server ==

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: