SlideShare a Scribd company logo
1 of 21
Download to read offline
Alluxio FUSE在京东的实践
2019-09-01
京东零售 技术与数据中台 数据基础平台部
刘洪通
1 2
3 4
Alluxio FUSE在京东的应用 解读Alluxio FUSE原理和架构
Alluxio FUSE的POSIX兼容性 京东在Alluxio社区的贡献
目录
Alluxio FUSE在京东的应用1
Alluxio FUSE在京东的应用 - 平台架构
4
Alluxio FUSE在京东的应用 – 早期海量文件共享服务
5
劣势
费时
数据从HDFS推送至
Cephfs,约增加一倍耗时
费力
需要数据一致性校
验,耗费大量时间
难度大Ceph集群不易运维,新
手难以掌握
稳定性
内核ceph模块增加
操作系统不稳定性
一写多读
Alluxio FUSE在京东的应用 – 海量文件高速共享服务
6
缺点
• Alluxio FUSE宜采用Direct_IO,无Page Cache加速
• FUSE受限于架构设计,性能不及内核态fs
• Alluxio的稳定性将影响BDP SLA
A
Hadoop Client集成Alluxio
Client,应用编程无感知,只需
替换Schema
B
数据经过Alluxio同步地写穿到
HDFS,耗时只是略微增加,省去
推送环节,较早期模型约缩短一
倍时间
C 不影响操作系统稳定性
D
同样使用Native fs,文件消
费者无感知
Alluxio FUSE在京东的应用 - 备选方案
7
待改进
distributedLoad实际效果相比load性能提升有限,待进一步优化
解读Alluxio FUSE原理和架构
2
解读Alluxio FUSE原理和架构 - 核心架构
 FUSE: Filesystem in Userspace(用户空间文件系统)
AlluxioFuseFileSystem extends FuseStubFS {
+ int create(String path, long mode, FuseFileInfo fi)
+ int open(String path, FuseFileInfo fi)
+ int chmod(String path, long mode)
+ int chown(String path, long uid, long gid)
+ int mkdir(String path, long mode)
+ int readdir(String path, Pointer buff, FuseFillDir filter, long offset,
FuseFileInfo fi)
......
}
1
2
3
4
5
6
AlluxioFuse
jnr-fuse
libfuse
vfs
Alluxio基于jnr-fuse
实现用户态文件系统
的守护进程
fuse 的用户态库
An FUSE implementation
in java using Java Native
Runtime
Virtual File System,
虚拟文件系统
/dev/fuse
fuse模块创建的字符设
备,是内核与libfuse
交互的通道,所有挂载
点(Mount Point)共享
kernel fuse
基于vfs实现的内核模块
解读Alluxio FUSE原理和架构 - 使用方法
 安装依赖
# yum install -y fuse-libs fuse
 配置
# cat alluxio-2.0.0/conf/alluxio-site.properties
alluxio.master.hostname=x.x.x.x
# echo user_allow_other >> /etc/fuse.conf
 挂载Alluxio FUSE
# ./alluxio-2.0.0/integration/fuse/bin/alluxio-fuse mount -o <options> /mountpoint /path/in/alluxio
 查看Alluxio FUSE挂载点
# ./alluxio-2.0.0/integration/fuse/bin/alluxio-fuse stat
pid mount_point alluxio_path
130741 /mountpoint /path/in/alluxio
 查看挂载参数
# mount -t fuse.alluxio-fuse
alluxio-fuse on /mountpoint type fuse.alluxio-fuse 
(rw,nosuid,nodev,relatime,user_id=1001,group_id=1001,allow_other)
 查看存储空间
# df -h -t fuse.alluxio-fuse
Filesystem Size Used Avail Use% Mounted on
alluxio-fuse 211T 53G 211T 1% /mountpoint
 卸载Alluxio FUSE
