删除远程 hadoop 集群中的克隆文件
delete cloned file in a remote hadoop cluster
我在 GitHub 上创建了一个存储库并将其克隆到远程 hadoop 集群 git clone <link of my repository>
。
现在我想从 hadoop 集群中删除这个存储库。我怎样才能做到这一点?
我试过 cd hadoop fs -rm -r <my repository in cluster>
,但它说:
No such file or directory
您遗漏了一个重要细节:Hadoop 分布式文件系统 (HDFS) 是一个不同于集群节点本地文件系统的文件系统。 read/write/access HDFS 的唯一方法是通过 hdfs shell 命令。
git clone
没有将内容上传到 hdfs...
您需要使用 shell 命令 ssh 到远程集群并删除您克隆的目录:
>ssh username@clusterNodeIP
>rm -r pathOfGitFolder
这将从远程集群中删除 git 文件夹(它从未上传到 HDFS)。如果你想把它上传到 HDFS,你应该在克隆它之后使用 hadoop shell 命令(比如 hdfs -copyFromLocal)。
更多细节推荐阅读:
https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html
和
https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-common/FileSystemShell.html
我在 GitHub 上创建了一个存储库并将其克隆到远程 hadoop 集群 git clone <link of my repository>
。
现在我想从 hadoop 集群中删除这个存储库。我怎样才能做到这一点?
我试过 cd hadoop fs -rm -r <my repository in cluster>
,但它说:
No such file or directory
您遗漏了一个重要细节:Hadoop 分布式文件系统 (HDFS) 是一个不同于集群节点本地文件系统的文件系统。 read/write/access HDFS 的唯一方法是通过 hdfs shell 命令。
git clone
没有将内容上传到 hdfs...
您需要使用 shell 命令 ssh 到远程集群并删除您克隆的目录:
>ssh username@clusterNodeIP
>rm -r pathOfGitFolder
这将从远程集群中删除 git 文件夹(它从未上传到 HDFS)。如果你想把它上传到 HDFS,你应该在克隆它之后使用 hadoop shell 命令(比如 hdfs -copyFromLocal)。
更多细节推荐阅读:
https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html
和
https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-common/FileSystemShell.html