[Lxc-users] Fwd: Running an NFS server within LXC

Istvan Balazs balazs.istvan at gmail.com
Mon Apr 15 19:14:46 UTC 2013


Sorry, forgot to share the idea with the community, maybe it could be
helpful for other LXC users too.

---------- Forwarded message ----------
From: Istvan Balazs <balazs.istvan at gmail.com>
Date: 2013/4/15
Subject: Re: [Lxc-users] Running an NFS server within LXC
To: Papp Tamas <tompos at martos.bme.hu>


Dear Tamás!

Theres is a workaround solution for this.

We are using NFS mounts inside KVM guests. But can be achieved with native
hosts too.

1. The KVM guest is the one who mounts the NFS mount folder , let's say:
mount -t nfs 10.10.10.122:/nfsmount /nfsdata

2. Bind mount the NFS mounted partion into an existing custom LXC folder:
mount --bind /nfsdata /var/lib/lxc/lxccontainer/lxcnfsmount.

If the NFS base mount is /lxcnfsmount, and You would like to mount the
subfolder "test1" to an other folder from the LXC container(/var/www/web1)
You can do like this :

3.fstab entry content of the LXC container:(/var/lib/lxc/lxcontainer/fstab)
 /var/lib/lxc/lxccontainer/rootfs/lxcnfsmount/test1
/var/lib/lxc/lxccontainer/rootfs/var/ww/web1 none
rw,bind,noatime,nodiratime,nosuid,nodev,noexec     0 0

In this way you will be able to use the NFS mount in read-write mode,
through the host system's (physical, or host KVM) NFS network stack.

Best Regards

I hope it helps. If not please let me know, I will be happy to give you a
helping hand.

Balázs István
CyberManufactory Kft.
CEO
E-mail: info at ipfort.com
Tel     : 00 36 70 210 0505



2013/4/15 Papp Tamas <tompos at martos.bme.hu>

> On 04/15/2013 12:34 PM, David Parks wrote:
> >
> > It's really a no-go on LXC huh? That's too bad. Glusterfs seems like
> > overkill, I just want a remote mount for a small, but critical, backup
> > process. But it must be mounted, I'd rather not clutter up the host OS,
> as
> > the whole point of LXC was to keep configuration specific to various
> > application-components segregated in their own containers.
>
> Yes, because the current "official" nfs linux implementation is kernel
> based. Userspace alternatives
> can be used. One is unfs3 (or something like that), but it didn't work for
> me last time I tested.
> Another one is glusterfs, it works great. It's overkill, but actually it's
> not so complicated as it
> looks for the first check. From this aspect it's an nfs server, that has
> other capabilities.
>
> tamas
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130415/741f6ac3/attachment.html>


More information about the lxc-users mailing list