无法rsync到“ hdfs挂载”的hdfs:-

问题描述

对不起,标题中的双关语。这是交易:

我怎么了?

我有一个HDP 3.1集群,其中包含3个数据节点,1个名称节点和1个备用名称节点。该群集位于网络192.168.10.0/24上。在该网络中,我有另一台服务器,我经常需要从该服务器将文件同步到HDFS。 rsync给我错误消息

rsync: [receiver] close Failed on "/hdfs_10G_fuse/user/dir_1/.file_xyz.csv.hoY9FN": Input/output error (5)

以及

rsync: [receiver] mkstemp "/hdfs_10G_fuse/user/dir_1/sub_dir1/.file_xyz" Failed: Input/output error (5)

以及

create /user/dir_1/dir_1.5/dir_sub_1.5/dir_37/.file.csv.ggVI4W: permission denied

(不,出于当前出于简洁的原因我不打算使用hdfs copyfromlocal的原因,但我愿意解释是否没有人找到我的rsync问题的解决方案。)

到目前为止,我做了什么并尝试过?

因此,我最终使用Microsoft的“ hdfs-mount”工具将HDFS成功安装到该服务器上的本地目录中。我遵循了https://github.com/microsoft/hdfs-mount上的所有说明,包括安装Go 1.13等。这是我成功完成安装的步骤:

sudo apt remove 'golang-*'
cd ~
wget https://dl.google.com/go/go1.13.9.linux-amd64.tar.gz
tar xf go1.13.9.linux-amd64.tar.gz
sudo mv go /usr/local/go-1.13
export GOROOT=/usr/local/go-1.13
export PATH=$GOROOT/bin:$PATH
git clone --recurse-submodules -j8 https://github.com/microsoft/hdfs-mount.git
sudo mkdir -p $GOROOT/src/golang.org/x/
cd !$
sudo git clone https://github.com/golang/sys.git
cd ~/hdfs-mount/
make
sudo nano /etc/fuse.conf
# + --> uncomment settings in /etc/fuse.conf
sudo mkdir /hdfs_10G_fuse/
sudo chown danilo:danilo /hdfs_10G_fuse
sudo ./hdfs-mount 192.168.10.10:8020 /hdfs_10G_fuse/

(我尝试了其他方法,例如HDP固有的NFS网关(安装工作,以下相同的问题+慢得多),https://github.com/remis-thoughts/native-hdfs-fuse.githttps://github.com/alexsmith1612/hadoofus.git等,然后执行了此操作,因此看起来好像是hdfs-mount对我来说是最好的选择。)

在我执行的HDFS上

hdfs dfs -chmod 755 /user/dir_1

作为hdfs用户我有时也尝试过777。我还尝试将HDFS站点配置中的“ dfs.permissions.enabled”设置为“ false”,然后重新启动该服务并再次挂载-所有结果均与上面列出的相同。

我还通过下载源代码,对其进行修补并根据INSTALL.md文件中列出的说明将rsync更新到3.2.3版。由于我在服务器上使用Ubuntu 18.04,因此我没有xxhash库,并使用编译器标志禁用了该库。以下是该版本的输出

rsync  version 3.2.3  protocol version 31
copyright (C) 1996-2020 by Andrew Tridgell,Wayne Davison,and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files,64-bit inums,64-bit timestamps,64-bit long ints,socketpairs,hardlinks,hardlink-specials,symlinks,IPv6,atimes,batchfiles,inplace,append,ACLs,xattrs,optional protect-args,iconv,symtimes,prealloc,stop-at,no crtimes
Optimizations:
    SIMD,asm,openssl-crypto
Checksum list:
    md5 md4 none
Compress list:
    zlibx zlib none

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software,and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

我在Ubuntu 18.04附带的rsync版本中遇到了同样的问题。为什么我要从源代码更新和安装?所以我可以打补丁。我为什么要打补丁?因为我希望https://stackoverflow.com/a/11697694/7870462解决我的问题。

我还可以提供哪些其他信息?

在终端中运行hdfs-mount并查看输出显示以下消息:

2020/10/16 17:02:47 Dir.go:212: Can't create file:  /user/dir_1/subdir_1/.file_1.csv.UMdYKH create /user/dir_1/subdir_1/.file_1.csv.UMdYKH: permission denied

如上所述,我通过几种方法将自己弄得僵硬和僵硬。

我有什么帮助?

说明或测试以找出问题所在

rsync或hdfs-mount的另一个补丁可以解决该问题

非常感谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)