Git Product home page Git Product logo

manta-nfs's Introduction

manta-nfs

manta-nfs implements a NFS vers. 3 server that uses Joyent Manta as the backing store. The server implements all NFS functionality, although some OS-level commands, such as chmod, will have no effect since Manta does not support that concept. The server is implemented in node.js and requires v0.10.x.

Overview

The server is a process that runs locally on your laptop, in your zone, or on a standalone system, and services NFS requests. The server then acts as a gateway for those requests back into Manta. Manta objects are cached locally in the machine's file system so that all NFS operations can be supported. Unlike Manta, the server provides the typical POSIX write semantics via its use of the local object cache.

The server cannot run on a system that is already acting as a NFS server since there would be a conflict on the required ports. In this case, the server will detect the existing server and exit.

The server includes a built-in portmapper, but it will also interoperate transparently with the system's portmapper (usually rpcbind) if one is running. The server also includes a built-in mountd and nfsd. There is no lockd provided by the server.

By default, the server only listens on the localhost address and only serves files locally. However, it can be configured to serve files to external hosts.

Because the server caches Manta objects locally, care must be taken when accessing Manta in different ways or from different locations. There is no attempt to be coherent across multiple systems. Given this, you should not run more than one instance of the server for the same Manta user. Likewise, you should not write to the same object using both NFS and the CLI. Reading objects using both NFS and the CLI is obviously fine.

If you write an object using one mechanism (e.g. NFS) and immediately read it using another (e.g. the CLI), you may not see the same data. The server holds an object locally for a period of time before writing it back to Manta. Likewise, if you update an existing object using the CLI, the server might have a stale copy in its cache. In this case you can wait for the server to notice the object has changed, or you can force the server to refresh its cached copy by simply touching the file.

Getting Started

Clone the repo then run npm install within the clone to build all of the dependencies. The 'Configuration' section of this readme describes how to configure the server before you can run it. The 'Usage' section of this readme describes how to start the server and how to perform an NFS mount.

Configuration

At a minimum the server needs the configuration information necessary to connect to a Manta account. If the Manta environment variables are already set up, the server will use those and no other configuration is needed.

In addition to the Manta account information, there are a variety of other configuration options. An example configuration file, showing all possible configuration options, is provided in etc/example.json, but you should not use that file to create your personal configuration. A simpler etc/template.json file is provided as a better starting point for your personal configuration. Each section of the configuration file is optional. The configuration file is specified to the server via the -f option:

node server.js -f etc/myconfig.json

Although most of the sections in etc/example.json should be self-explanatory, here is some additional information.

  • The manta section must be used to specify the required access information for Manta if the environment variables are not set. The configuration information takes precedence over the environment variables if both are set.

  • The database section can be used to configure where and how the server caches local copies of the Manta objects. The location, size of the cache, the time-to-live, writeback delay time, and number of parallel writebacks for the cache can be set in this section.

    The default cache is under /var/tmp/mfsd with a size limit of 5GB of local disk space. The time-to-live is the number of seconds a file will be cached before checking to see if it is stale. The default is twelve hours (43200 seconds). The writeback time is the number of seconds a dirty file will be cached before being written back to Manta. The default is one minute (60 seconds). If files are updated regularly (e.g. log files) then it might make sense to increase the timeout to reduce writeback traffic, but this also increases the window in which data only exists in the local cache. The number of parallel writebacks defaults to 2. That is, if there are multiple dirty files to writeback, two at a time will be written back.

    The cache size is not a hard limit. It is possible for more space to be used than is configured. For example, if an object is larger than the cache size, then if that object is pulled into the cache, the whole object must be downloaded and the space used by the object will be consumed. This would also force all of the other objects out of the cache, since the space used exceeds the size limit. Another example is with dirty files. These cannot be evicted from the cache until they have been uploaded back to Manta, so the cache space used can exceed the size limit until the objects have been completely uploaded.

  • The mount section's address field can be used to specify an address other than localhost for the server to listen on. Using '0.0.0.0' tells the server to listen on all addresses. Both the mountd and nfsd within the server will listen on the given address. Since the server has full access to all of the user's Manta data, it is a good idea to limit foreign host access when listening on the external network. The hosts_allow or hosts_deny sections can be used to restrict access to the given IP addresses. The exports section can also be used to restrict access to the specified portions of the Manta filesystem.

  • The nfs section can be used to set the uid and gid values for 'nobody'. This is useful if NFS clients are running a different OS, which uses different values for 'nobody', as compared to the server (e.g. Darwin vs. Linux). Over NFS all files will appear to be owned by 'nobody' since there is no mechanism to map a Manta username to a local uid on the various clients, but within Manta all files continue to be owned by the user account. The fd-cache section can be used to configure the server's file descriptor cache, although this is normally not necessary.