# ./alluxio-2.0.0/integration/fuse/bin/alluxio-fuse umount /mountpoint
或 # umount /mountpoint
解读Alluxio FUSE原理和架构 - 初始化流程
1. jnr-fuse将AlluxioFuseFileSystem打
包传给libfuse
2. libfuse打开/dev/fuse字符设备,返回
文件描述符fd(File Descriptor)。fd在
进程内的线程间共享,因此fuse很容
易支持multi-thread模式;fd在进程
间不共享,且file支持私有数据,因此
fuse支持多种类型的挂载点
3. mount系统调用传参fd,libfuse和
kernel fuse通过fd这个桥梁建立虚拟
连接
4. super_block和file的私有数据对应虚拟连接
5. multi-thread模式下,多个线程同时从/dev/fuse读取请求
6. 当前无请求时,read系统调用阻塞
7. 当请求到来时,唤醒被阻塞的线程,read返回文件系统请求
解读Alluxio FUSE原理和架构 - mkdir流程
Alluxio FUSE的POSIX兼容性
3
Alluxio FUSE的POSIX兼容性 - 兼容性测试
14
 fstest - 简化版的文件系统POSIX兼容性测试套件
https://www.tuxera.com/community/posix-test-suite/
 使用方法
wget http://download.tuxera.com/sw/qa/pjd-fstest-20080816.tgz
tar xf pjd-fstest-20080816.tgz
cd pjd-fstest-20080816
make
(切记,进入待测试目录!!!)
cd /your/test/dir
整体测试
prove -r pjd-fstest-20080816/tests
单独测试
prove pjd-fstest-20080816/tests/unlink/00.t
 定位失败测试
# strace -T -f -r prove pjd-fstest-20080816/tests/mkfifo/00.t > /tmp/ mkfifo.log 2>&1
[pid 54451] mknod("fstest_34c2d9dbec1aed322d9ffc452ce32469", S_IFIFO|0644 <unfinished ...>
[pid 54451] <... mknod resumed> ) = -1 ENOSYS (Function not implemented) <0.000814>
01
03
02
04
05
06
ext4
极少数失败
kernel ceph
极少数失败
Alluxio-fuse
部分失败
xfs
极少数失败
ceph-fuse
少数失败
hdfs-fuse
大部分失败
Alluxio FUSE的POSIX兼容性 - 兼容性
15
 兼容列表
create, rename, open, unlink
getattr, chmod, chown
mkdir, readdir ,rmdir
read, write, flush
dup2
……
 不兼容列表
不支持在创建文件或目录时指定权限<已解决>
不支持修改文件属主或属组为当前不存在的用户或组
不支持软连接
未检查文件名长度是否超出255 <已解决>
不支持mkfifo, mknod
不支持truncate
不支持扩展属性
不支持fallocate
不支持utimes
不支持append
......
 User & Group
POSIX定义的文件元数据中记录User & Group ID
如果系统中不存在该ID对应的User或Group:
# chown 12345:12345 TODO
stat显示UNKNOWN
# stat TODO
Uid: (12345/ UNKNOWN) Gid: (12345/ UNKNOWN)
ls显示ID
# ls -l TODO
-rw-r--r-- 1 12345 12345 6972 Dec 4 2013 TODO
Alluxio使用User & Group Name
如果系统中不存在该User或Group,则无法转换为ID,
目前折中的方案是使用挂载用户的User & Group ID
京东在Alluxio社区的贡献
4
JD Contribution to Alluxio
17
Business
Strategy
ui-grid based
sort/pagination/filter add
an input field
New Web UI
high watermark start evict
low watermark stop evict
Watermark Evict Strategy
check startsup
check every time
Cache Consistency
monitor JVM pause periodically
log message and metrics
JVM Pause Monitor
cp/ls/load/rm/format
Shell Command
Deadlock
thrift add timeout time
…
Bugfix
shell
RESTful API
Change Log Level
SyncQuery
AlluxioTools
…
Test
京东在Alluxio社区的贡献
18
近期贡献
4
3
1
2
6
5
解决偶发umount失败问题
创建文件或目录时支持指定permission
支持statfs,通过df命令可以查询挂载点信息
限制文件名长度不超过255个字符
解决CACHE_THROUGH模式下Alluxio
和HDFS文件属主不一致的问题
支持文件或目录的真实创建者
京东在Alluxio社区的贡献
19
持续发力
新功能开发
社区合作
技术分享
兼容性提升
Q & A
Thank You!

More Related Content

What's hot

What's hot (20)

Get Savvy with Snowflake
Get Savvy with SnowflakeGet Savvy with Snowflake
Get Savvy with Snowflake
 
