问题标签 [nfs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
2524 浏览

git - 推送到 NFS 共享上的 Git 存储库失败

我们目前在本地磁盘上有我们的 Git 存储库。它们由组共享并通过 SSH(使用 git-shell)访问。

由于空间问题,我们现在希望将存储库移动到 NAS 上的 NFS 共享。我一直在尝试这个,并且遇到了一个奇怪的问题。可以很好地克隆具有完全相同权限的新(和裸)存储库,但是推送更改(touch foo && git add foo && git commit && git push origin master)失败并出现错误“无法设置参考/头/主”和“写失败”。

现在,如果我在本地磁盘上重复这个场景,那么 refs/heads/master 就会被任何用户推送。相反,在 NFS 共享上,如果我将其所有者更改为尝试推送的用户,则不会引发错误。但是,在这两种情况下,用户都是拥有整个存储库并具有组写入权限的组的成员。此外,如果我只是使用 SSH 作为该组成员的用户登录,我可以在 NFS 共享和本地磁盘上触摸 refs/heads/master(正如预期的那样)。

因此,我在这里不知所措。我不知道为什么不同的文件所有者会导致推送失败,看看组权限如何允许用户覆盖 refs/heads/master。此外,即使在该文件上使用 chmod 777,推送也会失败,除非我 chown 文件。

如果有人能对这种怪异现象有所了解,我将不胜感激。提前致谢!

0 投票
2 回答
2342 浏览

shell - 如何判断(在 sh 中)目录是否通过 NFS 挂载

df -t nfs $目录

如果目录是 NFS 挂载的,则返回两行输出,如果不是,则返回一行。

如果 df 不是 NFS 挂载的,某些版本的 df 会给出退出状态 1,但 GNU coreutils 5.3.0 不会...

感觉不雅,同事说它没有充分检查错误。有一个更好的方法吗?

0 投票
1 回答
1305 浏览

java - setLastModified 不适用于 NFS 共享

我的一台 Solaris 服务器上安装了 NFS 共享。路径/appdata/anp从服务器 A 挂载到服务器 B。在共享下:

/appdata/anp

我有一个文件夹名为

/appdata/anp/factory

在上面的目录中,我放置了包含需要在数据库中导入/更新的数据的文件。在数据库中导入数据后,我根据导入数据的操作结果将文件移动到成功/失败目录。

/appdata/anp/factory/success

/appdata/anp/factory/failure

我将文件移动到上述任一目录,并使用以下命令将文件的最后修改时间更新为当前系统时间:

file.setLastModified

它返回一个布尔值。问题是每当我执行此更新操作时,它都无法将该文件的时间戳更新为当前系统时间。

有谁知道其中的场景是什么

file.setLastModified

返回失败。我什至检查了 NFS 权限,我觉得一切正常。无论如何知道setLastModified可能返回失败的情况吗?

请帮帮我,我真的在这个问题上拉扯我的头发!:(

0 投票
2 回答
2247 浏览

django - Django ImageField 上传到 nfs。(没有可用的锁)

我想使用 Django ImageField 上传到 nfs 存储,但出现此错误:

[Errno 37] 没有可用的锁

这是在 /etc/fstab/ 中:

173.203.221.112:/home/user/project/media/uploads/ /home/user/project/media/uploads nfs rw,bg,hard,lock,intr,tcp,vers=3,wsize=8192,rsize=8192 0 0

我还尝试修补 django 以使用 flock() 而不是 lockf() 但仍然无法正常工作。

http://code.djangoproject.com/ticket/9400

知道有什么问题吗?

0 投票
2 回答
983 浏览

svn - 尝试访问不存在的目录 /home/.svn 时,svn 提交失败

svn commit 失败,出现以下错误:

现在,这里的第一个问题是 svn 应该寻找 /home/user/.svn 而我不知道为什么它要寻找不存在的 /home/.svn

输入/输出错误与svn无关

这只是 NFS 安装系统的结果。不幸的是,我几乎无法控制它的设置方式。

无论如何,问题是:我如何明确地告诉 svn 在哪里寻找 .svn 文件?如果这是不可能的,我该如何解决这个问题?

svn 版本:1.6.5

0 投票
11 回答
69815 浏览

performance - 提高 git status 性能的方法

我在 NFS 上的 Linux 机器上有一个 10 GB 的存储库。第一次git status需要 36 分钟,随后git status需要 8 分钟。似乎 Git 依赖于操作系统来缓存文件。只有git像这样的第一个命令commitstatus涉及打包/重新打包整个 repo 需要很长时间才能获得一个巨大的 repo。我不确定你是否使用git status过这么大的 repo,但是有人遇到过这个问题吗?

我试过了git gc,但是git cleangit repack用的时间仍然/几乎相同。

子模块或任何其他概念(如将 repo 分解成更小的部分)会有帮助吗?如果是这样,哪个是拆分更大回购的最佳选择。有没有其他方法可以改善大型 repo 上 git 命令所花费的时间?

0 投票
1 回答
1673 浏览

nfs - NFS file open in C code

If I open a file in my C/C++/Java code using a pathname that goes to an nfs directory, how the does the read and write syntax work with NFS being stateless and all? I have tried but cant find an example code accessing NFS mounted files. My current understanding is that it is the job of the NFS client to keep state (like read and write pointer) and the application uses the same syntax.

A related question is regarding VFS and UFS. Are all files in a current unix machine accessed through their vnodes first and then (depending on local vs remote) inode or rnode structures?

0 投票
3 回答
2838 浏览

svn - TortoiseSVN 在存储在网络共享上的工作副本上显示日志非常慢

我正在使用存储在 samba 网络共享上的工作副本。它似乎工作正常;除了...

在 Windows 下,我可以执行“svn log -l 100 -v”。在工作副本上并在 <1 秒内获得结果。但是,如果我使用 TortiseSVN 右键单击​​并显示日志,它会在使用 >30Mbps 的网络带宽时挂起几分钟。

Tortise 处理网络存储的工作副本是否需要已知问题或配置?

0 投票
1 回答
2657 浏览

python - How to ensure a safe file sync with sqlite and NFS

I have recently converted my workspace file format for my application to sqlite. In order to ensure robust operation on NFS I've used a common update policy, I do all modifications to a copy stored in a temp location on the local harddisk. Only when saving do I modify the original file (potentially on NFS) by copying over the original file with the temp file. I only open the orginal file to keep an exclusive lock on it so it someone else tries to open they will be warned that someone else is using it.

The problem is this: When I go to save my temp file back over the original file I must release the lock on the orginal file, this provides a window for someone else to get in and take the original, albeit a small window.

I can think of a few ways around this:

(1) being to simply dump the contents of the temp in to the orginal by using sql, i.e. drop tables on original, vacumm original, select from temp and insert into orginal. I don't like doing sql operations on a sqlite file stored on NFS though. This scares me with corruptions issues. Am I right to think like this?

(2) Use various extra files to act as a guard to prevent other from coming in while copying the temp over the original. Using files as a mutex is problematic at best. I also don't like the idea of having extra files hanging around if the application crashes.

I'm wondering if anyone has any different solutions for this. Again to copy the temp file over the original file while ensuring other application don't sneak in and grab the original file while doing so?

I'm using python2.5, sqlalchemy 0.6.6 and sqlite 3.6.20

Thanks, Dean

0 投票
3 回答
92 浏览

linux - 从多台机器收集文件?

我在网络中连接了许多机器(20 多台)。每台机器访问一个中央数据库,查询它,处理查询的信息,然后将结果写入其本地硬盘驱动器上的文件。

在处理之后,我希望能够将所有这些文件(从所有远程机器)“抓取”回主机进行存储。

我想到了三种可能的方法:

(1) 从主机 rsync 到每台远程机器,并“询问”文件

(2) rsync 从每台远程机器到主机,并“发送”文件

(3) 在每台远程机器上创建一个 NFS 共享,主机可以访问和读取文件(这种情况下不需要 'rsync')

其中一种方式比其他方式更好吗?有没有更好的方法我不知道?

所有机器都使用 Ubuntu 10.04LTS。在此先感谢您的任何建议。