Usage

When running the server for the first time, you probably want to run it by hand to confirm that the configuration is correct and things are working as expected. Once you know things are working correctly, you may want to set up a service so that the server runs automatically.

The server must be started as root since it needs access to the portmapper's privileged port. Once the server is running, it lowers its uid to 'nobody' to improve security. The sudo or pfexec commands are typically used to run a command as root, depending on which OS you're using.

If you're using the Manta environment variables as the source of your Manta account information and you're using sudo, use the -E option to pass those forward. On some Linux distributions sudo will reset 'HOME' to root's home directory. On those distributions you must also set HOME back to your home directory.

On Darwin or Linux, the server can be run with no config file like:

sudo -E HOME=/home/foo node server.js

On SmartOS, the server can be run like:

pfexec node server.js

To pass in a config file, use the -f option:

sudo node server.js -f etc/myconfig.json

All output logging is done via bunyan. Once started, the server will output an occasional log message, but the -d or -v options can be used to change the bunyan logging level to either 'debug' or 'trace'. Logging at either of these levels is not recommended, except during debugging, since there will be many log entries for each NFS operation. You may want to redirect the output from the server into a file:

sudo node server.js -d -f etc/myconfig.json >log 2>&1

To mount a Manta directory, use the standard NFS client mount command with a Manta path. The user name used here must be the same user as is configured for Manta access. For example, if Manta user 'foo' is configured, then to mount their 'public' directory:

sudo mount 127.0.0.1:/foo/public /mnt

Once you have confirmed that the server works as expected, you can set up a service on your system so that the server runs automatically when the system boots. Setting up a service like this is OS-specific and is discussed in that section for each operating system.

Limitations

There are certain NFS operations that cannot be supported because Manta itself does not support the underlying concept. These are:

  • Changing the owner uid or gid of a file
  • Changing the mtime or atime of a file
  • Changing or setting the mode of a file
  • Creating a file exclusively (O_EXCL - will happen only in the cache)
  • Making devices, sockets or FIFOs
  • Renaming or moving directories
  • Symlinks and hardlinks

OS Specific Considerations

This section discusses any issues that are specific to running the server on a given operating system.

Darwin (OS X)

There is normally no portmapper running on Darwin so the server runs with its built-in portmapper.

The uid/gid for 'nobody' is -2.

Because you cannot rename a directory, creating new folders using Finder is problematic. The new folder will initially be created by Finder with the name untitled folder, but you will not be able to rename it. Instead, you must use a terminal window and the command line to create directories with the correct name.

The svc/launchd/com.joyent.mantanfs.plist file provides an example configuration for launchd(8). If necessary, edit the file and provide the correct paths to 'node', 'server.js' and your configuration file.

Note that this configuration will bring the service up only if an interface other than lo has an IPV4/IPV6 address. However the reverse is not true, and launchd will not bring down the service if the network goes away.

Run the following to load and start the service:

sudo cp svc/launchd/com.joyent.mantanfs.plist /System/Library/LaunchDaemons/
sudo launchctl load /System/Library/LaunchDaemons/com.joyent.mantanfs.plist

Linux (including lx-branded zones)

Some distributions (e.g. Ubuntu or Centos) may not come pre-installed with the /sbin/mount.nfs command which is needed to perform a mount, while others (e.g. Fedora) may be ready to go. On Ubuntu, install the nfs-common package.

apt-get install nfs-common

On Centos, install the nfs-utils package. Depending on the choices described below, you may also need to install the rpcbind package.

yum install nfs-utils
yum install rpcbind

