1、功能测试
0)查看命令
alluxio fs ls /cos alluxio fs cat /cos/t
1)上传文件到alluxio
alluxio fs copyFromLocal /local /alluxio 下载到本地 alluxio fs copyToLocal /alluxio /local
本地上传数据到alluxio映射的cos上。
alluxio fs copyFromLocal dt=2021-09-06 /cos/shaiwu_check/
2) alluxio文件持久化到HDFS
alluxio fs persist /anaconda-ks.cfg hadoop fs -ls /alluxio
持久化的过程中,文件状态是TO_BE_PERSISTED
3)释放alluxio的文件
alluxio fs free /anaconda-ks.cfg
4) 重新加载HDFS文件到alluxio文件
alluxio fs load /anaconda-ks.cfg
5)删除alluxio的文件
alluxio fs rm /anaconda-ks.cfg
6)注册主动监听,同步hdfs上文件变动(2.0功能,1.8qing)
监控alluxio的根目录 alluxio fs startSync /
7)在alluxio上复制文件
alluxio fs cp /xx.txt /xxx.txt 通过Alluxio将数据从COS上拉取到HDFS
8)将底层系统挂载到Alluxio
alluxio fs mount alluxioPath ufsPath
9)Pin锁定文件不释放,释放则报错
2、数据处理功能
1)hive建表
create table x( name string ) LOCATION 'alluxio://127.0.0.1:19998/cos/shaiwu_check'; #alluxio://alluxio-master:port/path
2)Spark等引擎获取数据
spark-sql> select article_id,count(1) from bi_app.dwd_zdm_alluxio_content_shaiwu_check group by article_id limit 10;
写入
insert overwrite table test.xxx partition(dt='2021-09-02') select 字段a,字段b,....字段z from test.xxxx where dt='2021-09-03';
查看写入后的底层,均在内存当中。
2、性能测试
读取870W数据
简单聚合(count操作)操作 Alluxio比HDFS 快 0.5秒
复杂聚合(多次聚合开窗)操作 Alluxio比HDFS 快 5秒