美文网首页
Alluxio集群使用HDFS作为文件系统

Alluxio集群使用HDFS作为文件系统

作者: 虫儿飞ZLEI | 来源:发表于2019-09-27 17:33 被阅读0次

    说明

    Alluxio默认使用本地文件作为文件系统
    alluxio.master.mount.table.root.ufs=${alluxio.work.dir}/underFSStorage

    可以通过设置修改Alluxio,让Alluxio使用HDFS作为文件系统。

    1. 配置

    1.1 在hdfs上面创建好相关目录

    比如本例中在hdfs上创建了/alluxios/home目录

    1.2 修改alluxio-site.preperties

    alluxio.master.mount.table.root.ufs=hdfs://ip:8020/alluxios/home
    namenode所在的机器和端口

    2.启动

    2.1 启动之前

    如果alluxio服务在启动的话,先将alluxio服务全部关闭
    ./bin/alluxio-stop.sh all

    然后执行

    ./bin/alluxio format
    

    2.2 启动

    ./bin/alluxio-start.sh all SudoMount
    

    ps:关于 SudoMount还是Mount可以参考https://www.jianshu.com/p/f417806156cf

    3.测试

    3.1 创建文件夹

    上面的操作我们已经把hdfs的alluxios/home目录挂载为alluxio的根目录,首先我们从alluxio中创建一个文件夹

    ./bin/alluxio fs mkdir mkdirfromalluxio
    

    然后我们从hdfs上面创建一个文件夹

    hadoop dfs -mkdir /alluxios/home/mkdirfromhdfs
    

    验证:
    从alluxio的页面上查看:


    两个目录都在

    3.2 运行示例

    ./bin/alluxio runTests
    就是上传一些文件和文件夹
    

    运行之后在alluxio中和hdfs中都可以看到这个目录



    相关文章

      网友评论

          本文标题:Alluxio集群使用HDFS作为文件系统

          本文链接:https://www.haomeiwen.com/subject/wcjauctx.html