SeaweedFS introduction
SeaweedFS introductionSeaweedFS introduction
SeaweedFS introduction
 
Hadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Hadoop World 2011: Advanced HBase Schema Design - Lars George, ClouderaHadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
Hadoop World 2011: Advanced HBase Schema Design - Lars George, Cloudera
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
HDFS Tiered Storage: Mounting Object Stores in HDFS
HDFS Tiered Storage: Mounting Object Stores in HDFSHDFS Tiered Storage: Mounting Object Stores in HDFS
HDFS Tiered Storage: Mounting Object Stores in HDFS
 
Apache Arrow: In Theory, In Practice
Apache Arrow: In Theory, In PracticeApache Arrow: In Theory, In Practice
Apache Arrow: In Theory, In Practice
 
Seastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for CephSeastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for Ceph
 
Delta: Building Merge on Read
Delta: Building Merge on ReadDelta: Building Merge on Read
Delta: Building Merge on Read
 
Apache Nifi Crash Course
Apache Nifi Crash CourseApache Nifi Crash Course
Apache Nifi Crash Course
 
AWS Summit Singapore 2019 | Snowflake: Your Data. No Limits
AWS Summit Singapore 2019 | Snowflake: Your Data. No LimitsAWS Summit Singapore 2019 | Snowflake: Your Data. No Limits
AWS Summit Singapore 2019 | Snowflake: Your Data. No Limits
 
Iceberg: a fast table format for S3
Iceberg: a fast table format for S3Iceberg: a fast table format for S3
Iceberg: a fast table format for S3
 
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
Best Practices for ETL with Apache NiFi on Kubernetes - Albert Lewandowski, G...
 
Making Data Timelier and More Reliable with Lakehouse Technology
Making Data Timelier and More Reliable with Lakehouse TechnologyMaking Data Timelier and More Reliable with Lakehouse Technology
Making Data Timelier and More Reliable with Lakehouse Technology
 
Object storage
Object storageObject storage
Object storage
 
Version control
Version controlVersion control
Version control
 
Ibm spectrum scale_backup_n_archive_v03_ash
Ibm spectrum scale_backup_n_archive_v03_ashIbm spectrum scale_backup_n_archive_v03_ash
Ibm spectrum scale_backup_n_archive_v03_ash
 
InnoDb Vs NDB Cluster
InnoDb Vs NDB ClusterInnoDb Vs NDB Cluster
InnoDb Vs NDB Cluster
 
Dataflow with Apache NiFi - Apache NiFi Meetup - 2016 Hadoop Summit - San Jose
Dataflow with Apache NiFi - Apache NiFi Meetup - 2016 Hadoop Summit - San JoseDataflow with Apache NiFi - Apache NiFi Meetup - 2016 Hadoop Summit - San Jose
Dataflow with Apache NiFi - Apache NiFi Meetup - 2016 Hadoop Summit - San Jose
 
Controllo di versione e Git
Controllo di versione e GitControllo di versione e Git
Controllo di versione e Git
 
Scaling HBase for Big Data
Scaling HBase for Big DataScaling HBase for Big Data
Scaling HBase for Big Data
 

Similar to Using Alluxio POSIX (FUSE) API in JD.com

基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站
Shawn Zhung
 
分会场六数据中心使用Cfs & vcs 节省it成本
分会场六数据中心使用Cfs & vcs 节省it成本分会场六数据中心使用Cfs & vcs 节省it成本
分会场六数据中心使用Cfs & vcs 节省it成本
ITband
 
基于PXE实现部署Linux服务器
基于PXE实现部署Linux服务器基于PXE实现部署Linux服务器
基于PXE实现部署Linux服务器
ekoing
 
Virtual file system (VFS)
Virtual file system (VFS)Virtual file system (VFS)
Virtual file system (VFS)
Waylin Ch
 
使用Ubuntu架設hadoop
使用Ubuntu架設hadoop使用Ubuntu架設hadoop
使用Ubuntu架設hadoop
taishanla
 
使用Ubuntu架設hadoop
使用Ubuntu架設hadoop使用Ubuntu架設hadoop
使用Ubuntu架設hadoop
taishanla
 