Based on the distribution's package manager and package dependencies, the 'rpcbind' command may have been installed and started. However, due to a mis-design in the Linux rpcbind code, the manta-nfs server will not be able to register with the system's rpcbind. There are two options to work around this:

  • Disable the system's rpcbind and let the server use its built-in portmapper. The method for disabling the system's rpcbind varies depending on the service manager that the system uses. If 'rpcbind' is in a seperate package from '/sbin/mount.nfs', then you could simply uninstall that package. To disable 'rpcbind' on Ubuntu you can run: stop portmap.

  • Run the system's rpcbind in 'insecure' mode using the -i option. The mechanism for specifying customized options for a service varies by distribution and release. The rpcbind configuration file may be named /etc/init/portmap.conf or /etc/sysconfig/rpcbind. For a distribution which uses traditional sysvinit rc files you may need to edit /etc/init.d/rpcbind and explicitly add the option to the invocation of rpcbind in the script.

    Here is an example entry for the /etc/sysconfig/rpcbind file. RPCBIND_ARGS="-i"

If running the manta-nfs server inside an lx-branded zone, the built-in portmapper may not work properly. In this case, the second option above (using the system's rpcbind) must be used.

On Linux the uid/gid for 'nobody' is 65534.

There is no lock manager included in the server, so you must disable locking when you mount. e.g.

mount -o nolock 127.0.0.1:/foo.bar/public /home/foo/mnt

When mounting from inside an lx-branded zone you may need to explicitly specify that you want to use the NFSv3 protocol. e.g.

mount -o nolock,vers=3 127.0.0.1:/foo.bar/public /home/foo/mnt

To setup the server as a service, so that it runs automatically when the system boots, you need to hook into the system's service manager. Linux offers a variety of dfferent service managers, depending upon the distribution and release.

  • rc files

    The traditional Unix rc file mechanism is not really a service manager but it does provide a way to start or stop services when the system is booting or shutting down.

    The svc/rc/mantanfs file is a shell script that will start up the server. Make a copy of this file into /etc/init.d. If necessary, edit the file and provide the correct paths to 'node', 'server.js' and your configuration file.

    Symlink the following names to the 'mantanfs' file:

    ln -s /etc/rc3.d/S90mantanfs -> ../init.d/mantanfs
    ln -s /etc/rc4.d/S90mantanfs -> ../init.d/mantanfs
    ln -s /etc/rc5.d/S90mantanfs -> ../init.d/mantanfs
    ln -s /etc/rc0.d/K90mantanfs -> ../init.d/mantanfs
    ln -s /etc/rc1.d/K90mantanfs -> ../init.d/mantanfs
    ln -s /etc/rc2.d/K90mantanfs -> ../init.d/mantanfs
    ln -s /etc/rc6.d/K90mantanfs -> ../init.d/mantanfs
    

    The script directs the server log to '/var/log/mantanfs.log'.

  • Systemd

    See this wiki for more details on configuring and using systemd. Also see the systemd.unit(5) and systemd.service(5) man pages.

    The svc/systemd/mantanfs.service file provides an example configuration for systemd. Make a copy of this file into /lib/systemd/system. If necessary, edit the file and provide the correct paths to 'node', 'server.js' and your configuration file.

    Run the following to start the service:

    systemctl start mantanfs.service
    

    Since systemd has its own logging, you must use the 'journalctl' command to look at the logs.

    journalctl _SYSTEMD_UNIT=mantanfs.service
    
  • Upstart

    See this cookbook for more details on configuring and using upstart.

    The svc/upstart/mantanfs.conf file provides an example configuration for upstart. Make a copy of this file into /etc/init. If necessary, edit the file and provide the correct paths to 'node', 'server.js' and your configuration file.

    Run the following to start the service:

    initctl start mantanfs
    

    The server log should be available as '/var/log/upstart/mantanfs.log'.

SmartOS

In order to mount from the host, the system's 'rpcbind' must be running. The server's built-in portmapper cannot be used. If the svc is not already enabled, enable it.

svcadm enable network/rpc/bind

If you intend to serve external hosts, you must also ensure that the bind service is configured to allow access. To check this:

svccfg -s bind listprop config/local_only

If this is set to true, you need to change it to false.

svccfg -s bind setprop config/local_only=false
svcadm refresh bind

Due to a mis-design in the SmartOS mount code, mounting will fail on older platforms. If you see the following, you know your mount code is incorrect.

nfs mount: 127.0.0.1: : RPC: Program not registered
nfs mount: retrying: /home/foo.bar/mnt

You will either need to run on a newer platform or you can use this fixed NFS mount command explicitly. e.g.

pfexec ./mount 127.0.0.1:/foo.bar/public /home/foo/mnt

For unmounting, you can use this fixed umount command explicitly.

On SmartOS the uid/gid for 'nobody' is 60001.

The svc/smf/manta-nfs.xml file provides an example configuration for smf(5). If necessary, edit the file and provide the correct paths to 'node', 'server.js' and your configuration file.

Run the following to load and start the service:

svccfg -v import svc/smf/manta-nfs.xml

Windows

Because of the POSIX dependencies in the server, the code does not currently build on Windows. However, the Windows NFS client can be used with a server running on a Unix-based host. Before you can use NFS you may need to set it up on your Windows system. The procedure varies by which version of Windows is in use. See the documentation for your release for the correct procedure to install NFS.

Once NFS is installed, you simply mount from the server as usual. Substitute the server's IP address and the correct user name in the following example:

C:\>mount \\192.168.0.1\foo\public *
Z: is now successfully connected to \\192.168.0.1\foo\public

The command completed successfully.

Windows will assign an unused drive letter for the mount. In this example the drive letter was Z:.

Windows Explorer has the same limitation as Darwin's Finder when creating a new folder. The new folder will initially be created by Explorer with the name New folder, but you will not be able to rename it. Instead, you must use a terminal window and the command line to create directories with the correct name.

manta-nfs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

manta-nfs's Issues

Server doesn't exit on OSX in the presence of an existing NFS server

On my OSX I have an old /etc/exports which was used for some previous work. Every time I reboot I forget that this means the NFS service will auto-start, and when I try to use manta-nfs I get various unexpected errors as it is trying to mount from the system nfsd.

The README suggests that the server should exit in the presence of an existing NFS server, this appears to not be the case in this situation as the server continues to run.

Could use a nicer error message when time is out of sync

When the time is out of sync we get the following style of error from manta-nfs:

[2014-02-15T22:06:56.430Z]  WARN: server.js/RpcServer/10696 on rm (/home/rm/src/manta-nfs/lib/mount.js:102): ensure_manta_directory: info(/rmustacc/) failed (procedure=mnt, xid=1391596490)
   BadRequestError
       at ClientRequest.onResponse (/home/rm/src/manta-nfs/node_modules/manta/node_modules/restify/lib/clients/http_client.js:133:38)
       at ClientRequest.g (events.js:180:16)
       at ClientRequest.EventEmitter.emit (events.js:95:17)
       at HTTPParser.parserOnIncomingClient (http.js:1688:21)
       at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23)
       at CleartextStream.socketOnData (http.js:1583:20)
       at CleartextStream.read [as _read] (tls.js:511:12)
       at CleartextStream.Readable.read (_stream_readable.js:320:10)
       at EncryptedStream.write [as _write] (tls.js:366:25)
       at doWrite (_stream_writable.js:221:10)

