我已经为特定的二进制格式编写了一个解析器类(nfdump,如果有人感兴趣的话),它使用java.nio的MappedByteBuffer来读取每个几GB的文件.二进制格式只是一系列标题和大多数固定大小的二进制记录,它们通过调用nextRecord()输出到被调用者,后者推送状态机,在完成时返回null.它表现很好.它适用于开发机器.
在我的生产主机上,它可以运行几分钟或几小时,但似乎总是抛出"java.lang.InternalError:在编译的Java代码中最近的一个不安全的内存访问操作中发生了一个错误",指法其中一个Map.getInt ,getShort方法,即地图中的读取操作.
设置地图的无争议(?)代码是这样的:
/** Set up the map from the given filename and position */
protected void open() throws IOException {
// Set up buffer, is this all the flexibility we'll need?
channel = new FileInputStream(file).getChannel();
MappedByteBuffer map1 = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
map1.load(); // we want the whole thing, plus seems to reduce frequency of crashes?
map = map1;
// assumes the host writing the files is little-endian (x86), ought to be configurable
map.order(java.nio.ByteOrder.LITTLE_ENDIAN);
map.position(position); …Run Code Online (Sandbox Code Playgroud) 什么时候在Linux 2.6内核和NFSv3中确实open("fname", O_CREAT|O_EXCL)有效?当前的规范open(2)系统调用文档(http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html)说一切都很好:
- O_EXCL
- ...
On NFS, O_EXCL is only supported when using NFSv3 or later on kernel
2.6 or later. In NFS environments where O_EXCL support is not
provided, programs that rely on it for performing locking tasks will
contain a race condition. Portable programs that want to perform
atomic file locking using a lockfile, and need to avoid reliance on NFS
support for O_EXCL, can ...
Run Code Online (Sandbox Code Playgroud)
这看起来好像所有2.6内核都没问题,但是手册页面更改日志(ca late …
我正面临一个奇怪的问题:(重新)包装一个Vagrant盒子,并希望有人可以告诉我在哪个方向看.这就是故事
sudo apt-get install nfs-common)vagrant haltvagrant up下一个合乎逻辑的步骤是打包盒子,这样每次VM被销毁时我都不需要重新安装nfs-common.
vagrant packagevagrant box add ubuntuvm2 package.boxrm package.boxconfig.vm.boxVagrantfile中的行更改为ubuntuvm2vagrant destroyvagrant up任何人都知道在哪个方向开始寻找解决方案?
我在OS-X Lion上使用Virtualbox 4.1.8和Vagrant 1.0.0
我正在尝试更改我的VagrantFile,以便它使用NFS挂载而不是默认的VirtualBox共享文件夹.
我收到此错误消息:
vm:
* Shared folders that have NFS enabled do not support owner/group
attributes. Host path: .
Run Code Online (Sandbox Code Playgroud)
这是我的VagrantFile:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ktbartholomew/lamp"
config.vm.network "private_network", type: "dhcp"
config.vm.synced_folder ".", "/vagrant", type: "nfs"
end
Run Code Online (Sandbox Code Playgroud)
我看不到任何所有者或团体被设置.
请帮忙!谢谢
我正在使用vagrant在我的本地机器上运行wordpress dev环境,设置nfs作为默认的文件共享机制(我在Mac上).总体性能非常好,除了一件事:同步延迟.
我已经在guest上设置了grunt观察者来重新编译css/javascript以及在每次文件更改时实时重载页面.但是,当我在主机上保存文件时:在同步客户端之前需要1到10秒.
我希望能够在主机上点击保存,并立即看到更改反映在客户端上,这将触发咕噜咕噜的观察者完成我需要做的所有事情.
有没有办法实现这个目标?哈克强制同步一些文件与grunt可能吗?我尝试过rsync,看起来延迟更明显.
谢谢
我的Vagrantfile中有以下内容:
config.vm.network :private_network, ip: "10.0.0.103"
config.vm.synced_folder ".", "/vagrant/", type: "nfs"
Run Code Online (Sandbox Code Playgroud)
做vagrant up一个新鲜的盒子产量:
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=3,udp' 10.0.0.1:'/Users/wayne/app' /vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: access denied by server while mounting 10.0.0.1:/Users/wayne/app
Run Code Online (Sandbox Code Playgroud)
然后我需要vagrant reload它似乎工作......但我当然不应该这样做?
[更新:日志输出]
INFO retryable: Retryable exception raised: #<Vagrant::Errors::LinuxNFSMountFailed: The following SSH command responded …Run Code Online (Sandbox Code Playgroud) 使用C,在Linux下运行,我试图弄清楚如何让2个不同的进程访问位于NFSv4文件系统上的同一个文件.具体来说,我想让一个程序打开一个文件进行读取,然后让第二个程序打开该文件进行写入.我打算使用AWS的新EFS(弹性文件系统),而EFS只是NFSv4.
程序的性质使得作者本质上只会附加到文件中.在作者完成并调用fflush之前,读者永远不会访问新添加的信息.
NFSv4是否支持这种情况?
或者是否有更好的方法来实现这种并发NFSv4文件访问?
有没有办法让NFS忽略同步文件夹中的指定文件和/或目录?我已经使用rsync(rsync__exclude)完成了它,但没有找到任何NFS引用.我也在寻找SMB的解决方案.有任何想法吗?
在Spark的常见问题解答中,它明确表示不必使用HDFS:
我需要Hadoop来运行Spark吗?
不,但如果您在群集上运行,则需要某种形式的共享文件系统(例如,NFS安装在每个节点上的相同路径上).如果您有这种类型的文件系统,则可以在独立模式下部署Spark.
那么,如果我不打算使用Hadoop MapReduce,那么使用Apache Spark和HDFS与其他分布式文件系统(如NFS)相比有哪些优点/缺点?如果我使用NFS而不是HDFS用于节点存储(用于检查点,随机溢出等),我是否会遗漏一个重要的功能?
我正在尝试设置 EFS 并使用不同可用区中的 EC2 实例访问它。我为 EFS 创建了一个单独的安全组,它允许连接到 EC2 实例的安全组的流量。还在 EC2 实例上安装了 amazon-efs-utils 实用程序。但是当尝试执行以下命令时: sudo mount -t efs -o tls EFS-ID:/ efs
我收到以下错误:
mount.nfs4: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)
我已经尝试了几次,但没有奏效。我在这里错过了什么?任何人都可以请让我知道。
谢谢
nfs ×10
vagrant ×5
virtualbox ×3
file-io ×2
linux ×2
vagrantfile ×2
amazon-ec2 ×1
amazon-efs ×1
apache-spark ×1
file-locking ×1
glibc ×1
gruntjs ×1
java ×1
mmap ×1
nio ×1
rsync ×1
smb ×1
wordpress ×1