Zh tw introduction_to_hadoop and hdfs
Zh tw introduction_to_hadoop and hdfsZh tw introduction_to_hadoop and hdfs
Zh tw introduction_to_hadoop and hdfs
TrendProgContest13
 
Moodle 2.3 图文安装教程
Moodle 2.3 图文安装教程Moodle 2.3 图文安装教程
Moodle 2.3 图文安装教程
YUCHENG HU
 
51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry
Hong Cai
 
HDFS-In-Cloud
HDFS-In-CloudHDFS-In-Cloud
HDFS-In-Cloud
Lei Xu
 
Kick start无人值守批量安装linux
Kick start无人值守批量安装linuxKick start无人值守批量安装linux
Kick start无人值守批量安装linux
Yiwei Ma
 

Similar to Using Alluxio POSIX (FUSE) API in JD.com (20)

鏡像檔案系統 Mirror File System : MFS
鏡像檔案系統 Mirror File System : MFS鏡像檔案系統 Mirror File System : MFS
鏡像檔案系統 Mirror File System : MFS
 
Overlayfs and VFS
Overlayfs and VFSOverlayfs and VFS
Overlayfs and VFS
 
A possibility to install OS on CEPH
A possibility to install OS on CEPHA possibility to install OS on CEPH
A possibility to install OS on CEPH
 
基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站基于Ubuntu 12.04 LTS Server的无盘工作站
基于Ubuntu 12.04 LTS Server的无盘工作站
 
Use Alluxio to Unify Storage Systems in Suning
Use Alluxio to Unify Storage Systems in SuningUse Alluxio to Unify Storage Systems in Suning
Use Alluxio to Unify Storage Systems in Suning
 
分会场六数据中心使用Cfs & vcs 节省it成本
分会场六数据中心使用Cfs & vcs 节省it成本分会场六数据中心使用Cfs & vcs 节省it成本
分会场六数据中心使用Cfs & vcs 节省it成本
 
儲存三二話
儲存三二話儲存三二話
儲存三二話
 
基于PXE实现部署Linux服务器
基于PXE实现部署Linux服务器基于PXE实现部署Linux服务器
基于PXE实现部署Linux服务器
 
Virtual file system (VFS)
Virtual file system (VFS)Virtual file system (VFS)
Virtual file system (VFS)
 
[精彩回顾]Linux新手教程
[精彩回顾]Linux新手教程[精彩回顾]Linux新手教程
[精彩回顾]Linux新手教程
 
使用Ubuntu架設hadoop
使用Ubuntu架設hadoop使用Ubuntu架設hadoop
使用Ubuntu架設hadoop
 
使用Ubuntu架設hadoop
使用Ubuntu架設hadoop使用Ubuntu架設hadoop
使用Ubuntu架設hadoop
 
Zh tw introduction_to_hadoop and hdfs
Zh tw introduction_to_hadoop and hdfsZh tw introduction_to_hadoop and hdfs
Zh tw introduction_to_hadoop and hdfs
 
Moodle 2.3 图文安装教程
Moodle 2.3 图文安装教程Moodle 2.3 图文安装教程
Moodle 2.3 图文安装教程
 
51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry51 cto下载 51cto信息图:openshift vs cloudfoundry
51 cto下载 51cto信息图:openshift vs cloudfoundry
 
hicloud PaaS雲創平台(Java/PHP介紹)
hicloud PaaS雲創平台(Java/PHP介紹)hicloud PaaS雲創平台(Java/PHP介紹)
hicloud PaaS雲創平台(Java/PHP介紹)
 
HDFS-In-Cloud
HDFS-In-CloudHDFS-In-Cloud
HDFS-In-Cloud
 
2018 普安 EonStor GSe Pro 产品线介绍 (簡中版)
2018 普安 EonStor GSe Pro 产品线介绍 (簡中版)2018 普安 EonStor GSe Pro 产品线介绍 (簡中版)
2018 普安 EonStor GSe Pro 产品线介绍 (簡中版)
 
Kick start无人值守批量安装linux
Kick start无人值守批量安装linuxKick start无人值守批量安装linux
Kick start无人值守批量安装linux
 
Linux File system
Linux File systemLinux File system
Linux File system
 

More from Alluxio, Inc.

