You need to enable JavaScript to run this app.
导航
使用 FUSE 挂载 Proton
最近更新时间:2024.07.11 11:37:36首次发布时间:2024.07.11 11:37:36

可以使用 Hadoop 自带的 fuse_dfs 将 Proton 的文件挂载到本地文件系统中,让您能够像操作本地文件系统一样操作Proton 上的文件。

挂载

  1. 安装 fuse
apt-get install fuse
  1. 创建挂载点
mkdir -p /mnt/proton_mount
  1. 挂载
export OS_ARCH=amd64
export LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/${OS_ARCH}/server:${HADOOP_HOME}/lib/native
export CLASSPATH=$CLASSPATH:`${HADOOP_HOME}/bin/hadoop classpath --glob`
export LIBHDFS_OPTS="-Xmx1024m"
export PROTON_ENABLE_FUSE=true

# 在这里修改 bucket
export BUCKET_NAME=<your bucket name>

${HADOOP_HOME}/bin/fuse_dfs -ordbuffer=1024 -oattribute_timeout=0 tos://${BUCKET_NAME}/ /mnt/proton_mount

卸载

fusermount -u /mnt/proton_mount
# 必须删掉该目录,保证下次能正常挂载
rm -rf /mnt/proton_mount

特性支持

特性

说明

是否支持

getattr()

查询文件属性

支持

mkdir()

创建目录

支持

rmdir()

删除目录

支持

unlink()

删除文件

支持

rename()

重命名文件

支持

read()

顺序读取

支持

pread()

随机读取

支持

write()

顺序写入

支持

pwrite()

随机写入

不支持

flush()

刷新内存到内核缓冲区

支持

fsync()

刷新内存到磁盘

不支持

release()

关闭文件

支持

readdir()

读取目录

支持

create()

创建文件

支持

open() O_APPEND

通过追加写的方式打开文件

不支持

open() O_TRUNC

通过覆盖写的方式打开文件

支持

ftruncate()

对打开的文件进行截断

不支持

truncate()

对未打开的文件进行截断

支持

lseek()

指定打开文件中的读写位置

不支持

chmod()

修改文件权限

支持

access()

查询文件权限

支持

utimes()

修改文件的存取时间和更改时间

不支持

setxattr()

修改文件xattr属性

不支持

getxattr()

获取文件xattr属性

不支持

listxattr()

列举文件xattr属性

不支持

removexattr()

删除文件xattr属性

不支持

lock()

支持posix锁

不支持

fallocate()

为文件预分配物理空间

不支持

symlink()

创建软连接

不支持

readlink()

读取软连接

不支持

性能 - 无缓存模式

测试命令

fio -filename=/mnt/proton_mount/fio.txt --ioengine=posixaio --name=write_iops --directory=`pwd` --size=30G \
--time_based --runtime=20s --ramp_time=2s  --direct=0 \
--verify=0 --bs=4K --iodepth=256 --rw=write --group_reporting=1 \
--iodepth_batch_submit=256  --iodepth_batch_complete_max=256

测试结果

bs=4K

write: IOPS=45.3k, BW=177MiB/s

bs=16K

write: IOPS=25.6k, BW=400MiB/s

bs=64k

write: IOPS=9491, BW=594MiB/s

bs=1M

write: IOPS=654, BW=667MiB/s

顺序读

测试命令

fio -filename=/mnt/proton_mount/fio.txt --ioengine=posixaio --name=read_iops --directory=`pwd` --size=30G \
--time_based --runtime=20s --ramp_time=2s  --direct=0 \
--verify=0 --bs=4K --iodepth=256 --rw=read --group_reporting=1 \
--iodepth_batch_submit=256  --iodepth_batch_complete_max=256

测试结果

bs=4K

read: IOPS=18.8k, BW=73.6MiB/s

bs=16K

read: IOPS=4685, BW=73.4MiB/

bs=64k

read: IOPS=1168, BW=73.8MiB/s

bs=1M

read: IOPS=73, BW=85.4MiB/s

随机读

测试命令

fio -filename=/mnt/proton_mount/fio.txt --ioengine=posixaio --name=rand_read_iops --directory=`pwd` --size=30G \
--time_based --runtime=20s --ramp_time=2s  --direct=0 \
--verify=0 --bs=4K --iodepth=256 --rw=randread --group_reporting=1 \
--iodepth_batch_submit=256  --iodepth_batch_complete_max=256

测试结果

bs=4K

read: IOPS=136, BW=595KiB/s

bs=16K

read: IOPS=117, BW=2067KiB/s

bs=64k

read: IOPS=113, BW=8064KiB/s

bs=1M

read: IOPS=18, BW=27.8MiB/s