nfs mount on coreos

3,221 views
Skip to first unread message

Jakub Veverka

unread,
Oct 8, 2014, 11:23:29 AM10/8/14
to coreo...@googlegroups.com
Hi,

I would like to mount nfs share as persistant storage for one of my docker containers.
It could be pre start action, or simillar.

Is it possible though to mount nfs ( preferably autofs ) on CoreOS?

I am getting following error:

 mount <IP>:/vol/dockerregistry /mnt
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

and statd service is also not on system.

I suppose I could do it from within docker container itself. Is it recommended way?

Thanks
Jakub

Alex Polvi

unread,
Oct 8, 2014, 11:25:54 AM10/8/14
to Jakub Veverka, coreos-user
Jakub, we use NFS with vagrant, without an extra container. Not sure the implementation details, but you might be able to reverse engineer it: 


-Alex

--
You received this message because you are subscribed to the Google Groups "CoreOS User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coreos-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jakub Veverka

unread,
Oct 8, 2014, 12:06:14 PM10/8/14
to coreo...@googlegroups.com, veverk...@gmail.com
only thing that comes to my mind is to set mount nfs options as follows:

mount -o nolock,vers=3,udp <IP>:/vol/Dockerregistry /mnt

which works from machine in same vlan, but from coreos node it says:

root@core-01 ~ # mount.nfs -o vers=3,nolock <IP>:/vol/Dockerregistry /mnt/
mount.nfs: Protocol not supported

Jakub Veverka

unread,
Oct 9, 2014, 5:13:11 AM10/9/14
to coreo...@googlegroups.com, veverk...@gmail.com
I've tried to mount nfs share from vagran coreos and it didn't work for me.

I've only uncommented line
config.vm.synced_folder ".", "/home/jveverka/tmp", id: "core", :nfs => true, :mount_options => ['nolock,vers=3,udp']

Before I've enabled nfs-server.service on my Fedora 20.

Can anyone verify that nfs mount works for him from CoreOS in Vagrant?
Mine just remains stuck on
==> core-01: Mounting NFS shared folders...

Anielkis Herrera

unread,
Oct 9, 2014, 9:19:14 AM10/9/14
to Jakub Veverka, coreo...@googlegroups.com
Yes, Jakub, it works for me.. looks like the problem is related to the firewall.. can you check that?
--
_______________________________
        Anielkis Herrera
_______________________________

Jakub Veverka

unread,
Oct 9, 2014, 12:09:48 PM10/9/14
to coreo...@googlegroups.com, veverk...@gmail.com
hmm, probably my fault then.

Can't convince it to work.
Thanks for confirmation that it works.

Don't have time to debug now :(
J

Anielkis Herrera

unread,
Oct 9, 2014, 12:39:05 PM10/9/14
to Jakub Veverka, coreo...@googlegroups.com
ok .. when you have time, I can help you with that.. just tel me

br...@brianclements.net

unread,
Nov 19, 2014, 3:49:27 PM11/19/14
to coreo...@googlegroups.com, veverk...@gmail.com
I had this same issue, the problem for me was that "udp" part. The protocol by default is UDP, so you don't have to specify it. If you wanted tcp, you'd have to specify with "proto=tcp".

I used the following to manually mount nfs from within coreos and it worked for me:

mount -o nolock,vers=4,defaults,bg,timeo=14,intr,retry=1 <IP>:/vol/directory /mnt

Also, regarding stats.d, theres a mention of how to fix that here: http://www.ulabs.uservers.net/howtos/glusterfs-coreos.php It's a glusterfs tutorial but it covers setting up nfs. It's a drop in file you have to create to etc/conf.d/nfs.

Jakub Veverka

unread,
Nov 19, 2014, 3:59:35 PM11/19/14
to br...@brianclements.net, coreo...@googlegroups.com
thanks for tip, but unfortunately this didn't work for me. 
I am running ok against different nfs server though so probably there was something non coreos related. 

Brian Harrington

unread,
Nov 19, 2014, 5:18:30 PM11/19/14
to Jakub Veverka, coreo...@googlegroups.com
Jakub,

Here is a cloud-config I use in testing which embeds a systemd mount unit.  From here, you could make a docker unit with the corresponding "After=" and "Depends=" lines on your mount unit.

--Brian 'redbeard' Harrington
--CoreOS

Brian Harrington

unread,
Nov 19, 2014, 6:06:23 PM11/19/14
to Jakub Veverka, coreo...@googlegroups.com
Sorry folks, forgot the cloud-config as per my previous email:

https://gist.github.com/brianredbeard/e74b55c798ebf83fd646



On 10/08/2014 09:06 AM, Jakub Veverka wrote:

Jakub Veverka

unread,
Nov 20, 2014, 4:11:47 AM11/20/14
to Brian Harrington, coreo...@googlegroups.com
cool, thanks

You received this message because you are subscribed to a topic in the Google Groups "CoreOS User" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/coreos-user/W_6gHZtVa1E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to coreos-user...@googlegroups.com.

Graham Smith

unread,
Feb 24, 2015, 6:09:51 PM2/24/15
to coreo...@googlegroups.com, brian.ha...@coreos.com
I'm also trying and failing to nfs mount from coreos. "mount.nfs: Protocol not supported"

What are the steps to enable this, thanks in advance.

Mike Wilson

unread,
Mar 23, 2015, 5:48:58 PM3/23/15
to coreo...@googlegroups.com, brian.ha...@coreos.com
I use a cloud config mount option as well for my nfs shares. I have a cloud config that looks like this:

#cloud-config
coreos:
  units:
    - name: etcd.service
      command: start
    - name: fleet.service
      command: start
    - name: configs.mount
      content: |
        [Unit]
        After=network.target
        After=local-fs.target
        After=network-online.target

        Requires=network-online.target
        Requires=network.target
        Requires=local-fs.target

        [Mount]
        What=10.0.1.14:/mnt/fileserv/configs
        Where=/configs
        Type=nfs
        Options=rw,hard,async,intr,nolock,rsize=49152,wsize=49152
...

And then in the unit files that need that mount I simply add:

After=configs.mount
Requires=configs.mount

This does require that I put my mounts into the cloud config for each and every machine in my cluster, but I don't have many mounts and this isn't a big deal for me.
Reply all
Reply to author
Forward
0 new messages