However, with an mtool, you get a slightly more informative error message:

[rm@rm ~/src/manta-nfs]$ mls /rmustacc/stor
mls: RequestExpiredError: Date header Sat, 15 Feb 2014 22:19:37 GMT is too old

It'd be great if the bad request could have a bit more information about what was bad so this kind of issue can be root caused faster.

RFE: add encrypt/decrypt option to objects at rest

manta-NFS is a nice abstraction from one storage layer to another. It'd be nice to use this as the in-between point to achieve "encrypted data at rest" in manta.

It'd be even better if the objects were recognizable in manta as manta-nfs-encrypted (possibly by a filename extension or something?) , and if the encryption/decryption method was readable/writable with a normal unix command as well (like with "openssl enc") , so the data is usable from within manta compute jobs or "mlogin" jobs, as long as the keys are passed into the job securely, somehow.

cannot run on nodejs 6.9

E:\nodejs\test\manta-nfs\node_modules\leveldown build fail
and run 'node server.js':

Error: Cannot find module 'E:\nodejs\test\manta-nfs\node_modules\userid\build\Release\userid.node'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (E:\nodejs\test\manta-nfs\node_modules\userid\lib\userid.js:2:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

manta-nfs dies on ChecksumError

See:

[2014-02-24T21:51:35.750Z]  WARN: server.js/MantaFsMantaClient/37193 on jmcbook.local (/Users/jclulow/proj/manta-nfs/node_modules/mantafs/lib/manta.js:120 in onMantaGetError): cache: error downloading /jmc/stor/forklift/30.mov
    ChecksumError: content-md5 expected to be 8clkXbwU793H2KMiaF8m6w==, but was GfIK3hFlJGT4jg6nwjXuMA==
        at IncomingMessage.onEnd (/Users/jclulow/proj/manta-nfs/node_modules/manta/lib/client.js:609:38)
        at IncomingMessage.g (events.js:180:16)
        at IncomingMessage.EventEmitter.emit (events.js:117:20)
        at _stream_readable.js:920:16
        at process._tickDomainCallback (node.js:459:13)

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
ChecksumError: content-md5 expected to be 8clkXbwU793H2KMiaF8m6w==, but was GfIK3hFlJGT4jg6nwjXuMA==
    at IncomingMessage.onEnd (/Users/jclulow/proj/manta-nfs/node_modules/manta/lib/client.js:609:38)
    at IncomingMessage.g (events.js:180:16)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickDomainCallback (node.js:459:13)

Mimic mput file type detection

Currently there is a discrepancy between manta-nfs and mput with regards to what Content-Type is set to. mput attempts file-type detection, manta-nfs appears to just apply a blanket application/octet-stream to everything.

  • manta-nfs mounted under /manta/pkgsrc
$ touch /tmp/test-nfs.html
$ rsync /tmp/test-nfs.html /manta/pkgsrc/public/typetest/
  • local mput
$ touch /tmp/test-mput.html
$ mput -f /tmp/test-mput.html /pkgsrc/public/typetest/
  • output
$ curl -sI http://us-east.manta.joyent.com/pkgsrc/public/typetest/test-nfs.html | grep Content-Type
Content-Type: application/octet-stream
$ curl -sI http://us-east.manta.joyent.com/pkgsrc/public/typetest/test-mput.html | grep Content-Type
Content-Type: text/html

Whilst I can use mchattr to fix files up after rsync, this quickly becomes untenable with large directories, so it would be great if manta-nfs could handle this automatically.

key in ssh-agent

summary

I'm unable to get the server started using the key that is stored in my ssh-agent. I start the server using sudo with the proper options to forward along my environment, but the server still insists I enter a PEM pass phrase.

reproduce

On a terminal I run this

$ sudo -E HOME=/Users/dave node server.js | bunyan
... snipped ...
[2014-02-20T20:23:43.787Z]  INFO: server.js/28536 on bahamas10.local (/Users/dave/dev/manta-nfs/server.js:281 in onRunning): nfsd: listening on: tcp://127.0.0.1:2049

And on another I run this

sudo mount 127.0.0.1:/bahamas10/public /mnt/manta

Upon running that, the first terminal greets me with

Enter PEM pass phrase:

Even though my key is set up in my ssh-agent

information

$ ssh-add -l
2048 cd:57:83:d3:b9:4b:a1:96:92:78:cf:bb:4f:b3:6e:cf /Users/dave/.ssh/id_rsa (RSA)
$ sudo -E HOME=/Users/dave ssh-add -l
2048 cd:57:83:d3:b9:4b:a1:96:92:78:cf:bb:4f:b3:6e:cf /Users/dave/.ssh/id_rsa (RSA)
$ node -v
v0.10.22
$ mls ~~/public
bashrc.html
bill.zip
pastes/

debug output

$ sudo -E HOME=/Users/dave node server.js | bunyan
Password:
[2014-02-20T20:23:43.750Z]  INFO: server.js/28536 on bahamas10.local (/Users/dave/dev/manta-nfs/server.js:389 in main):
    configuration: { manta: 
       { domain: null,
         _events: {},
         _maxListeners: 10,
         log: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            _isSimpleChild: true,
            _level: 30,
            streams: [Object],
            serializers: [Object],
            src: true,
            fields: [Object] },
         client: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            agent: [Object],
            ca: undefined,
            cert: undefined,
            ciphers: undefined,
            connectTimeout: 4000,
            headers: [Object],
            log: [Object],
            key: undefined,
            name: 'restify',
            passphrase: undefined,
            pfx: undefined,
            rejectUnauthorized: true,
            proxy: false,
            retry: [Object],
            signRequest: false,
            socketPath: false,
            url: [Object],
            _keep_alive: true },
         jsonClient: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            agent: [Object],
            ca: undefined,
            cert: undefined,
            ciphers: undefined,
            connectTimeout: 4000,
            headers: [Object],
            log: [Object],
            key: undefined,
            name: 'restify',
            passphrase: undefined,
            pfx: undefined,
            rejectUnauthorized: true,
            proxy: false,
            retry: [Object],
            signRequest: false,
            socketPath: false,
            url: [Object],
            _keep_alive: true,
            gzip: undefined,
            _super: [Object] },
         sign: 
          { [Function: sign]
            algorithm: 'rsa-sha256',
            keyId: 'cd:57:83:d3:b9:4b:a1:96:92:78:cf:bb:4f:b3:6e:cf',
            user: 'bahamas10' },
         user: 'bahamas10',
         _url: 'https://us-east.manta.joyent.com',
         _version: '~1.0',
         signUrl: [Function: signUrl] },
      database: 
       { location: '/var/tmp/mfsdb',
         sizeMB: 5120,
         ttl: 43200,
         wbtime: 60,
         num_par: 2 },
      portmap: 
       { port: 111,
         mappings: { mountd: [Object], nfsd: [Object], portmapd: [Object] },
         log: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            _level: 30,
            streams: [Object],
            serializers: [Object],
            src: true,
            fields: [Object] } },
      mount: 
       { log: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            _level: 30,
            streams: [Object],
            serializers: [Object],
            src: true,
            fields: [Object] },
         manta: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            log: [Object],
            client: [Object],
            jsonClient: [Object],
            sign: [Object],
            user: 'bahamas10',
            _url: 'https://us-east.manta.joyent.com',
            _version: '~1.0',
            signUrl: [Function: signUrl] },
         fs: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            cache: [Object],
            log: [Object],
            manta: [Object],
            _fd: 3,
            _fds: {} } },
      nfs: 
       { uid: -2,
         gid: -2,
         fd_cache: 
          { _max: 10000,
            _lengthCalculator: [Function: naiveLength],
            _allowStale: false,
            _maxAge: 60000,
            _dispose: [Function: cache_close_fd],
            _cache: {},
            _lruList: {},
            _mru: 0,
            _lru: 0,
            _length: 0,
            _itemCount: 0 },
         hosts_allow: undefined,
         hosts_deny: undefined,
         log: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            _level: 30,
            streams: [Object],
            serializers: [Object],
            src: true,
            fields: [Object] },
         manta: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            log: [Object],
            client: [Object],
            jsonClient: [Object],
            sign: [Object],
            user: 'bahamas10',
            _url: 'https://us-east.manta.joyent.com',
            _version: '~1.0',
            signUrl: [Function: signUrl] },
         fs: 
          { domain: null,
            _events: {},
            _maxListeners: 10,
            cache: [Object],
            log: [Object],
            manta: [Object],
            _fd: 3,
            _fds: {} },
         cachepath: '/var/tmp/mfsdb' },
      log: 
       { domain: null,
         _events: {},
         _maxListeners: 10,
         _level: 30,
         streams: [ [Object] ],
         serializers: 
          { err: [Function: err],
            rpc_call: [Function: serialize_rpc_call],
            rpc_reply: [Function: serialize_rpc_reply] },
         src: true,
         fields: { name: 'server.js', hostname: 'bahamas10.local', pid: 28536 } } }
