G R*_*uez 6 nfs amazon-web-services nfs4
先生们,我按照这篇优秀帖子的说明进行了操作,但无法连接。 弹性文件系统 (EFS) 在 AWS 之外挂载
我在 Mesos 集群中使用 CoreOS。我们有一个 EFS 连接到集群中的所有节点,以便它们可以共享数据、脚本等。我们有一个到 AWS VPC 的 VPN 隧道,因此我们可以从办公室进行连接。
我的用户想将一些脚本上传到 EFS 并获取计算结果,因此他们想在本地挂载 NFS。所以我按照上面文章中的建议启动了一个 haproxy。
sudo docker run -d --net=host haproxy /bin/bash -c "echo -e 'listen fs-1e7bb658-us-east-1\n bind :2049\n mode tcp\n option tcplog\n timeout tunnel 300000\n server fs-1e7bb658-us-east-1a us-east-1a.fs-1e7bb658.efs.us-east-1.amazonaws.com:2049 check inter 60000 fastinter 15000 downinter 5000' > /haproxy.cfg && haproxy -f /haproxy.cfg"
Run Code Online (Sandbox Code Playgroud)
如果不清楚,配置是这样的:
listen fs-1e7bb658-us-east-1
bind :2049
mode tcp
option tcplog
timeout tunnel 300000
server fs-1e7bb658-us-east-1a us-east-1a.fs-1e7bb658.efs.us-east-1.amazonaws.com:2049 check inter 60000 fastinter 15000 downinter 5000
Run Code Online (Sandbox Code Playgroud)
如上述主题中所建议的那样,它通过通往 EFS 的隧道启动 haproxy。我知道它正在工作,因为我可以使用 Haproxy IP 将 EFS 挂载到集群节点(即 /testing)中的第二个文件夹中,当我将文件写入 /testing 时,我可以在 /shared 文件夹中的所有节点中看到它. 例如:
sudo mount 100.100.100.68:/ /testing # Mount using haproxy
echo "testing123!" > /testing/testing.txt # write to a file
cat /shared/testing.txt # get from any node in the cluster
>>> testing123!
Run Code Online (Sandbox Code Playgroud)
所以问题是,当我想从 OSX 挂载时,我得到:
grodriguez:/ Guimo$ sudo mount 100.100.100.68:/ /sharedfiles
mount_nfs: can't mount / from 100.100.100.68 onto /sharedfiles: RPC prog. not avail
Run Code Online (Sandbox Code Playgroud)
我知道 HaProxy 正在监听,因为我可以在 OSX 上做:
grodriguez:/ Guimo$ telnet 100.100.100.68 2049
Trying 100.100.100.68...
Connected to 100.100.100.68.
Escape character is '^]'.
Run Code Online (Sandbox Code Playgroud)
所以它使用 telnet 连接到服务,但不会使用 nfs 连接。
安全组非常自由,此外,如果它不起作用,我就不会使用 telnet 进行连接。因此该服务正在该端口工作。
我读到我可以尝试寻找 mountd 和 nfs 服务,但什么也没有。也许 EFS 正在隐藏它们。也许这就是 OSX 抱怨缺少服务的原因。
grodriguez:/ Guimo$ rpcinfo -p 100.100.100.68
program vers proto port
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 45358 status
100024 1 tcp 60755 status
100021 1 udp 43439 nlockmgr
100021 3 udp 43439 nlockmgr
100021 4 udp 43439 nlockmgr
100021 1 tcp 34893 nlockmgr
100021 3 tcp 34893 nlockmgr
100021 4 tcp 34893 nlockmgr
Run Code Online (Sandbox Code Playgroud)
但是如果隧道仍然不起作用,为什么代理应该成功连接?
顺便提一句。我也试过AWS的方式连接,但是OSX也有问题。
grodriguez:/ Guimo$ mount -t nfs4 -o nfsvers=4.1 100.100.100.68:/ /sharedfiles
mount: exec /System/Library/Filesystems/nfs4.fs/Contents/Resources/mount_nfs4 for /sharedfiles: No such file or directory
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏。
问候, 桂墨
编辑:以防我下面的注释不清楚。我使用 docker for mac 启动了一个 debian,然后我在容器中安装了 nfs4 支持,然后我连接到了 HaProxy 隧道。一切顺利,我可以看到我的 testing.txt 文件。
所以我想这是一个 OSX 问题,与上面的解决方案无关,这很棒。
小智 9
对于任何正在寻找此类问题答案的人,迈克尔的评论解决了我的问题。
我们直接连接到 AWS,在将正确的入站规则(TCP 2049 办公子网)添加到安全组后,我可以将 EFS 挂载到我的本地 macbook。
sudo mount -t nfs -o vers=4 -o tcp -w x.x.x.x:/ efs
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
11920 次 |
最近记录: |