Comments (8)
Please try the current master branch for libnfs.
I have added support for nfsport= as well as mountport= arguments.
This allows to bypass portmapper completely and connect directly to the specified port for MOUNT (only usedd in NFSv3) and to connect directly to the NFS port.
Syntax is like this :
./utils/nfs-ls nfs://127.0.0.1/data/sahlberg/fuse?version=4&nfsport=2049
You want to set version=4 since libnfs defaults to version 3.
In version 3, the server needs to listen to at least 2 ports (and 4 ports if you use locking)
while in NFSv4 it is sufficient to use only one single port, most often 2049.
from libnfs-python.
from libnfs-python.
I think it's really close - I'm able to ls
and cat
files. I can also cp
them from the nfs share.
But I can't seem to write to them. Actually writing manages to create the file, but doesn't write the contents.
I'm running:
LD_LIBRARY_PATH=./lib/.libs LD_NFS_DEBUG=9 LD_PRELOAD=./ld_nfs.so cp -f /etc/hosts 'nfs://10.0.1.231//test3?version=4&nfsport=2049'
and I get:
`ld_nfs: __xstat(nfs://10.0.1.231//test1?version=4&nfsport=2049&autoreconnect=-1)
ld_nfs: open(nfs://10.0.1.231//test1?version=4&nfsport=2049&autoreconnect=-1, 0, 0)
ld_nfs: Failed to open nfs file : open call failed with "NFS4: (path /) failed with NFS4ERR_NOENT(-2)"
ld_nfs: __xstat(nfs://10.0.1.231//test1?version=4&nfsport=2049&autoreconnect=-1)
ld_nfs: open(nfs://10.0.1.231//test1?version=4&nfsport=2049&autoreconnect=-1, 0, 0)
ld_nfs: Failed to open nfs file : open call failed with "NFS4: (path /) failed with NFS4ERR_NOENT(-2)"
ld_nfs: open(nfs://10.0.1.231//test1?version=4&nfsport=2049&autoreconnect=-1, c1, 644)
ld_nfs: open(nfs://10.0.1.231//test1?version=4&nfsport=2049&autoreconnect=-1) == 4
ld_nfs: __fxstat(4)
ld_nfs: __fxstat(4) success
ld_nfs: write(fd:4 count:65536)
cp: error writing ‘nfs://10.0.1.231//test1?version=4&nfsport=2049&autoreconnect=-1’: Operation not permitted
cp: failed to extend ‘nfs://10.0.1.231//test1?version=4&nfsport=2049&autoreconnect=-1’: Operation not permitted
ld_nfs: close(4)`
I've experimented with different uid/gid combinations, but I don't think it is that or an insecure mounting issue.
I've traced the error in the code to:
zdr_COMPOUND4args->libnfs_zdr_array
in the following loop:
for (i = 0; i < (int)*size; i++) { if (!proc(zdrs, *arrp + i * elsize)) { return FALSE; } }
Thoughts?
Thanks!
from libnfs-python.
UPDATE:
I can write files up to 3840 bytes.
The first write fails, but creates the file:
[ec2-user]$ LD_LIBRARY_PATH=./lib/.libs LD_PRELOAD=./ld_nfs.so cp <(head -c3840 /dev/random) 'nfs://10.0.XXX.XXX//test?version=4&nfsport=2049'
cp: error writing ‘nfs://10.0.XXX.XXX//test?version=4&nfsport=2049’: Numerical result out of range
cp: failed to extend ‘nfs://10.0.XXX.XXX//test?version=4&nfsport=2049’: Numerical result out of range
[ec2-user]$ ls -l ../mnt
total 4
-rw------- 1 ec2-user ec2-user 0 Apr 9 07:14 test
The second attempt properly writes:
[ec2-user]$ LD_LIBRARY_PATH=./lib/.libs LD_PRELOAD=./ld_nfs.so cp <(head -c3840 /dev/random) 'nfs://10.0.XXX.XXX//test?version=4&nfsport=2049'
[ec2-user libnfs]$ ls -l ../mnt
total 4
-rw------- 1 ec2-user ec2-user 3840 Apr 9 07:14 test
And here is with more than 3840 bytes:
[ec2-user]$ LD_LIBRARY_PATH=./lib/.libs LD_PRELOAD=./ld_nfs.so cp <(head -c3841 /dev/random) 'nfs://10.0.XXX.XXX//test?version=4&nfsport=2049'
cp: error writing ‘nfs://10.0.XXX.XXX//test?version=4&nfsport=2049’: Operation not permitted
cp: failed to extend ‘nfs://10.0.XXX.XXX//test?version=4&nfsport=2049’: Operation not permitted
Perhaps this is a just a problem with the LD_PRELOAD test script. I will verify and comment
from libnfs-python.
Is it possible to pass the nfs version/port to libnfs-python in the context-free mode? (I'm able to get it to work when I create a context).
Using the libnfs-python, I am able to create files >3840 bytes, but I must write less than 3841 bytes for each write.
from libnfs-python.
I came across the issue report as I'm interested in the same use case that zachl123 is - I'd like to be able to mount nfs inside amazon linux 1 - and Lambda. I currently have a workload that requires interacting with a glusterfs share, but have an eye to moving this to AWS where EFS might be used instead of gluster.
We don't currently have nfs-ganesha-gluster installed on our setup, but I will look at configuring that as it should then allow NFSv4 mounting of the gluster volumes.
@zachl123 - I'm interested to see your steps on getting this going.
I've compiled libnfs and checked out this repo, so I have all the required client parts
I suspect that if this could be made to work OK and is well documented that it may become the defacto way to interact with NFS under AWS lambda.
from libnfs-python.
from libnfs-python.
After two years, I'm back looking at this.
For the record the network trace showed nothing. The larger write just never got sent, but I did find where the issue is:
in lib/libnfs-zdr.c, the function libnfs_zdr_bytes checks the size:
if (zdrs->pos + (int)*size > zdrs->size) {
return FALSE;
}
It looks like zdrs->size is always allocated to be 4096 (ZDR_ENCODEBUF_MINSIZE). There is code in lib/pdu.c (rpc_allocate_pdu2) to provide an alloc_hint, but this is called from rpc_allocate_pdu with the alloc_hint hardcoded to 0.
As a POC, I have changed the ZDR_ENCODEBUF_MINSIZE to 1MB and I can now write 1MB blocks. Changing it to anything much larger fails again, but in a different place. Hopefully this points you in the right direction.
Thanks!
from libnfs-python.
Related Issues (20)
- Support nfs_readlink2()
- Support struct timeval parameters to nfs_utimes() and nfs_lutimes() HOT 1
- no timeout with errror nfs addr HOT 1
- Cannot install this library on Mac OS High Sierra HOT 1
- Does this project supports nfs version=4.1? HOT 5
- pip install libnfs report error
- can't open nfs server file ValueError: open failed: Input/output error HOT 1
- Ability to configure nfs blksize
- utils/nfs-ls.py is hanging HOT 1
- NFS.listdir waits indefinitely
- ImportError: libnfs.so.13: cannot open shared object file: No such file or directory HOT 2
- NFS object does not have attribute isdir, isfile ect. HOT 1
- weither close nfs connetion HOT 1
- Didn't found NFS?
- Attribute Error
- Error while compiling and error while "python3 setup.py install" HOT 1
- module hangs forever in nfs.open HOT 2
- symbol not found in flat namespace '_free_nfs_srvr_list'
- fatal error C1083: Cannot open include file: 'nfsc/libnfs.h' - Problem with libnfs installation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libnfs-python.