[2014-02-20T20:23:43.786Z]  INFO: server.js/28536 on bahamas10.local (/Users/dave/dev/manta-nfs/server.js:279 in onRunning): mountd: listening on: tcp://127.0.0.1:1892
[2014-02-20T20:23:43.787Z]  INFO: server.js/28536 on bahamas10.local (/Users/dave/dev/manta-nfs/server.js:281 in onRunning): nfsd: listening on: tcp://127.0.0.1:2049
Enter PEM pass phrase:

vim swap file oddness

So, on OS X 10.9, I run vim while in a manta-nfs mounted directory. It seems to get confused about the swap file, every time. The directory that I'm starting vim in is empty to begin with:

$ vim a.txt



E325: ATTENTION
Found a swap file by the name ".a.txt.swp"
          owned by: nobody   dated: Wed Mar 12 23:21:53 2014
         [cannot be read]
While opening file "a.txt"

(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r a.txt"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".a.txt.swp"
    to avoid this message.

Swap file ".a.txt.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

If I press Q, for quit, at this point, and then look in the directory:

$ find . -ls
1701347764        0 drwxr-xr-x    0 nobody           nobody                  0 12 Mar 23:23 .
1979325517        0 -rw-r--r--    1 nobody           nobody                  0 12 Mar 23:23 ./.a.txt.swo
1979325518        0 -rw-r--r--    1 nobody           nobody                  0 12 Mar 23:22 ./.a.txt.swp

Difficulty deleting a directory

This seems like it should work, but it doesn't. I can't delete a directory after I've just removed the last file from it.

Steps:

mkdir what
touch what/file
rm what/file
rmdir what
rmdir: failed to remove `what': Device or resource busy

To workaround this, I can delete the directory after I restart the nfs server and re-mount the directory.

Thanks. Manta-nfs is awesome.

When manta LBs go away, manta-nfs blew up.

We had to fail out an LB in manta temporarily, and I happened to catch this since I had a long-lived keep-alive session going.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Parse Error
    at CleartextStream.socketOnData (http.js:1583:20)
    at CleartextStream.read [as _read] (tls.js:511:12)
    at CleartextStream.Readable.read (_stream_readable.js:320:10)
    at EncryptedStream.write [as _write] (tls.js:366:25)
    at doWrite (_stream_writable.js:221:10)
    at writeOrBuffer (_stream_writable.js:211:5)
    at EncryptedStream.Writable.write (_stream_writable.js:180:11)
    at write (_stream_readable.js:583:24)
    at flow (_stream_readable.js:592:7)
    at Socket.pipeOnReadable (_stream_readable.js:624:5)
    at Socket.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:408:10)

soft link to the mount errors

OS: Centos 6.8 on top of kvm in the Joyent Cloud

mount method: mount -o nolock 127.0.0.1:/[username]/stor /mnt

I can interact with files and directories in the manta-nfs mount, but when I use 'ln -s /mnt /other_dir' and then try to interact with the link, I get an error:

ls: reading directory /other_dir/: Input/output error

Are soft links to the manta-nfs mounts possible or is there just possibly something wrong with the system config?

connect EACCES with ensure_manta_directory

When I attempt to mount my Manta user directory, I get the following error:

vagrant@vagrant:~$ sudo mount -o nolock 127.0.0.1:/hectcastro ~/mnt -v
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: timeout set for Tue Apr 29 16:48:14 2014
mount.nfs: trying text-based options 'nolock,vers=4,addr=127.0.0.1,clientaddr=127.0.0.1'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'nolock,addr=127.0.0.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 127.0.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: portmap query retrying: RPC: Program not registered
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: trying 127.0.0.1 prog 100005 vers 3 prot TCP port 1892
mount.nfs: mount(2): Remote I/O error
mount.nfs: Remote I/O error

The error message emitted by manta-nfs:

{
    "name": "server.js",
    "hostname": "vagrant",
    "pid": 22032,
    "component": "RpcServer",
    "procedure": "mnt",
    "xid": 4057608624,
    "level": 40,
    "err": {
        "message": "connect EACCES",
        "name": "Error",
        "stack": "Error: connect EACCES\n    at errnoException (net.js:904:11)\n    at Object.afterConnect [as oncomplete] (net.js:895:19)",
        "code": "EACCES"
    },
    "msg": "ensure_manta_directory: info(/hectcastro) failed",
    "time": "2014-04-29T16:50:05.541Z",
    "src": {
        "file": "/home/vagrant/node_modules/manta-nfs/lib/mount.js",
        "line": 102
    },
    "v": 0
}

Executing a directory listing with mls appears to be fine:

vagrant@vagrant:~$ mls /hectcastro
jobs/
public/
reports/
stor/

mv of a file doesn't work

I was trying to use 'mv' to move stuff around, unfortunately it failed. What I did in the nfs mount was:

[rm@rm /manta/bardiche/code/patches]$ mv *.patch 20131219
mv: cannot rename illumos.patch to 20131219/illumos.patch: No such file or directory
mv: cannot rename kvm-cmd.patch to 20131219/kvm-cmd.patch: No such file or directory
mv: cannot rename kvm.patch to 20131219/kvm.patch: No such file or directory
mv: cannot rename live.patch to 20131219/live.patch: No such file or directory

This resulted in the following log entries:

[2014-02-26T23:41:41.706Z]  WARN: server.js/RpcServer/14347 on rm (/home/rm/src/manta-nfs/lib/nfs/rename.js:91): rename(/rmustacc/public/bardiche/code/patches/kvm-cmd.patch, /rmustacc/public/bardiche/code/patches/20131219/kvm-cmd.patch): failed (procedure=rename, xid=341680211)
    ErrnoError: stat: ENOENT: NotFoundError
        at errno (/home/rm/src/manta-nfs/node_modules/mantafs/lib/manta.js:55:13)
        at onInfo (/home/rm/src/manta-nfs/node_modules/mantafs/lib/manta.js:243:16)
        at self.client.head.onRequestCallback.onResult (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:864:21)
        at res.once.headers (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:384:17)
        at IncomingMessage.<anonymous> (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:373:9)
        at IncomingMessage.g (events.js:180:16)
        at IncomingMessage.EventEmitter.emit (events.js:117:20)
        at _stream_readable.js:920:16
        at process._tickDomainCallback (node.js:459:13)
[2014-02-26T23:41:41.916Z]  WARN: server.js/RpcServer/14347 on rm (/home/rm/src/manta-nfs/lib/nfs/rename.js:91): rename(/rmustacc/public/bardiche/code/patches/kvm.patch, /rmustacc/public/bardiche/code/patches/20131219/kvm.patch): failed (procedure=rename, xid=442343507)
    ErrnoError: stat: ENOENT: NotFoundError
        at errno (/home/rm/src/manta-nfs/node_modules/mantafs/lib/manta.js:55:13)
        at onInfo (/home/rm/src/manta-nfs/node_modules/mantafs/lib/manta.js:243:16)
        at self.client.head.onRequestCallback.onResult (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:864:21)
        at res.once.headers (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:384:17)
        at IncomingMessage.<anonymous> (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:373:9)
        at IncomingMessage.g (events.js:180:16)
        at IncomingMessage.EventEmitter.emit (events.js:117:20)
        at _stream_readable.js:920:16
        at process._tickDomainCallback (node.js:459:13)
[2014-02-26T23:41:42.119Z]  WARN: server.js/RpcServer/14347 on rm (/home/rm/src/manta-nfs/lib/nfs/rename.js:91): rename(/rmustacc/public/bardiche/code/patches/live.patch, /rmustacc/public/bardiche/code/patches/20131219/live.patch): failed (procedure=rename, xid=543006803)
    ErrnoError: stat: ENOENT: NotFoundError
        at errno (/home/rm/src/manta-nfs/node_modules/mantafs/lib/manta.js:55:13)
        at onInfo (/home/rm/src/manta-nfs/node_modules/mantafs/lib/manta.js:243:16)
        at self.client.head.onRequestCallback.onResult (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:864:21)
        at res.once.headers (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:384:17)
        at IncomingMessage.<anonymous> (/home/rm/src/manta-nfs/node_modules/manta/lib/client.js:373:9)
        at IncomingMessage.g (events.js:180:16)
        at IncomingMessage.EventEmitter.emit (events.js:117:20)
        at _stream_readable.js:920:16
        at process._tickDomainCallback (node.js:459:13)

ssh-agent seems to be not working correctly

manta-nfs seems to know where to look for keys in the ssh-agent cache, if you add them via ssh-add , but mount fails with

(nfs mount window here:)
./mount 127.0.0.1:/rnelson/stor /mnt/manta-nfs/
nfs mount: 127.0.0.1:/rnelson/stor: server fault


(manta-nfs-server window here:) 
[2014-04-15T21:19:30.016Z]  WARN: server.js/RpcServer/47182 on 795a6631-16c6-46e0-b317-ccaa7312719c.local (/home/jill/src/node-v0.10.18-sunos-x64/lib/node_modules/manta-nfs/lib/mount.js:102): ensure_manta_directory: info(/rnelson/stor) failed (procedure=mnt, xid=1397557969)
    Error: connect EACCES
        at errnoException (net.js:901:11)
        at Object.afterConnect [as oncomplete] (net.js:892:19)

... this works ok, if I don't use ssh-agent, and instead use a passphrase-less key , placed in /root/.ssh/id_rsa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.