More from Alluxio, Inc. (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Optimizing Data Access for Analytics And AI with Alluxio
Optimizing Data Access for Analytics And AI with AlluxioOptimizing Data Access for Analytics And AI with Alluxio
Optimizing Data Access for Analytics And AI with Alluxio
 
Speed Up Presto at Uber with Alluxio Caching
Speed Up Presto at Uber with Alluxio CachingSpeed Up Presto at Uber with Alluxio Caching
Speed Up Presto at Uber with Alluxio Caching
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/MLBig Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
Big Data Bellevue Meetup | Enhancing Python Data Loading in the Cloud for AI/ML
 
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...
Alluxio Monthly Webinar | Why a Multi-Cloud Strategy Matters for Your AI Plat...
 
Alluxio Monthly Webinar | Five Disruptive Trends that Every Data & AI Leader...
Alluxio Monthly Webinar | Five Disruptive Trends that Every  Data & AI Leader...Alluxio Monthly Webinar | Five Disruptive Trends that Every  Data & AI Leader...
Alluxio Monthly Webinar | Five Disruptive Trends that Every Data & AI Leader...
 
Data Infra Meetup | FIFO Queues are All You Need for Cache Eviction
Data Infra Meetup | FIFO Queues are All You Need for Cache EvictionData Infra Meetup | FIFO Queues are All You Need for Cache Eviction
Data Infra Meetup | FIFO Queues are All You Need for Cache Eviction
 
Data Infra Meetup | Accelerate Your Trino/Presto Queries - Gain the Alluxio Edge
Data Infra Meetup | Accelerate Your Trino/Presto Queries - Gain the Alluxio EdgeData Infra Meetup | Accelerate Your Trino/Presto Queries - Gain the Alluxio Edge
Data Infra Meetup | Accelerate Your Trino/Presto Queries - Gain the Alluxio Edge
 
Data Infra Meetup | Accelerate Distributed PyTorch/Ray Workloads in the Cloud
Data Infra Meetup | Accelerate Distributed PyTorch/Ray Workloads in the CloudData Infra Meetup | Accelerate Distributed PyTorch/Ray Workloads in the Cloud
Data Infra Meetup | Accelerate Distributed PyTorch/Ray Workloads in the Cloud
 
Data Infra Meetup | ByteDance's Native Parquet Reader
Data Infra Meetup | ByteDance's Native Parquet ReaderData Infra Meetup | ByteDance's Native Parquet Reader
Data Infra Meetup | ByteDance's Native Parquet Reader
 
Data Infra Meetup | Uber's Data Storage Evolution
Data Infra Meetup | Uber's Data Storage EvolutionData Infra Meetup | Uber's Data Storage Evolution
Data Infra Meetup | Uber's Data Storage Evolution
 
Alluxio Monthly Webinar | Why NFS/NAS on Object Storage May Not Solve Your AI...
Alluxio Monthly Webinar | Why NFS/NAS on Object Storage May Not Solve Your AI...Alluxio Monthly Webinar | Why NFS/NAS on Object Storage May Not Solve Your AI...
Alluxio Monthly Webinar | Why NFS/NAS on Object Storage May Not Solve Your AI...
 
AI Infra Day | Accelerate Your Model Training and Serving with Distributed Ca...
AI Infra Day | Accelerate Your Model Training and Serving with Distributed Ca...AI Infra Day | Accelerate Your Model Training and Serving with Distributed Ca...
AI Infra Day | Accelerate Your Model Training and Serving with Distributed Ca...
 
AI Infra Day | The AI Infra in the Generative AI Era
AI Infra Day | The AI Infra in the Generative AI EraAI Infra Day | The AI Infra in the Generative AI Era
AI Infra Day | The AI Infra in the Generative AI Era
 
AI Infra Day | Hands-on Lab: CV Model Training with PyTorch & Alluxio on Kube...
AI Infra Day | Hands-on Lab: CV Model Training with PyTorch & Alluxio on Kube...AI Infra Day | Hands-on Lab: CV Model Training with PyTorch & Alluxio on Kube...
AI Infra Day | Hands-on Lab: CV Model Training with PyTorch & Alluxio on Kube...
 
AI Infra Day | The Generative AI Market And Intel AI Strategy and Product Up...
AI Infra Day | The Generative AI Market  And Intel AI Strategy and Product Up...AI Infra Day | The Generative AI Market  And Intel AI Strategy and Product Up...
AI Infra Day | The Generative AI Market And Intel AI Strategy and Product Up...
 
AI Infra Day | Composable PyTorch Distributed with PT2 @ Meta
AI Infra Day | Composable PyTorch Distributed with PT2 @ MetaAI Infra Day | Composable PyTorch Distributed with PT2 @ Meta
AI Infra Day | Composable PyTorch Distributed with PT2 @ Meta
 
AI Infra Day | Model Lifecycle Management Quality Assurance at Uber Scale
AI Infra Day | Model Lifecycle Management Quality Assurance at Uber ScaleAI Infra Day | Model Lifecycle Management Quality Assurance at Uber Scale
AI Infra Day | Model Lifecycle Management Quality Assurance at Uber Scale
 
Alluxio Monthly Webinar | Efficient Data Loading for Model Training on AWS
Alluxio Monthly Webinar | Efficient Data Loading for Model Training on AWSAlluxio Monthly Webinar | Efficient Data Loading for Model Training on AWS
Alluxio Monthly Webinar | Efficient Data Loading for Model Training on AWS
 

Using Alluxio POSIX (FUSE) API in JD.com

  • 2. 1 2 3 4 Alluxio FUSE在京东的应用 解读Alluxio FUSE原理和架构 Alluxio FUSE的POSIX兼容性 京东在Alluxio社区的贡献 目录
  • 5. Alluxio FUSE在京东的应用 – 早期海量文件共享服务 5 劣势 费时 数据从HDFS推送至 Cephfs,约增加一倍耗时 费力 需要数据一致性校 验,耗费大量时间 难度大Ceph集群不易运维,新 手难以掌握 稳定性 内核ceph模块增加 操作系统不稳定性 一写多读
  • 6. Alluxio FUSE在京东的应用 – 海量文件高速共享服务 6 缺点 • Alluxio FUSE宜采用Direct_IO,无Page Cache加速 • FUSE受限于架构设计,性能不及内核态fs • Alluxio的稳定性将影响BDP SLA A Hadoop Client集成Alluxio Client,应用编程无感知,只需 替换Schema B 数据经过Alluxio同步地写穿到 HDFS,耗时只是略微增加,省去 推送环节,较早期模型约缩短一 倍时间 C 不影响操作系统稳定性 D 同样使用Native fs,文件消 费者无感知
  • 7. Alluxio FUSE在京东的应用 - 备选方案 7 待改进 distributedLoad实际效果相比load性能提升有限,待进一步优化
  • 9. 解读Alluxio FUSE原理和架构 - 核心架构  FUSE: Filesystem in Userspace(用户空间文件系统) AlluxioFuseFileSystem extends FuseStubFS { + int create(String path, long mode, FuseFileInfo fi) + int open(String path, FuseFileInfo fi) + int chmod(String path, long mode) + int chown(String path, long uid, long gid) + int mkdir(String path, long mode) + int readdir(String path, Pointer buff, FuseFillDir filter, long offset, FuseFileInfo fi) ...... } 1 2 3 4 5 6 AlluxioFuse jnr-fuse libfuse vfs Alluxio基于jnr-fuse 实现用户态文件系统 的守护进程 fuse 的用户态库 An FUSE implementation in java using Java Native Runtime Virtual File System, 虚拟文件系统 /dev/fuse fuse模块创建的字符设 备,是内核与libfuse 交互的通道,所有挂载 点(Mount Point)共享 kernel fuse 基于vfs实现的内核模块
  • 10. 解读Alluxio FUSE原理和架构 - 使用方法  安装依赖 # yum install -y fuse-libs fuse  配置 # cat alluxio-2.0.0/conf/alluxio-site.properties alluxio.master.hostname=x.x.x.x # echo user_allow_other >> /etc/fuse.conf  挂载Alluxio FUSE # ./alluxio-2.0.0/integration/fuse/bin/alluxio-fuse mount -o <options> /mountpoint /path/in/alluxio  查看Alluxio FUSE挂载点 # ./alluxio-2.0.0/integration/fuse/bin/alluxio-fuse stat pid mount_point alluxio_path 130741 /mountpoint /path/in/alluxio  查看挂载参数 # mount -t fuse.alluxio-fuse alluxio-fuse on /mountpoint type fuse.alluxio-fuse (rw,nosuid,nodev,relatime,user_id=1001,group_id=1001,allow_other)  查看存储空间 # df -h -t fuse.alluxio-fuse Filesystem Size Used Avail Use% Mounted on alluxio-fuse 211T 53G 211T 1% /mountpoint  卸载Alluxio FUSE # ./alluxio-2.0.0/integration/fuse/bin/alluxio-fuse umount /mountpoint 或 # umount /mountpoint
  • 11. 解读Alluxio FUSE原理和架构 - 初始化流程 1. jnr-fuse将AlluxioFuseFileSystem打 包传给libfuse 2. libfuse打开/dev/fuse字符设备,返回 文件描述符fd(File Descriptor)。fd在 进程内的线程间共享,因此fuse很容 易支持multi-thread模式;fd在进程 间不共享,且file支持私有数据,因此 fuse支持多种类型的挂载点 3. mount系统调用传参fd,libfuse和 kernel fuse通过fd这个桥梁建立虚拟 连接 4. super_block和file的私有数据对应虚拟连接 5. multi-thread模式下,多个线程同时从/dev/fuse读取请求 6. 当前无请求时,read系统调用阻塞 7. 当请求到来时,唤醒被阻塞的线程,read返回文件系统请求
  • 14. Alluxio FUSE的POSIX兼容性 - 兼容性测试 14  fstest - 简化版的文件系统POSIX兼容性测试套件 https://www.tuxera.com/community/posix-test-suite/  使用方法 wget http://download.tuxera.com/sw/qa/pjd-fstest-20080816.tgz tar xf pjd-fstest-20080816.tgz cd pjd-fstest-20080816 make (切记,进入待测试目录!!!) cd /your/test/dir 整体测试 prove -r pjd-fstest-20080816/tests 单独测试 prove pjd-fstest-20080816/tests/unlink/00.t  定位失败测试 # strace -T -f -r prove pjd-fstest-20080816/tests/mkfifo/00.t > /tmp/ mkfifo.log 2>&1 [pid 54451] mknod("fstest_34c2d9dbec1aed322d9ffc452ce32469", S_IFIFO|0644 <unfinished ...> [pid 54451] <... mknod resumed> ) = -1 ENOSYS (Function not implemented) <0.000814> 01 03 02 04 05 06 ext4 极少数失败 kernel ceph 极少数失败 Alluxio-fuse 部分失败 xfs 极少数失败 ceph-fuse 少数失败 hdfs-fuse 大部分失败
  • 15. Alluxio FUSE的POSIX兼容性 - 兼容性 15  兼容列表 create, rename, open, unlink getattr, chmod, chown mkdir, readdir ,rmdir read, write, flush dup2 ……  不兼容列表 不支持在创建文件或目录时指定权限<已解决> 不支持修改文件属主或属组为当前不存在的用户或组 不支持软连接 未检查文件名长度是否超出255 <已解决> 不支持mkfifo, mknod 不支持truncate 不支持扩展属性 不支持fallocate 不支持utimes 不支持append ......  User & Group POSIX定义的文件元数据中记录User & Group ID 如果系统中不存在该ID对应的User或Group: # chown 12345:12345 TODO stat显示UNKNOWN # stat TODO Uid: (12345/ UNKNOWN) Gid: (12345/ UNKNOWN) ls显示ID # ls -l TODO -rw-r--r-- 1 12345 12345 6972 Dec 4 2013 TODO Alluxio使用User & Group Name 如果系统中不存在该User或Group,则无法转换为ID, 目前折中的方案是使用挂载用户的User & Group ID
  • 17. JD Contribution to Alluxio 17 Business Strategy ui-grid based sort/pagination/filter add an input field New Web UI high watermark start evict low watermark stop evict Watermark Evict Strategy check startsup check every time Cache Consistency monitor JVM pause periodically log message and metrics JVM Pause Monitor cp/ls/load/rm/format Shell Command Deadlock thrift add timeout time … Bugfix shell RESTful API Change Log Level SyncQuery AlluxioTools … Test
  • 20. Q & A