Linux FUSE 错误:传输端点未连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16002539/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
FUSE error: Transport endpoint is not connected
提问by AndroidDev
I'm trying to implement the FUSE filesystem. I am receiving this error:
我正在尝试实现 FUSE 文件系统。我收到此错误:
cannot access MountDir: Transport endpoint is not connected
无法访问 MountDir:传输端点未连接
This the relevant parts of the program. There are two directories, MirrorDir
and MountDir
, that exist withing the same directory as all of the code. I am calling the program like this:
这是程序的相关部分。有两个目录MirrorDir
和MountDir
,它们与所有代码位于同一目录中。我这样调用程序:
./myFS -o nonempty -o allow_other MirrorDir MountDir
Can anyone see what I am doing wrong?
谁能看到我做错了什么?
static struct fuse_operations xmp_oper = {
.getattr = xmp_getattr,
.readdir = xmp_readdir,
.open = xmp_open,
.read = xmp_read,
};
int main(int argc, char *argv[]) {
int fuse_stat;
char* mirrorDir;
mirrorDir = malloc(sizeof(strlen(argv[argc-2]+1)));
if (mirrorDir == NULL) {
perror("main calloc");
abort();
}
// Pull the rootdir out of the argument list and save it in my internal data
mirrorDir = realpath(argv[argc-2], NULL);
argv[argc-2] = argv[argc-1];
argv[argc-1] = NULL;
argc--;
// turn over control to fuse
fprintf(stderr, "about to call fuse_main\n");
fuse_stat = fuse_main(argc, argv, &xmp_oper, mirrorDir);
fprintf(stderr, "fuse_main returned %d\n", fuse_stat);
return fuse_stat;
}
回答by Jonathan Brown
This typically is caused by the mount directory being left mounted due to a crash of your filesystem. Go to the parent directory of the mount point and enter fusermount -u YOUR_MNT_DIR
.
这通常是由于文件系统崩溃导致挂载目录被挂载造成的。进入挂载点的父目录,输入fusermount -u YOUR_MNT_DIR
.
If this doesn't do the trick, do sudo umount -l YOUR_MNT_DIR
.
如果这不起作用,请执行sudo umount -l YOUR_MNT_DIR
.
回答by Jonathan Brown
I mounted a ssh file system (sshfs command line) and left it mounted and I had same problem, fusermount -u YOUR_MNT_DIR
solved my problem. Thanks
我挂载了一个 ssh 文件系统(sshfs 命令行)并将其挂载,我遇到了同样的问题,fusermount -u YOUR_MNT_DIR
解决了我的问题。谢谢
回答by Thiago Mata
You may check your /etc/hosts to verify it the master node is with a fully qualified name. More details in https://community.cloudera.com/t5/CDH-Manual-Installation/Setting-the-NameNode-port-8020-to-listen-outside-of-localhost/td-p/2257and in How to configure hosts file for Hadoop ecosystem
您可以检查您的 /etc/hosts 以验证主节点是否具有完全限定名称。https://community.cloudera.com/t5/CDH-Manual-Installation/Setting-the-NameNode-port-8020-to-listen-outside-of-localhost/td-p/2257中的更多详细信息和如何为 Hadoop 生态系统配置 hosts 文件